Submission #292869

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2928692020-09-07 14:27:18AaronNaiduGondola (IOI14_gondola)C++14
60 / 100
31 ms2808 KiB
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
typedef long long ll;
const ll mod = 1000000009;
int maxAns;
bool done[300000];
bool used[300000];
map<int, int> mapDone;
int replacedBy[300000];
int valid(int n, int inputSeq[]) {
int minIndex = -1;
int minAns = 1000000000;
int maxIndex = -1;
maxAns = 0;
int outOfRange = 0;
for (int i = 0; i < n; i++)
{
if (done[inputSeq[i]])
{
return 0;
}
done[inputSeq[i]] = true;
if (inputSeq[i] < minAns)
{
minIndex = i;
minAns = inputSeq[i];
}
if (inputSeq[i] > maxAns)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:15:9: warning: variable 'maxIndex' set but not used [-Wunused-but-set-variable]
   15 |     int maxIndex = -1;
      |         ^~~~~~~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:75:9: warning: variable 'maxIndex' set but not used [-Wunused-but-set-variable]
   75 |     int maxIndex = -1;
      |         ^~~~~~~~
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:206:9: warning: variable 'maxIndex' set but not used [-Wunused-but-set-variable]
  206 |     int maxIndex = -1;
      |         ^~~~~~~~
#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...