답안 #1019071

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1019071 2024-07-10T12:53:57 Z Nurislam Island Hopping (JOI24_island) C++17
2 / 100
3 ms 344 KB
#include "island.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
vector<int> ord, pos(400), p(400);
void solve(int N, int L){
	for(int i = 1; i < N; i++){
		ord.pb(query(1, i));
	}
	for(int i = 0; i < ord.size(); i++){
		
		pos[ord[i]] = i+1;
	}
	
	for(int i = 0; i < ord.size(); i++){
		if(!p[ord[i]]){
			for(int k = 1; k < N; i++){
				int v = query(ord[i], k);
				if(pos[v] < pos[ord[i]]){
					p[ord[i]]= v;
					break;
				}
				else {
					p[v] = ord[i];
				}
			}
		}
	}
	for(int i = 2; i <= N; i++){
		answer(i, p[i]);
	}
}

Compilation message

island.cpp: In function 'void solve(int, int)':
island.cpp:10:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for(int i = 0; i < ord.size(); i++){
      |                 ~~^~~~~~~~~~~~
island.cpp:15:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |  for(int i = 0; i < ord.size(); i++){
      |                 ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Incorrect 3 ms 344 KB Wrong Answer [4]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 3 ms 344 KB Wrong Answer [4]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Incorrect 3 ms 344 KB Wrong Answer [4]
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Incorrect 2 ms 344 KB Wrong Answer [4]
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 344 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -