Submission #934391

#TimeUsernameProblemLanguageResultExecution timeMemory
934391bashNewbieVlak (COCI20_vlak)C++17
20 / 70
10 ms10840 KiB
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; #define fast_io ios::sync_with_stdio(0), cin.tie(0) #define vi vector<int> const int N = 2e5+7, K = 26; int adj[2][N][K], ctr[2]; void add(string& s, int d) { int x = 0; for(char ch: s) { int c = ch-'a', y = adj[d][x][c]; if(!y) adj[d][x][c] = ++ctr[d]; x = adj[d][x][c]; } } int dfs(int x, int d) { int wx = 0; for(int y: adj[d][x]) { if(!y) continue; wx |= dfs(y, d^1)^1; } return wx; } int main() { fast_io; int n; string s; for(int k = 0; k < 2; k++) { cin >> n; for(int i = 0; i < n; i++) { cin >> s; add(s, k); } } int ret = dfs(0, 0); cout << (ret? "Nina": "Emilija") << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...