Submission #58600

# Submission time Handle Problem Language Result Execution time Memory
58600 2018-07-18T11:36:03 Z RezwanArefin01 Gondola (IOI14_gondola) C++17
20 / 100
71 ms 4968 KB
#include <bits/stdc++.h> 
#include "gondola.h"
using namespace std; 

int valid(int n, int a[]) {
    int X, idx = -1;
    for(int i = 0; i < n; i++) {
        if(a[i] >= 1 && a[i] <= n) {
            X = a[i], idx = i; 
        }
    }
    set<int> st(a, a + n); 
    if(st.size() != n) return 0; 
    if(idx == -1) return 1; 
    for(int i = 0; i < n; i++) {
        if(a[i] >= 1 && a[i] <= n) {
            if((X + i - idx + n) % n != a[i] % n) 
                return 0;
        }
    } return 1; 
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[]) {

}

//----------------------

int countReplacement(int n, int inputSeq[]) {
    
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:13:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if(st.size() != n) return 0; 
        ~~~~~~~~~~^~~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 4 ms 376 KB Output is correct
3 Correct 3 ms 540 KB Output is correct
4 Correct 4 ms 540 KB Output is correct
5 Correct 3 ms 540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 540 KB Output is correct
2 Correct 3 ms 540 KB Output is correct
3 Correct 3 ms 540 KB Output is correct
4 Correct 3 ms 540 KB Output is correct
5 Correct 2 ms 540 KB Output is correct
6 Correct 16 ms 2480 KB Output is correct
7 Correct 63 ms 3920 KB Output is correct
8 Correct 32 ms 4176 KB Output is correct
9 Correct 8 ms 4176 KB Output is correct
10 Correct 39 ms 4816 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 4816 KB Output is correct
2 Correct 3 ms 4816 KB Output is correct
3 Correct 2 ms 4816 KB Output is correct
4 Correct 2 ms 4816 KB Output is correct
5 Correct 2 ms 4816 KB Output is correct
6 Correct 14 ms 4816 KB Output is correct
7 Correct 60 ms 4816 KB Output is correct
8 Correct 37 ms 4816 KB Output is correct
9 Correct 9 ms 4816 KB Output is correct
10 Correct 31 ms 4912 KB Output is correct
11 Correct 2 ms 4912 KB Output is correct
12 Correct 3 ms 4912 KB Output is correct
13 Correct 29 ms 4912 KB Output is correct
14 Correct 2 ms 4912 KB Output is correct
15 Correct 71 ms 4968 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 4968 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4968 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4968 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4968 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 4968 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4968 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4968 KB Output isn't correct
2 Halted 0 ms 0 KB -