/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 532.0 KiB
#2 Wrong Answer 21ms 532.0 KiB

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];

        for(int i = 0; i < n; i++){
            cin >> ar[i];
        }

        for(int j = 0; j < m; j++){
            cin >> arr[j];
        }

        int a=0, b=0;
        sort(ar, ar+n);
        sort(arr, arr+m);


        for(int i = 0; i < n-1; i++){

        	if(ar[i] == ar[i+1])
        		a++;
        }
        a++;
        for(int j = 0; j < m-1; j++){

        	if(arr[j] == arr[j+1])
        		b++;
        }
        b++;
        int n1 = n-a, m1 = m-b;
        if((n1 == 10 || (n == 10 && a == 1)) && (m1 == 10 || (m == 10 && b == 1)))
        cout << "YES\n";
        else
        cout << "NO\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 16:29:53
Judged At
2025-01-02 16:29:53
Judged By
Score
0
Total Time
21ms
Peak Memory
532.0 KiB