답안 #1015079

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1015079 2024-07-06T04:39:17 Z salmon Mouse (info1cup19_mouse) C++14
9 / 100
82 ms 408 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;

int N;
vector<int> v;

void cycle(int j){
	int num = v[j];
	
	for(int i = j; i < N - 1; i++){
		v[i] = v[i + 1];
	}
	v[N - 1] = num;
}

void solve(int N){
	
	::N = N;
	
	for(int i = 1; i <= N; i++){
		v.push_back(i);
	}
	
	set<int> used;
	
	for(int i = 0; i < N; i++){	
		for(int j = 1; j <= N; j++){
			if(used.find(j) == used.end()){
				v[i] = j;
				
				int cont = i + 1;
				for(int i = 1; i <= N; i++){
					if(i != j && used.find(i) == used.end()){
						v[cont] = i; 
						cont++;
					}
				}
				
				int soom = 0;
				int it = i;
				
				for(int i = 0; i < N - it - 1; i++){
					cycle(it + 1);
					int b = query(v);
					if(b == N) return;
					soom += b;
				}
				
				soom %= (N - it - 1);
				if(soom == 0){
					used.insert(j);
					break;
				}
			}
		}
	}
	
	while(true){
		query(v);
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Correct! Number of queries: 70
2 Correct 0 ms 344 KB Correct! Number of queries: 14
3 Correct 0 ms 344 KB Correct! Number of queries: 38
4 Correct 1 ms 344 KB Correct! Number of queries: 85
5 Correct 1 ms 344 KB Correct! Number of queries: 88
6 Correct 1 ms 344 KB Correct! Number of queries: 34
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Correct! Number of queries: 70
2 Correct 0 ms 344 KB Correct! Number of queries: 14
3 Correct 0 ms 344 KB Correct! Number of queries: 38
4 Correct 1 ms 344 KB Correct! Number of queries: 85
5 Correct 1 ms 344 KB Correct! Number of queries: 88
6 Correct 1 ms 344 KB Correct! Number of queries: 34
7 Runtime error 82 ms 408 KB Execution killed with signal 13
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Correct! Number of queries: 70
2 Correct 0 ms 344 KB Correct! Number of queries: 14
3 Correct 0 ms 344 KB Correct! Number of queries: 38
4 Correct 1 ms 344 KB Correct! Number of queries: 85
5 Correct 1 ms 344 KB Correct! Number of queries: 88
6 Correct 1 ms 344 KB Correct! Number of queries: 34
7 Runtime error 82 ms 408 KB Execution killed with signal 13
8 Halted 0 ms 0 KB -