Submission #960397

#TimeUsernameProblemLanguageResultExecution timeMemory
960397IUA_Hasin게임 (IOI14_game)C++17
15 / 100
1 ms604 KiB
#include <bits/stdc++.h>
 
#define endl                                "\n"
#define yeap                                cout<<"YES"<<endl
#define nope                                cout<<"NO"<<endl
#define ll                                  long long
 
using namespace std; 
 

#include "game.h"

ll cnt, a, b, status, c, d;
void initialize(int n) {
    cnt = 0;
    status = -1;
}

int hasEdge(int u, int v) {
    if(cnt==0){
        a = u;
        b = v;
        cnt++;
        ll cn = 0;
        for(int i=0; i<4; i++){
            if(i!=a && i!=b){
                if(cn==0){
                    c = i;
                    cn++;
                } else {
                    d = i;
                }
            }
        }
        // cout << c << " " << d << endl;
        return 1;
    } else {
        cnt++;
        if(cnt==5){
            if(u==c && v==d){
                status = 1;
                return 1;
            } else if(u==d && v==c){
                status = 1;
                return 1;
            } else {
                if(status==1){
                    return 0;
                } else {
                    return 1;
                }
            }
        } else {
            if(u==c && v==d){
                status = 1;
                return 1;
            } else if(u==d && v==c){
                status = 1;
                return 1;
            } else {
                return 0;
            }
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...