답안 #980899

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
980899 2024-05-12T15:29:35 Z SmuggingSpun 곤돌라 (IOI14_gondola) C++14
10 / 100
13 ms 2260 KB
#include "gondola.h"
#include<bits/stdc++.h>
using namespace std;
int valid(int n, int inputSeq[]){
	vector<pair<int, int>>p;
	for(int i = 0; i < n; i++){
		if(inputSeq[i] <= n){
			p.emplace_back(inputSeq[i], i);
		}
	}	
	sort(p.begin(), p.end());
	for(int i = 1; i < p.size(); i++){
		if((p[i].second < p[i - 1].second && (p[i].second += n) < p[i - 1].second) || (p[i].second - p[i - 1].second != p[i].first - p[i - 1].first)){
			return 0;
		}
	}
	return 1;
}
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:12:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(int i = 1; i < p.size(); i++){
      |                 ~~^~~~~~~~~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 440 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 760 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
6 Correct 5 ms 1240 KB Output is correct
7 Correct 12 ms 2260 KB Output is correct
8 Correct 8 ms 2256 KB Output is correct
9 Correct 4 ms 860 KB Output is correct
10 Correct 12 ms 2256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 440 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 5 ms 1236 KB Output is correct
7 Correct 12 ms 2260 KB Output is correct
8 Correct 8 ms 2260 KB Output is correct
9 Correct 3 ms 860 KB Output is correct
10 Correct 13 ms 2260 KB Output is correct
11 Incorrect 1 ms 348 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 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 -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 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 -