답안 #874054

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
874054 2023-11-16T08:36:39 Z WongYiKai 친구 (IOI14_friend) C++17
컴파일 오류
0 ms 0 KB
#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

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