/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Wrong Answer 13ms 540.0 KiB
#3 Accepted 10ms 540.0 KiB
#4 Accepted 3ms 512.0 KiB
#5 Accepted 19ms 588.0 KiB
#6 Accepted 19ms 564.0 KiB
#7 Accepted 19ms 560.0 KiB

Code

// Author: Shawn Das Shachin-->(shawn_das)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define pb push_back
#define mod 1000000007
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(),v.rend())
#define OPTIMIZE_IO ios::sync_with_stdio(false); cin.tie(nullptr);

void solve(){
    int n, m;
    cin >> n >> m;
    set<int> una, unb;
    bool hz1=false,hz2=false;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if(x==0)hz1=true;
        una.insert(x);
    }
    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        if(x==0)hz2=true;
        unb.insert(x);
    }
    int sum1=0,sum2=0;
    for(auto &it: una)sum1+=it;
    for(auto &it: unb)sum2+=it;

    if (sum1==45 && sum2==45 && hz1 && hz2) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}

int main() {
    OPTIMIZE_IO;
    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:27:06
Judged At
2025-01-02 15:27:06
Judged By
Score
80
Total Time
19ms
Peak Memory
588.0 KiB