# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
452053 |
2021-08-03T17:05:42 Z |
Apiram |
Vlak (COCI20_vlak) |
C++14 |
|
67 ms |
14104 KB |
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;cin>>n;
vector<string>arr(n);
int maxxy=0,minny=0;
for (int i =0;i<n;++i){cin>>arr[i];minny=max(minny,(int)arr[i].length());}
int m;cin>>m;
vector<string>brr(m);
for (int j = 0;j<m;++j){
cin>>brr[j];
maxxy=max(maxxy,(int)brr[j].length());
}
vector<set<string>>first(min(maxxy,minny)+1),second(min(maxxy,minny)+1);
for (int i = 0;i<n;++i){
string s;
for (int j = 0;j<min((int)arr[i].length(),min(minny,maxxy)+1);++j){
s+=arr[i][j];
first[j].insert(s);
}
}
for (int i = 0;i<m;++i){
string s;
for (int j = 0;j<min((int)brr[i].length(),min(minny,maxxy)+1);++j){
s+=brr[i][j];
second[j].insert(s);
}
}
int ok=0;
for (int i = 0;i<min(minny,maxxy)+1;++i){
if (i%2==0){
for (auto x:first[i]){
if (second[i].find(x)==second[i].end()){
ok=1;
break;
}
}
}
else{
for (auto x:second[i]){
if (first[i].find(x)==first[i].end()){
ok=2;
break;
}
}
}
if (ok)break;
}
if (ok%2==1){
cout<<"Nina\n";
}
else {
cout<<"Emilija\n";
}
return 0;}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
460 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
460 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
1 ms |
332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
56 ms |
9736 KB |
Output is correct |
2 |
Incorrect |
67 ms |
9712 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
66 ms |
14104 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
67 ms |
11160 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |