Submission #58593

# Submission time Handle Problem Language Result Execution time Memory
58593 2018-07-18T11:11:41 Z RezwanArefin01 Gondola (IOI14_gondola) C++17
10 / 100
21 ms 2116 KB
#include <bits/stdc++.h> 
#include "gondola.h"
using namespace std; 

int valid(int n, int a[]) {
   vector<int> v; 
   for(int i = 0; i < n; i++) {
       int x = a[i]; 
       if(1 <= x && x <= n) 
           v.push_back(x);
   } 
   int sz = v.size(); 
   for(int i = 0; i < sz; i++) 
       v.push_back(v[i]); 
   int cnt = 0, mx = 0; 
   for(int i = 1; i < v.size(); i++) {
       if(v[i] > v[i - 1]) cnt++; 
       else cnt = 0; 
       mx = max(mx, cnt); 
   }
   return mx + 1 == sz || !sz; 
}

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

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:16:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int i = 1; i < v.size(); i++) {
                   ~~^~~~~~~~~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:34:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 3 ms 356 KB Output is correct
3 Correct 3 ms 432 KB Output is correct
4 Correct 3 ms 516 KB Output is correct
5 Correct 2 ms 516 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 564 KB Output is correct
2 Correct 2 ms 616 KB Output is correct
3 Correct 2 ms 616 KB Output is correct
4 Correct 3 ms 616 KB Output is correct
5 Correct 3 ms 616 KB Output is correct
6 Correct 13 ms 1380 KB Output is correct
7 Correct 21 ms 2012 KB Output is correct
8 Correct 15 ms 2012 KB Output is correct
9 Correct 6 ms 2012 KB Output is correct
10 Correct 14 ms 2012 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2012 KB Output is correct
2 Correct 2 ms 2012 KB Output is correct
3 Correct 2 ms 2012 KB Output is correct
4 Correct 3 ms 2012 KB Output is correct
5 Correct 3 ms 2012 KB Output is correct
6 Correct 13 ms 2012 KB Output is correct
7 Correct 19 ms 2020 KB Output is correct
8 Correct 19 ms 2020 KB Output is correct
9 Correct 9 ms 2020 KB Output is correct
10 Correct 17 ms 2116 KB Output is correct
11 Incorrect 4 ms 2116 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2116 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2116 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2116 KB Integer 0 violates the range [1, 76]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2116 KB Output isn't correct
2 Halted 0 ms 0 KB -