Submission #424647

# Submission time Handle Problem Language Result Execution time Memory
424647 2021-06-12T08:34:15 Z Hideo Designated Cities (JOI19_designated_cities) C++17
Compilation error
0 ms 0 KB
            while (!del[v]){
                del[v] = 1;
                upd(1, 1, cnt, lr[v].fr, lr[v].sc, -((h[v] - h[p[v][0]]) - (d[v] - d[p[v][0]])));
                v = p[v][0];
            }
        }
    }
//    cout << cnt << endl;
    for (int i = cnt + 1; i <= n; i++)
        ans[i] = s;
    int q;
    cin >> q;
    for (int i = 1; i <= q; i++){
        int e;
        cin >> e;
        cout << s - ans[e] << endl;
    }
}

Compilation message

designated_cities.cpp:2:13: error: expected unqualified-id before 'while'
    2 |             while (!del[v]){
      |             ^~~~~
designated_cities.cpp:7:9: error: expected declaration before '}' token
    7 |         }
      |         ^
designated_cities.cpp:8:5: error: expected declaration before '}' token
    8 |     }
      |     ^
designated_cities.cpp:10:5: error: expected unqualified-id before 'for'
   10 |     for (int i = cnt + 1; i <= n; i++)
      |     ^~~
designated_cities.cpp:10:27: error: 'i' does not name a type
   10 |     for (int i = cnt + 1; i <= n; i++)
      |                           ^
designated_cities.cpp:10:35: error: 'i' does not name a type
   10 |     for (int i = cnt + 1; i <= n; i++)
      |                                   ^
designated_cities.cpp:13:5: error: 'cin' does not name a type
   13 |     cin >> q;
      |     ^~~
designated_cities.cpp:14:5: error: expected unqualified-id before 'for'
   14 |     for (int i = 1; i <= q; i++){
      |     ^~~
designated_cities.cpp:14:21: error: 'i' does not name a type
   14 |     for (int i = 1; i <= q; i++){
      |                     ^
designated_cities.cpp:14:29: error: 'i' does not name a type
   14 |     for (int i = 1; i <= q; i++){
      |                             ^
designated_cities.cpp:19:1: error: expected declaration before '}' token
   19 | }
      | ^