| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1300683 | wood | Vlak (COCI20_vlak) | C++20 | 22 ms | 41824 KiB |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
#define vint vector<int>
#define vpint vector<pint>
#define vll vector<ll>
#define vpll vector<pll>
#define fast_cin() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define MOD %= 1000000007
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <class T>
using Tree =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int N = 2e5+2;
int A[N][26];
int B[N][26];
bool dfs(int u, int d){
if(u==-1) return false;
bool b = false;
for(int i = 0; i<26; i++){
int v = A[u][i];
int vp = B[u][i];
if(d%2==1) swap(v,vp);
if(v!=-1){
b |= !dfs(vp,d+1);
}
}
return b;
}
void solve() {
int n; cin>>n;
string s[n];
for(int i = 0; i<n; i++) cin>>s[i];
int m; cin>>m;
string b[m];
for(int i = 0; i<m; i++) cin>>b[i];
memset(A,-1,sizeof A);
memset(B,-1,sizeof B);
int nodecnt = 1;
for(auto x : s){
int node = 0;
for(auto c : x){
if(A[node][c-'a']==-1) A[node][c-'a'] = nodecnt++;
node = A[node][c-'a'];
}
}
nodecnt = 1;
for(auto x : b){
int node = 0;
for(auto c : x){
if(B[node][c-'a']==-1) B[node][c-'a'] = nodecnt++;
node = B[node][c-'a'];
}
}
if(dfs(0,0)){
cout<<"Nina\n";
}
else{
cout<<"Emilija\n";
}
}
int main() {
fast_cin();
#ifdef MYPC
freopen("input.in", "r", stdin);
#else
string filename="";
if(!filename.empty()) {
freopen((filename+".in").c_str(), "r", stdin);
freopen((filename+".out").c_str(), "w", stdout);
}
#endif
int t;
t = 1;
while (t--) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
