제출 #1314369

#제출 시각아이디문제언어결과실행 시간메모리
1314369nguthianmangcay경주 (Race) (IOI11_race)C++20
컴파일 에러
0 ms0 KiB
unordered_map<ll,int> best[N];

void DFS(int u, int p){
    best[u][0] = 0;

    for(auto [v,w]: adj[u]){
        if(v == p) continue;
        DFS(v,u);

        if(best[v].size() > best[u].size())
            best[u].swap(best[v]);

        for(auto [len,paths]: best[v]){
            ll need = k - w - len;
            if(need < 0) continue;
            if(best[u].count(need)){
                ans = min(ans, best[u][need] + paths + 1);
            }
        }

        for(auto [len,paths]: best[v]){
            ll nl = len + w;
            if(nl > k) continue;
            if(!best[u].count(nl))
                best[u][nl] = paths + 1;
            else
                best[u][nl] = min(best[u][nl], paths + 1);
        }

        best[v].clear();
    }
}

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

race.cpp:1:15: error: 'll' was not declared in this scope
    1 | unordered_map<ll,int> best[N];
      |               ^~
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:15: error: 'll' was not declared in this scope
race.cpp:1:1: error: 'unordered_map' does not name a type
    1 | unordered_map<ll,int> best[N];
      | ^~~~~~~~~~~~~
race.cpp: In function 'void DFS(int, int)':
race.cpp:4:5: error: 'best' was not declared in this scope
    4 |     best[u][0] = 0;
      |     ^~~~
race.cpp:6:21: error: 'adj' was not declared in this scope
    6 |     for(auto [v,w]: adj[u]){
      |                     ^~~
race.cpp:14:13: error: 'll' was not declared in this scope
   14 |             ll need = k - w - len;
      |             ^~
race.cpp:15:16: error: 'need' was not declared in this scope
   15 |             if(need < 0) continue;
      |                ^~~~
race.cpp:16:30: error: 'need' was not declared in this scope
   16 |             if(best[u].count(need)){
      |                              ^~~~
race.cpp:17:17: error: 'ans' was not declared in this scope
   17 |                 ans = min(ans, best[u][need] + paths + 1);
      |                 ^~~
race.cpp:17:23: error: 'min' was not declared in this scope
   17 |                 ans = min(ans, best[u][need] + paths + 1);
      |                       ^~~
race.cpp:22:13: error: 'll' was not declared in this scope
   22 |             ll nl = len + w;
      |             ^~
race.cpp:23:16: error: 'nl' was not declared in this scope
   23 |             if(nl > k) continue;
      |                ^~
race.cpp:23:21: error: 'k' was not declared in this scope
   23 |             if(nl > k) continue;
      |                     ^
race.cpp:24:31: error: 'nl' was not declared in this scope
   24 |             if(!best[u].count(nl))
      |                               ^~
race.cpp:27:31: error: 'min' was not declared in this scope
   27 |                 best[u][nl] = min(best[u][nl], paths + 1);
      |                               ^~~