# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
734913 | sandry24 | 곤돌라 (IOI14_gondola) | C++17 | 19 ms | 2352 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#include "gondola.h"
int freq[250001];
int valid(int n, int inputSeq[]){
int index_under_n = -1;
for(int i = 0; i < n; i++){
freq[inputSeq[i]]++;
if(freq[inputSeq[i]] > 1)
return 0;
if(inputSeq[i] <= n)
index_under_n = i;
}
if(index_under_n == -1)
return 1;
int index = (index_under_n == n-1 ? 0 : index_under_n + 1);
int next = (inputSeq[index_under_n] == n ? 1 : inputSeq[index_under_n] + 1);
while(index != index_under_n){
if(inputSeq[index] < n){
if(inputSeq[index] != next){
return 0;
}
}
index = (index == n-1 ? 0 : index + 1);
next = (next == n ? 1 : next + 1);
}
return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
int index = -1, cnt = 0, next;
for(int i = 0; i < n; i++)
if(gondolaSeq[i] <= n)
index = i;
if(index == -1){
index = 0;
next = 1;
} else next = gondolaSeq[index];
vector<pi> temp;
int current = n+1;
while(cnt != n){
if(gondolaSeq[index] != next)
temp.pb({gondolaSeq[index], next});
index = (index == n-1 ? 0 : index + 1);
next = (next == n ? 1 : next + 1);
cnt++;
}
sort(temp.begin(), temp.end());
int ind = 0;
for(int i = 0; i < temp.size(); i++){
while(temp[i].f != temp[i].s){
replacementSeq[ind] = temp[i].s;
temp[i].s = current;
current++;
ind++;
}
}
return ind;
}
int countReplacement(int n, int inputSeq[]){
return 1;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |