Submission #420982

#TimeUsernameProblemLanguageResultExecution timeMemory
420982marcipan5000Friend (IOI14_friend)C++14
Compilation error
0 ms0 KiB
for (int i=1;i<n;i++) { if (protocol[i]==0) { t[i].push_back(host[i]); t[host[i]].push_back(i); } if (protocol[i]==1) { uu=t[host[i]].size(); for (int j=0;j<uu;j++) { t[i].push_back(t[host[i]][j]); t[t[host[i]][j]].push_back(i); } } if (protocol[i]==2) { uu=t[host[i]].size(); for (int j=0;j<uu;j++) { t[i].push_back(t[host[i]][j]); t[t[host[i]][j]].push_back(i); } t[i].push_back(host[i]); t[host[i]].push_back(i); }

Compilation message (stderr)

friend.cpp:1:1: error: expected unqualified-id before 'for'
    1 | for (int i=1;i<n;i++) {
      | ^~~
friend.cpp:1:14: error: 'i' does not name a type
    1 | for (int i=1;i<n;i++) {
      |              ^
friend.cpp:1:18: error: 'i' does not name a type
    1 | for (int i=1;i<n;i++) {
      |                  ^