Submission #242438

#TimeUsernameProblemLanguageResultExecution timeMemory
242438joseacazGondola (IOI14_gondola)C++17
0 / 100
6 ms384 KiB
#include "gondola.h" #include <bits/stdc++.h> #define pb push_back #define all(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; vi input; int valid(int N, int inputSeq[]) { for(int i = 0; i < N; i++) input.pb(inputSeq[i]); for(int i = 0; i < N; i++) input.pb(inputSeq[i]); int ans; for(int i = 0; i < 2*N; i++) { if(i == 1) { for(int j = 0; j < N; j++) if(input[i + j] == j) ans++; break; } } return (ans == N); } int replacement(int N, int gondolaSeq[], int replacementSeq[]) { return 0; } int countReplacement(int N, int inputSeq[]) { return 0; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:30:24: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
                     ans++;
                     ~~~^~
#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...