Submission #230265

#TimeUsernameProblemLanguageResultExecution timeMemory
230265MasterdanGondola (IOI14_gondola)C++14
15 / 100
17 ms1536 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef vector <int> vi; typedef pair <int, int> ii; typedef vector <ii> vii; #define mp make_pair #define pb push_back #define all(a) a.begin (),a.end () #define MAX 1000000000 #define MIN -1 #define F first #define S second int valid(int n, int inputSeq[]) { int sw=0; int c=0; int v[n+1]; for(int i=0;i<n;i++)v[i]=inputSeq[i]; //v=inputSeq; for(int i=1;i<n;i++){ if(v[i]<=v[i-1])c++; if(c==2)return 0; } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { vi v; int sw=0; for(int i=0;i<n;i++)v.pb(gondolaSeq[i]); sort(all(v)); for(int i=0;i<n;i++){ if(v[i]!=i+1){replacementSeq[0]=i+1; sw=1; break; } } return sw; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:17:7: warning: unused variable 'sw' [-Wunused-variable]
   int sw=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...