제출 #1123319

#제출 시각아이디문제언어결과실행 시간메모리
1123319Neco_arcAdvertisement 2 (JOI23_ho_t2)C++17
컴파일 에러
0 ms0 KiB
#ifndef DEBUG ios::sync_with_stdio(0), cin.tie(0); #endif cin >> n; REP (i, 0, n) { cin >> xe[i].FI >> xe[i].SE; } sort(xe, xe + n); REP (i, 0, n) { ord.pb({xe[i].SE, i}); } int prv = -1, ptr = 0; REP (i, 0, n) { if (xe[i].FI != prv) { prv = xe[i].FI; ptr++; } inv[ptr] = xe[i].FI; xe[i].FI = ptr; } sort(ALL(ord), greater<ii>()); REP (i, 0, 4 * MAXN) { add[i] = sub[i] = -INF; } for (auto [_, i] : ord) { auto [x, e] = xe[i]; cerr << x << ' ' << e << ' ' << inv[x] << '\n'; cerr << " ? " << e - inv[x] << ' ' << e + inv[x] << '\n'; int sub = qsub(x, n); cerr << ' ' << sub << '\n'; if (sub >= e - inv[x]) { continue; } int add = qadd(1, x); cerr << ' ' << add << '\n'; if (add >= e + inv[x]) { continue; } cerr << " ! " << x << ' ' << e - inv[x] << ' ' << e + inv[x] << '\n'; upd(x, e - inv[x], e + inv[x]); ans++; } cout << ans << '\n'; return 0; }

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

Main.cpp:3:5: error: 'ios' does not name a type
    3 |     ios::sync_with_stdio(0), cin.tie(0);
      |     ^~~
Main.cpp:5:5: error: 'cin' does not name a type
    5 |     cin >> n;
      |     ^~~
Main.cpp:6:9: error: expected constructor, destructor, or type conversion before '(' token
    6 |     REP (i, 0, n) {
      |         ^
Main.cpp:9:9: error: expected constructor, destructor, or type conversion before '(' token
    9 |     sort(xe, xe + n);
      |         ^
Main.cpp:10:9: error: expected constructor, destructor, or type conversion before '(' token
   10 |     REP (i, 0, n) {
      |         ^
Main.cpp:14:9: error: expected constructor, destructor, or type conversion before '(' token
   14 |     REP (i, 0, n) {
      |         ^
Main.cpp:22:9: error: expected constructor, destructor, or type conversion before '(' token
   22 |     sort(ALL(ord), greater<ii>());
      |         ^
Main.cpp:23:9: error: expected constructor, destructor, or type conversion before '(' token
   23 |     REP (i, 0, 4 * MAXN) {
      |         ^
Main.cpp:26:5: error: expected unqualified-id before 'for'
   26 |     for (auto [_, i] : ord) {
      |     ^~~
Main.cpp:44:5: error: 'cout' does not name a type
   44 |     cout << ans << '\n';
      |     ^~~~
Main.cpp:45:5: error: expected unqualified-id before 'return'
   45 |     return 0;
      |     ^~~~~~
Main.cpp:46:1: error: expected declaration before '}' token
   46 | }
      | ^