답안 #1017599

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1017599 2024-07-09T09:02:54 Z serkanrashid 곤돌라 (IOI14_gondola) C++14
20 / 100
6 ms 1372 KB
#include "gondola.h"
#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e5+5;

int used[maxn];

int valid(int n, int inputSeq[])
{
    int st = -1;
    for(int i = 0; i < n; i++)
    {
        if(used[inputSeq[i]]) return false;
        used[inputSeq[i]]++;
        if(1 <= inputSeq[i] && inputSeq[i] <= n) st = i;
    }
    if(st==-1) return true;

    bool f = true;
    int last = inputSeq[st];
    int i = st+1;
    if(i==n) i = 0;
    while(i!=st)
    {
        last++;
        if(last>n) last = 1;
        if(1 <= inputSeq[i] && inputSeq[i] <= n)
        {
            if(last!=inputSeq[i]) return false;
        }
        i++;
        if(i==n) i = 0;
    }
    return true;
}

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:21:10: warning: unused variable 'f' [-Wunused-variable]
   21 |     bool f = true;
      |          ^
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:42:1: warning: no return statement in function returning non-void [-Wreturn-type]
   42 | }
      | ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:47:1: warning: no return statement in function returning non-void [-Wreturn-type]
   47 | }
      | ^
# 결과 실행 시간 메모리 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 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 2 ms 604 KB Output is correct
7 Correct 5 ms 860 KB Output is correct
8 Correct 6 ms 860 KB Output is correct
9 Correct 2 ms 604 KB Output is correct
10 Correct 5 ms 884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 360 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 3 ms 604 KB Output is correct
7 Correct 5 ms 860 KB Output is correct
8 Correct 5 ms 860 KB Output is correct
9 Correct 2 ms 604 KB Output is correct
10 Correct 5 ms 856 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 3 ms 1372 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 6 ms 1116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -