Submission #519812

#TimeUsernameProblemLanguageResultExecution timeMemory
519812ACE_Game (IOI14_game)C++14
100 / 100
298 ms29524 KiB
#include "game.h" #include<bits/stdc++.h> #define maxn 1505 using namespace std; int p[maxn], c[maxn], sz; vector<int> x[maxn]; void initialize(int n) { for (int i = 0; i < n; i++) p[i] = i, c[i] = 0; sz = 1; } int hasEdge(int u, int v) { if (p[v] == 1) swap(u, v); if (p[v] != 1 && p[u] != 1) { x[u].push_back(v), x[v].push_back(u); return 0; } if (c[v] == sz - 1) { for (int j = 0; j < x[v].size(); j++) c[x[v][j]]++; p[v] = 1; sz++; return 1; } c[v]++; return 0; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:18:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |   for (int j = 0; j < x[v].size(); j++) c[x[v][j]]++;
      |                   ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...