Submission #873417

# Submission time Handle Problem Language Result Execution time Memory
873417 2023-11-15T04:48:32 Z vjudge1 Colors (RMI18_colors) C++17
7 / 100
77 ms 2504 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f first
#define s second
ll a[200100],b[200100];
void solve(){
    ll n,m; cin>>n>>m;
    map<ll, bool> mp;
    for(ll i=1; i<=n; i++){
        cin>>a[i];
        mp[a[i]]=true;
    }
    for(ll i=1; i<=n; i++) cin>>b[i];
    for(ll i=1; i<=m; i++){
        ll u,v; cin>>u>>v;
    }
    for(ll i=1; i<=n; i++){
        if(b[i] > a[i] || !mp[b[i]]){
            cout<<"0";
            return;
        }
    }
    cout<<"1";
}        
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);  
    int t=1;
    cin>>t;    
    for(int i=1; i<=t; i++){
        solve();
        cout<<'\n';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 31 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 35 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 77 ms 2504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 2392 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -