제출 #1252904

#제출 시각아이디문제언어결과실행 시간메모리
1252904kkzyr선물 (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
void buy_souvenirs(int N, long long P0){ long long nxt = P0 - 1; int how_many_last = 0; for (int i = 1;i < N;i++){ pair<vector<int>, long long> result; result = transaction(nxt); if (i == N - 1){ for (int j = 1;j < (i - how_many_last);j++){ transaction(nxt); } } else{ for (int j = 1;j < i;j++){ transaction(nxt); } } if (result.first.size() == 1 and result.second == 0 and result.first[0] == i){ nxt--; } else{ if (result.first.size() == 2){ how_many_last++; } nxt -= 2; } } }

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

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:5:14: error: 'vector' was not declared in this scope
    5 |         pair<vector<int>, long long> result;
      |              ^~~~~~
souvenirs.cpp:5:9: error: 'pair' was not declared in this scope
    5 |         pair<vector<int>, long long> result;
      |         ^~~~
souvenirs.cpp:5:21: error: expected primary-expression before 'int'
    5 |         pair<vector<int>, long long> result;
      |                     ^~~
souvenirs.cpp:6:9: error: 'result' was not declared in this scope
    6 |         result = transaction(nxt);
      |         ^~~~~~
souvenirs.cpp:6:18: error: 'transaction' was not declared in this scope
    6 |         result = transaction(nxt);
      |                  ^~~~~~~~~~~