제출 #894163

#제출 시각아이디문제언어결과실행 시간메모리
894163ozner77Arranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> using namespace std; int main() { int a,b,c; vector<int> V; scanf("%d",&a); for(int i=0;i<a*2;i++){ scanf("%d",&b); V.push_back(b); } if(V[0]<0){ printf("%d",0); }else{ printf("%d",1); } }

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

shoes.cpp: In function 'int main()':
shoes.cpp:6:10: warning: unused variable 'c' [-Wunused-variable]
    6 |  int a,b,c;
      |          ^
shoes.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d",&a);
      |     ~~~~~^~~~~~~~~
shoes.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%d",&b);
      |         ~~~~~^~~~~~~~~
/usr/bin/ld: /tmp/ccI6THu4.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccRuvsp3.o:shoes.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccI6THu4.o: in function `main':
grader.cpp:(.text.startup+0x2a8): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status