#pragma GCC optimize("-O3")
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
int main()
{
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
cin >> n;
vector<string> nin(n);
for (auto& it : nin)
cin >> it;
int m;
cin >> m;
vector<string> em(m);
for (auto& it : em)
cin >> it;
map<int, int> who;
for (auto ni : nin)
{
for (auto e : em)
{
int pref = 0;
for (int i = 0; i < min((int)ni.size(), (int)e.size()); i++)
if (ni[i] == e[i])
pref++;
else break;
if (pref == 0)
{
who[0]++;
}
else if (pref == min((int)ni.size(), (int)e.size()))
{
if (min((int)ni.size(), (int)e.size()) % 2)
who[0]++;
else
who[1]++;
}
else
{
if (!(pref % 2))
who[0]++;
else
who[1]++;
}
}
}
if (who[0] > who[1])
cout << "Nina";
else
cout << "Emilija";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1063 ms |
1004 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
152 ms |
748 KB |
Output is correct |
2 |
Correct |
163 ms |
876 KB |
Output is correct |
3 |
Correct |
161 ms |
620 KB |
Output is correct |
4 |
Correct |
144 ms |
620 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
555 ms |
1004 KB |
Output is correct |
2 |
Incorrect |
504 ms |
1004 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |