/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 21ms 540.0 KiB
#3 Accepted 18ms 540.0 KiB
#4 Accepted 5ms 584.0 KiB
#5 Accepted 34ms 612.0 KiB
#6 Accepted 34ms 1.281 MiB
#7 Accepted 35ms 1.281 MiB

Code

//sadias
#include <bits/stdc++.h>
using namespace std;

int main(){

      int t;
      cin >> t;

      int n, m;
      while(t--){
        cin >> n >> m;
        int ar[n], arr[m];
        int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, y = 0, o = 0;

        for(int i = 0; i < n; i++){
            cin >> ar[i];
            if(ar[i] == 1) a++;
            if(ar[i] == 2) b++;
            if(ar[i] == 3) c++;
            if(ar[i] == 4) d++;
            if(ar[i] == 5) e++;
            if(ar[i] == 6) f++;
            if(ar[i] == 7) g++;
            if(ar[i] == 8) h++;
            if(ar[i] == 9) y++;
            if(ar[i] == 0) o++;
        }
        bool check = false;

        if(a == 0 || b == 0 || c == 0 || d == 0 || e == 0 || f == 0 || g == 0 || h == 0 || y == 0 || o == 0){
            check = true;
        }
        a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, y = 0, o = 0;
        for(int i = 0; i < m; i++){
            cin >> arr[i];
            if(arr[i] == 1) a++;
            if(arr[i] == 2) b++;
            if(arr[i] == 3) c++;
            if(arr[i] == 4) d++;
            if(arr[i] == 5) e++;
            if(arr[i] == 6) f++;
            if(arr[i] == 7) g++;
            if(arr[i] == 8) h++;
            if(arr[i] == 9) y++;
            if(arr[i] == 0) o++;
        }
        if(a == 0 || b == 0 || c == 0 || d == 0 || e == 0 || f == 0 || g == 0 || h == 0 || y == 0 || o == 0){
            check = true;
        }

        if(check) cout << "NO\n";
        else cout << "YES\n";

      }




  return 0;
}

Information

Submit By
Type
Submission
Problem
P1153 Is Date Possible?
Contest
Happy New Year 2025
Language
C++17 (G++ 13.2.0)
Submit At
2025-01-02 14:55:58
Judged At
2025-01-02 14:55:58
Judged By
Score
80
Total Time
35ms
Peak Memory
1.281 MiB