# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
876623 | 2023-11-22T06:03:53 Z | quocbaoo | Vlak (COCI20_vlak) | C++14 | 7 ms | 2648 KB |
#include<bits/stdc++.h> using namespace std; bool kt=false;vector<pair<char,int> > v[140],v1[140]; void dfs(char k,int u){ if (kt==true) return; //cout<<k; if (u%2==1){ int d=0; for (int j=0;j<v1[int(k)].size();j++) { if (v1[int(k)][j].second==u+1) d++,dfs(v1[int(k)][j].first,u+1); } if (d==0) { kt=true;return; } } else{ if (v[int(k)].size()==0) return; for (int j=0;j<v[int(k)].size();j++){ if (v[int(k)][j].second==u+1) dfs(v[int(k)][j].first,u+1); } } } int main(){ int n;cin>>n;bool mp[140]={}; for (int i=1;i<=n;i++){ string s;cin>>s;mp[int(s[0])]=true; for (int j=0;j<s.size()-1;j++){ v[int(s[j])].push_back({s[j+1],j+2}); } } int m;cin>>m; for (int i=1;i<=m;i++){ string s1;cin>>s1; for (int j=0;j<s1.size()-1;j++){ v1[int(s1[j])].push_back({s1[j+1],j+2}); } } for (char c='a';c<='z';c++){ if (mp[int(c)]==true) dfs(c,1); if (kt==true) { cout<<"Nina";return 0; } } cout<<"Emilija"; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 756 KB | Output is correct |
2 | Correct | 0 ms | 448 KB | Output is correct |
3 | Correct | 1 ms | 344 KB | Output is correct |
4 | Incorrect | 1 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Incorrect | 0 ms | 348 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 2396 KB | Output is correct |
2 | Incorrect | 7 ms | 2648 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 2404 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 2392 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |