제출 #874054

#제출 시각아이디문제언어결과실행 시간메모리
874054WongYiKai친구 (IOI14_friend)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,temp,temp2,test = 0,high = 0; cin >> n; int con[n],host[n],prot[n]; for (int i=0;i<n;i++){ cin >> temp; con[i] = temp; high = max(high,temp); } for (int i=1;i<n;i++){ cin >> temp >> temp2; host[i] = temp; prot[i] = temp2; if (temp2 != 2) test = 1; } if (test == 0){ cout << high; } }

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

friend.cpp: In function 'int main()':
friend.cpp:8:9: warning: variable 'con' set but not used [-Wunused-but-set-variable]
    8 |     int con[n],host[n],prot[n];
      |         ^~~
friend.cpp:8:16: warning: variable 'host' set but not used [-Wunused-but-set-variable]
    8 |     int con[n],host[n],prot[n];
      |                ^~~~
friend.cpp:8:24: warning: variable 'prot' set but not used [-Wunused-but-set-variable]
    8 |     int con[n],host[n],prot[n];
      |                        ^~~~
/usr/bin/ld: /tmp/ccOoPSHW.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cctrWDlX.o:friend.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccOoPSHW.o: in function `main':
grader.cpp:(.text.startup+0xdd): undefined reference to `findSample(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status