Submission #874054

#TimeUsernameProblemLanguageResultExecution timeMemory
874054WongYiKaiFriend (IOI14_friend)C++17
Compilation error
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; } }

Compilation message (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