Submission #433858

#TimeUsernameProblemLanguageResultExecution timeMemory
433858medmdgGame (IOI14_game)C++14
0 / 100
2 ms460 KiB
#include "game.h" #include<bits/stdc++.h> #define ll int using namespace std; vector<ll> c; vector<bool> vis; ll h=0; void initialize(int n) { c.clear(); vis.clear(); for(int i=0;i<n;i++){ c.push_back(0); vis.push_back(false); } } int hasEdge(int u, int v) { h++; ll n=c.size(); if(h==c.size()) return 1; u--; v--; c[u]++; c[v]++; if((c[u]==n&&!vis[u])||c[v]==n&&!vis[v]){ vis[u]=true; vis[v]=true; return 1; } return 0; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:20:9: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     if(h==c.size())    return 1;
      |        ~^~~~~~~~~~
game.cpp:25:35: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   25 |     if((c[u]==n&&!vis[u])||c[v]==n&&!vis[v]){
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...