답안 #819048

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
819048 2023-08-10T07:46:13 Z kebine 곤돌라 (IOI14_gondola) C++17
20 / 100
18 ms 4492 KB
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
using pii=pair<int,int>;
#define SETIO cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false);
#define fi first
#define se second
#define pb push_back
#define SORT(v) sort(begin(v),end(v))
#define REV(v) reverse(begin(v),end(v))
#define FORI(v) for(auto i:v)
#define REP(i,o,n) for(int i=o;i<n;i++)


int valid(int n, int inputSeq[])
{
  set<int> st;
  int cur=-1;
  REP(i,0,n) {
    st.insert(inputSeq[i]);
    if(inputSeq[i]<=n){
      if(cur!=-1)if(cur!=inputSeq[i])return 0;
      cur=inputSeq[i];
    }
    if(cur!=-1)cur++;
    if(cur==n+1)cur=1;
  }
  if(st.size()!=n)return 0;
  return 1;
}

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

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

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

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

Compilation message

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:28:15: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   28 |   if(st.size()!=n)return 0;
      |      ~~~~~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 9 ms 2212 KB Output is correct
7 Correct 6 ms 616 KB Output is correct
8 Correct 15 ms 3844 KB Output is correct
9 Correct 5 ms 1364 KB Output is correct
10 Correct 18 ms 4492 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 8 ms 2132 KB Output is correct
7 Correct 6 ms 564 KB Output is correct
8 Correct 14 ms 3924 KB Output is correct
9 Correct 5 ms 1364 KB Output is correct
10 Correct 18 ms 4420 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 304 KB Output is correct
13 Correct 3 ms 576 KB Output is correct
14 Correct 1 ms 288 KB Output is correct
15 Correct 6 ms 1108 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -