제출 #100513

#제출 시각아이디문제언어결과실행 시간메모리
100513Sakamotoo게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; long long r,c; long long x[30000],y[30000],val[30000]; vector<long long> v; int ke; long long gcd2(long long X, long long Y) { long long tmp; while (X != Y && Y != 0) { tmp = X; X = Y; Y = tmp % Y; } return X; } void init(int R, int C) { r=R; c=C; } void update(int P, int Q, long long K) { bool ada=true; for(int i=0; i<v.size(); i++){ int ind=v[i]; if(x[ind]==P&&y[ind]==Q){ val[ind]=K; ada=false; } } if(ada){ v.push_back(ke); x[ke]=P; y[ke]=Q; val[ke]=K; ke++; } } long long calculate(int P, int Q, int U, int V) { long long now=0; for(int i=0; i<v.size(); i++){ int ind=v[i]; if(x[ind]>=P&&x[ind]<=U&&y[ind]>=Q&&y[ind]<=V) now=gcd2(now,val[ind]); } return now; }

컴파일 시 표준 에러 (stderr) 메시지

game.cpp: In function 'void update(int, int, long long int)':
game.cpp:27:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<v.size(); i++){
                  ~^~~~~~~~~
game.cpp: In function 'long long int calculate(int, int, int, int)':
game.cpp:45:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<v.size(); i++){
                  ~^~~~~~~~~
/tmp/cc4mzMrb.o: In function `main':
grader.cpp:(.text.startup+0x14): undefined reference to `initialize(int)'
grader.cpp:(.text.startup+0x57): undefined reference to `hasEdge(int, int)'
collect2: error: ld returned 1 exit status