제출 #204330

#제출 시각아이디문제언어결과실행 시간메모리
204330ADJAArranging Shoes (IOI19_shoes)C++14
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define sz(x) (int) x.size()
#define all(x) x.begin(), x.end()

using namespace std;

const int MAXN = 105000;

long long count_swaps(int S[]) {
  int result = 0;
  if (S[0] > 0) {
    result++;
  }
  return result;
}

int n;
int s[MAXN];

int main() {

  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    scanf("%d", &s[i]);
  }

  cout << count_swaps(s) << endl;
}

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

shoes.cpp: In function 'int main()':
shoes.cpp:36:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &s[i]);
     ~~~~~^~~~~~~~~~~~~
/tmp/cc5WkQw2.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc3JIyhm.o:shoes.cpp:(.text.startup+0x0): first defined here
/tmp/cc5WkQw2.o: In function `main':
grader.cpp:(.text.startup+0x272): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status