제출 #1321052

#제출 시각아이디문제언어결과실행 시간메모리
1321052sadixSouvenirs (IOI25_souvenirs)C++17
컴파일 에러
0 ms0 KiB
void buy_souvenirs(int N, long long P0) { vector<long long> bestM(N, -1); for (long long M = 1; M < P0; M++) { auto res = transaction(M); for (int t : res.first) { if (bestM[t] == -1) bestM[t] = M; } } for (int i = 1; i < N; i++) { for (int cnt = 0; cnt < i; cnt++) { transaction(bestM[i]); } } }

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

souvenirs.cpp: In function 'void buy_souvenirs(int, long long int)':
souvenirs.cpp:2:5: error: 'vector' was not declared in this scope
    2 |     vector<long long> bestM(N, -1);
      |     ^~~~~~
souvenirs.cpp:2:12: error: expected primary-expression before 'long'
    2 |     vector<long long> bestM(N, -1);
      |            ^~~~
souvenirs.cpp:5:20: error: 'transaction' was not declared in this scope
    5 |         auto res = transaction(M);
      |                    ^~~~~~~~~~~
souvenirs.cpp:7:17: error: 'bestM' was not declared in this scope
    7 |             if (bestM[t] == -1)
      |                 ^~~~~
souvenirs.cpp:14:25: error: 'bestM' was not declared in this scope
   14 |             transaction(bestM[i]);
      |                         ^~~~~
souvenirs.cpp:14:13: error: 'transaction' was not declared in this scope
   14 |             transaction(bestM[i]);
      |             ^~~~~~~~~~~