Submission #73242

# Submission time Handle Problem Language Result Execution time Memory
73242 2018-08-28T05:47:36 Z Batmend4 Gondola (IOI14_gondola) C++
35 / 100
28 ms 4532 KB
#include "gondola.h"
#include <iostream>
#include<cstdio>
#include<vector>
#include<bits/stdc++.h>
using namespace std;

int valid(int n, int inputSeq[])
{
  return -1;
}

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

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
    int ind = -1;
    int ct[n + 5];
    vector< pair<int, int> >v;
    for( int i = 0 ; i < n ; i++ ){
        if( gondolaSeq[i] <= n ){
            ind = i;
        }
    }
    int nn = n + gondolaSeq[ind] - 1 - ind;
    for( int i = 0 ; i < n ; i++ ){
        ct[(nn + i) % n] = gondolaSeq[i];
    }
    for( int i = 0 ; i < n ; i++ ){
        v.push_back( make_pair(ct[i], i));
    }
    sort( v.begin(), v.end());
    
    int pos = 0;
    for( int i = 0 ; i < n ; i++ ){
        int ct1 = v[i].first;
        if( ct1 <= n ) continue;
        if( i == 0 ){
            replacementSeq[pos] = v[0].second + 1;
            pos++;
            for( int ii = n + 1 ; ii < v[0].first ; ii++ ){
                replacementSeq[pos] = ii;
                pos++;
            }
            continue;
        }
        if( v[i - 1].first <= n ){
            replacementSeq[pos] = v[i].second + 1;
            pos++;
            for( int ii = n + 1 ; ii < v[i].first ; ii++ ){
                replacementSeq[pos] = ii;
                pos++;
            }
            continue;
        }
        replacementSeq[pos] = v[i].second + 1;
        pos++;
        for( int ii = v[i-1].first + 1 ; ii < v[i].first ; ii++ ){
            replacementSeq[pos] = ii;
            pos++;
        }
        
    }
    return pos;
}

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

int countReplacement(int n, int inputSeq[])
{
  return -3;
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 376 KB Integer -1 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 488 KB Integer -1 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 544 KB Integer -1 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 612 KB Output is correct
2 Correct 3 ms 676 KB Output is correct
3 Correct 3 ms 676 KB Output is correct
4 Correct 2 ms 676 KB Output is correct
5 Correct 3 ms 676 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 700 KB Output is correct
2 Correct 3 ms 700 KB Output is correct
3 Correct 2 ms 700 KB Output is correct
4 Correct 3 ms 760 KB Output is correct
5 Correct 3 ms 760 KB Output is correct
6 Correct 2 ms 760 KB Output is correct
7 Correct 2 ms 760 KB Output is correct
8 Correct 4 ms 760 KB Output is correct
9 Correct 3 ms 760 KB Output is correct
10 Correct 3 ms 780 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 800 KB Output is correct
2 Correct 2 ms 800 KB Output is correct
3 Correct 2 ms 808 KB Output is correct
4 Correct 2 ms 936 KB Output is correct
5 Correct 3 ms 936 KB Output is correct
6 Correct 3 ms 936 KB Output is correct
7 Correct 2 ms 936 KB Output is correct
8 Correct 5 ms 936 KB Output is correct
9 Correct 3 ms 936 KB Output is correct
10 Correct 3 ms 992 KB Output is correct
11 Correct 18 ms 3036 KB Output is correct
12 Correct 18 ms 3616 KB Output is correct
13 Correct 22 ms 3616 KB Output is correct
14 Correct 19 ms 4228 KB Output is correct
15 Correct 28 ms 4532 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 4532 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4532 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 4532 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 4532 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -