# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
868976 |
2023-11-02T17:34:41 Z |
SalihSahin |
Tenis (COI19_tenis) |
C++14 |
|
204 ms |
29252 KB |
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
const int inf = 1e18 + 5;
vector<pair<int, int> > adj[N];
int32_t main(){
cin.tie(0); cout.tie(0);
ios_base::sync_with_stdio(false);
int n, q;
cin>>n>>q;
vector<vector<int> > arr(n, vector<int>(3));
for(int i = 0; i < 3; i++){
for(int j = 0; j < n; j++){
cin>>arr[i][j];
}
}
vector<int> cnt(n+1), vis(n+1);
map<int, int> ans;
int tri = 0;
for(int i = 0; i < n; i++){
cnt[arr[0][i]]++;
cnt[arr[1][i]]++;
cnt[arr[2][i]]++;
if(cnt[arr[0][i]] == 3){
tri++;
vis[arr[0][i]] = 1;
}
if(!vis[arr[1][i]] && cnt[arr[1][i]] == 3){
tri++;
vis[arr[1][i]] = 1;
}
if(!vis[arr[2][i]] && cnt[arr[2][i]] == 3){
tri++;
vis[arr[2][i]] = 1;
}
if(tri == i+1){
for(int j = 1; j <= n; j++){
if(vis[j]) ans[j] = 1;
}
break;
}
}
while(q--){
int qt, x;
cin>>qt>>x;
if(ans[x]) cout<<"DA"<<endl;
else cout<<"NE"<<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
5464 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
5464 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
5464 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
204 ms |
29252 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
5464 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |