제출 #143644

#제출 시각아이디문제언어결과실행 시간메모리
143644ignaciocantaArranging Shoes (IOI19_shoes)C++14
컴파일 에러
0 ms0 KiB
#include "shoes.h" long long count_swaps(std::vector<int> s) { int n = s.size(); int count = 0; forn(i, n){ if(s[i] < 0) cont++; } return cont; }

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

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:6:7: error: 'i' was not declared in this scope
  forn(i, n){
       ^
shoes.cpp:6:2: error: 'forn' was not declared in this scope
  forn(i, n){
  ^~~~
shoes.cpp:9:9: error: 'cont' was not declared in this scope
  return cont;
         ^~~~
shoes.cpp:9:9: note: suggested alternative: 'count'
  return cont;
         ^~~~
         count
shoes.cpp:5:6: warning: unused variable 'count' [-Wunused-variable]
  int count = 0;
      ^~~~~