제출 #820619

#제출 시각아이디문제언어결과실행 시간메모리
820619vjudge1커다란 상품 (IOI17_prize)C++17
컴파일 에러
0 ms0 KiB
#include "prize.h" using namespace std; int find_best(int n) { int l = 0, r = n; while (r - l > 1){ int mid = (l + r)/2; vector<int> res = ask(mid); cout << mid << "\n"; if (res[0] > 0) r = mid; else l = mid; } return l; }

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:9:3: error: 'cout' was not declared in this scope
    9 |   cout << mid << "\n";
      |   ^~~~
prize.cpp:2:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    1 | #include "prize.h"
  +++ |+#include <iostream>
    2 | using namespace std;