Submission #582276

#TimeUsernameProblemLanguageResultExecution timeMemory
582276wdjpngGondola (IOI14_gondola)C++17
0 / 100
1 ms212 KiB
#include "gondola.h" #include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i = 0; i < n; i++) #define all(a) a.begin(), a.end() using namespace std; int N =1e5+1; signed valid(signed n, signed inputSeq[]) { int minn = 251000, mini=-1; rep(i,n) if((int)inputSeq[i]<minn) {minn=inputSeq[i]; mini=i;} vector<int>x(n); if(minn<=n) rep(i,n) x[(i+minn-1)%n]=inputSeq[(i+mini)%n]; rep(i,n) if(x[i]!=i+1&&x[i]<=n) cout<<x[i]<<'\n'; return 0; return 1; } //---------------------- signed replacement(signed n, signed gondolaSeq[], signed replacementSeq[]) { return -2; } //---------------------- signed countReplacement(signed n, signed inputSeq[]) { return -3; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:5:18: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    5 | #define rep(i,n) for(int i = 0; i < n; i++)
      |                  ^~~
gondola.cpp:17:3: note: in expansion of macro 'rep'
   17 |   rep(i,n) if(x[i]!=i+1&&x[i]<=n) cout<<x[i]<<'\n'; return 0;
      |   ^~~
gondola.cpp:17:53: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   17 |   rep(i,n) if(x[i]!=i+1&&x[i]<=n) cout<<x[i]<<'\n'; return 0;
      |                                                     ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...