제출 #1043604

#제출 시각아이디문제언어결과실행 시간메모리
1043604pravcoder게임 (IOI14_game)C++14
0 / 100
1 ms412 KiB
#include "game.h" #include <vector> #include <cmath> #include <iostream> #include <cstdio> #include <algorithm> using namespace std; typedef vector<int> vi; #define pb push_back int strat = 0; int i = 0; int r = 0; vi s1d(5, -1); /*{ | 0: first question city 0 | 1: first question city 1 | 2: island 0 | 3: island 1 | 4: asked about second island? (0/1) }*/ void initialize(int n) { if (n==4) { strat = 1; s1d[4] = 0; } else { strat = 0; } r = n*(n-1) / 2; } int s1(int u, int v) { if (v<u) swap(u, v); if (i==1) { s1d[0] = u; s1d[1] = v; return 0; } else if (i==2) { if (u != s1d[0] && u != s1d[1] && v != s1d[0] && v != s1d[1]) { return 0; } else { s1d[2] = u; s1d[3] = v; return 1; } } else { if (s1d[2] == -1) { s1d[2] = u; s1d[3] = v; return 1; } else if (u == s1d[2] && v == s1d[3]) { s1d[4] = 1; return 1; } else if (s1d[4] == 1) { return 0; } else { return i == r - 1; } } } int hasEdge(int u, int v) { i++; if (strat == 1) return s1(u, v); return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...