Submission #170338

# Submission time Handle Problem Language Result Execution time Memory
170338 2019-12-24T20:13:21 Z ngmh Gondola (IOI14_gondola) C++11
20 / 100
45 ms 5112 KB
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;

int valid(int n, int inputSeq[]) {
    long long t = 0;
    set<long long> s;
    for(int i = 0; i < n; i++){
	if(s.find(inputSeq[i]) != s.end()) return 0;
	s.insert(inputSeq[i]);
        if(!t){
	    if(inputSeq[i] > n) continue;
            t = inputSeq[i];
        } else {
            t++;
	    if(t > n) t = 1;
	    if(inputSeq[i] > n) continue;
            if(inputSeq[i] != t) return 0;
        }
    }
    return 1;
}

int replacement(int n, int gondolaSeq[], int replacementSeq[]) {
    return 0;
}

int countReplacement(int n, int inputSeq[]) {
    if(!valid(n, inputSeq)) return 0;
    bool higher = false;
    for(int i = 0; i < n; i++){
	    if(inputSeq[i] > n) higher = true;
    }
    if(!higher) return 1;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 404 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 18 ms 2396 KB Output is correct
7 Correct 14 ms 1144 KB Output is correct
8 Correct 34 ms 4344 KB Output is correct
9 Correct 11 ms 1656 KB Output is correct
10 Correct 45 ms 4984 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 380 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 19 ms 2424 KB Output is correct
7 Correct 13 ms 1144 KB Output is correct
8 Correct 34 ms 4348 KB Output is correct
9 Correct 11 ms 1528 KB Output is correct
10 Correct 45 ms 5112 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 256 KB Output is correct
13 Correct 7 ms 632 KB Output is correct
14 Correct 2 ms 256 KB Output is correct
15 Correct 14 ms 1176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 428 KB Output isn't correct
2 Halted 0 ms 0 KB -