Submission #955087

# Submission time Handle Problem Language Result Execution time Memory
955087 2024-03-29T11:00:12 Z 4QT0R Gondola (IOI14_gondola) C++17
20 / 100
24 ms 5204 KB
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
#define pii pair<int,int>

int valid(int n, int inputSeq[]){
	set<int> s(inputSeq,inputSeq+n);
	if ((int)s.size()<n)return 0;
	pii mn={n+1,-1};
	for (int i = 0; i<n; i++){
		if (inputSeq[i]<mn.first)mn={inputSeq[i],i};
	}
	int cur=mn.first;
	for (int i = mn.second+1; i<n; i++){
		if (inputSeq[i]<=n && inputSeq[i]!=++cur)return 0;
	}
	for (int i = 0; ++cur<=n; i++){
		if (inputSeq[i]<=n && inputSeq[i]!=cur)return 0;
	}
	return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
	return 1;
}
int countReplacement(int n, int inputSeq[]){
	if (!valid(n,inputSeq))return 0;
	return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 440 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 6 ms 2396 KB Output is correct
7 Correct 20 ms 4188 KB Output is correct
8 Correct 13 ms 4444 KB Output is correct
9 Correct 3 ms 1628 KB Output is correct
10 Correct 13 ms 4956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 6 ms 2396 KB Output is correct
7 Correct 20 ms 4296 KB Output is correct
8 Correct 13 ms 4444 KB Output is correct
9 Correct 4 ms 1624 KB Output is correct
10 Correct 12 ms 4956 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 432 KB Output is correct
13 Correct 10 ms 2396 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 24 ms 5204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -