답안 #30423

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
30423 2017-07-23T10:31:05 Z kavun 게임 (IOI14_game) C++14
0 / 100
0 ms 10872 KB
#include "game.h"
#include <bits/stdc++.h>

using namespace std;
int cc[2000], cccnt[2000], N, cnt;
vector <int> ccver[2000];

void initialize(int n) {
  N = n;
}

int hasEdge(int u, int v) {
  if(cc[u] == cc[v])
    return 1;
  if(cccnt[u] == N-1)
    {
      for(int i = 0; i < ccver[cc[u]].size(); i++)
	ccver[cc[v]].push_back(ccver[cc[u]][i]), cc[ccver[cc[u]][i]] = cc[v];
      return 1;
    }
  if(cccnt[v] == N-1)
    {
      for(int i = 0; i < ccver[cc[v]].size(); i++)
	ccver[cc[u]].push_back(ccver[cc[v]][i]), cc[ccver[cc[v]][i]] = cc[u];
      return 1;
    }
  else
    {
      cccnt[u]++;
      cccnt[v]++;
      return 0;
    }
}

Compilation message

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:17:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i = 0; i < ccver[cc[u]].size(); i++)
                        ^
game.cpp:23:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int i = 0; i < ccver[cc[v]].size(); i++)
                        ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 10872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 10872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 10872 KB Output isn't correct
2 Halted 0 ms 0 KB -