/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

#include <bits/stdc++.h>
#define fast() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define lli long long int
#define endl "\n"

using namespace std;
 
void solve(){
    int n, m;
    cin >> n >> m;
    //vector<char> a(),b();
    char a[n],b[m];
    for (int i = 0; i < n; ++i)
    {
        cin>>a[i];
    }
    for (int i = 0; i < n; ++i)
    {
        cin>>b[i];
    }
    string s = "0123456789";

    
    int x=max(n,m);
    //cout<<x<<endl;
    int count = 0;
    for(int i = 0; i < 10;i++){
        for(int j =0;j<x;j++){
            if(s[i]==a[j]||s[i]==b[j]){
                count++;
                break;
            }
        }
        //cout << s[i]<<endl;
    }
    //cout <<count<<endl;
    if(count>=10)
        cout << "YES"<<endl;
    else
        cout<<"NO"<<endl;

}
 
signed main() {
    fast();
    int t;
    cin >> t;
    while (t--)
        solve();
    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 15:59:15
Judged At
2025-01-02 15:59:15
Judged By
Score
0
Total Time
2ms
Peak Memory
532.0 KiB