Submission #1016489

#TimeUsernameProblemLanguageResultExecution timeMemory
1016489nisanduuParrots (IOI11_parrots)C++14
0 / 100
1 ms1312 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { int i; string st; string s2,f; int number,num; for(i=0; i<N; i++) num = i; st = to_string(num); s2 = to_string(M[i]); f = st+s2; number = stoi(f); send(number); }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { int i, b,n,digit,j,num; map<int,int> mp; string s,tmp; char d; for(i=0; i<L; i++) { b = X[i]; s = to_string(b); n = s.length(); d = s[n-1]; digit = (d - '0'); tmp = ""; for(j=0;j<n-1;j++){ tmp += s[j]; } num = stoi(tmp); mp[num] = digit; } for(auto z:mp){ output(z.second); } }

Compilation message (stderr)

encoder.cpp: In function 'void encode(int, int*)':
encoder.cpp:13:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   13 |   for(i=0; i<N; i++)
      |   ^~~
encoder.cpp:15:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   15 |     st = to_string(num);
      |     ^~
#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...