제출 #1080407

#제출 시각아이디문제언어결과실행 시간메모리
1080407thelegendary08City (JOI17_city)C++14
컴파일 에러
0 ms0 KiB
#include "Device.h" void InitDevice() { } int Answer(long long S, long long T) { //cout<<S<<' '<<T<<'\n'; ll szs = S / 262144; ll szt = T / 262144; ll cs = S % 262144; ll ct = T % 262144; //cout<<cs<<' '<<ct<<' '<<szs<<' '<<szt<<'\n'; if(cs + szs > ct && ct > cs)return 1; if(ct + szt > cs && cs > ct)return 0; return 2; }

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

/usr/bin/ld: /tmp/cc5AAsqL.o: in function `main':
grader_encoder.cpp:(.text.startup+0xd1): undefined reference to `Encode(int, int*, int*)'
collect2: error: ld returned 1 exit status

Device.cpp: In function 'int Answer(long long int, long long int)':
Device.cpp:10:2: error: 'll' was not declared in this scope
   10 |  ll szs = S / 262144;
      |  ^~
Device.cpp:11:4: error: expected ';' before 'szt'
   11 |  ll szt = T / 262144;
      |    ^~~~
      |    ;
Device.cpp:12:4: error: expected ';' before 'cs'
   12 |  ll cs = S % 262144;
      |    ^~~
      |    ;
Device.cpp:13:4: error: expected ';' before 'ct'
   13 |  ll ct = T % 262144;
      |    ^~~
      |    ;
Device.cpp:15:5: error: 'cs' was not declared in this scope
   15 |  if(cs + szs > ct && ct > cs)return 1;
      |     ^~
Device.cpp:15:10: error: 'szs' was not declared in this scope
   15 |  if(cs + szs > ct && ct > cs)return 1;
      |          ^~~
Device.cpp:15:16: error: 'ct' was not declared in this scope
   15 |  if(cs + szs > ct && ct > cs)return 1;
      |                ^~
Device.cpp:16:5: error: 'ct' was not declared in this scope
   16 |  if(ct + szt > cs && cs > ct)return 0;
      |     ^~
Device.cpp:16:10: error: 'szt' was not declared in this scope
   16 |  if(ct + szt > cs && cs > ct)return 0;
      |          ^~~
Device.cpp:16:16: error: 'cs' was not declared in this scope
   16 |  if(ct + szt > cs && cs > ct)return 0;
      |                ^~