답안 #644828

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
644828 2022-09-25T10:14:06 Z PanTkd Speedrun (RMI21_speedrun) C++14
8 / 100
62 ms 696 KB
#include "speedrun.h"
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <limits>
#include <list>
#include <cstring>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <unordered_map>

using namespace std;

typedef int ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
#ifdef px
    #define p(x) cerr<<#x<<' '<<x<<endl;
#else
    #define p(x) {}
#endif
#define F first
#define S second
#define sz size
#define ls s,m,idx<<1
#define rs m+1,e,idx<<1|1
const ll MOD=ll(1e9)+7;
const ll MAXN=2*ll(1e6);
ll freq[2001]={};
ll arxi=1;

void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */
	setHintLen(20);
	int pai = 0;
	for(int i = 1; i < N; i++){
		freq[A[i]]++;
		freq[B[i]]++;
		if(A[i] > 1){
			pai = A[i];
			break;
		}
		if(B[i] > 1){
			pai = B[i];
			break;
		}
	}
	for(int i = 1; i <= N; i++){
		if(i == pai) continue;
		for(int j = 0; j < 10; j++){
			if((1<<j) & pai) setHint(i, j+1, 1);
		}
	}
}
int l;
 
void speedrun(int subtask, int N, int start) { /* your solution here */
	l = getLength();
	int pai = 0;
	for(int i = 1; i <= 10; i++){
		if(getHint(i)){
			pai |= (1<<(i-1));
		}
	}
	if(pai == 0){
		for(int i = 1; i <= N; i++){
			if(i == start) continue;
			goTo(i);
			goTo(start);
		}
	}else{
		goTo(pai);
		for(int i = 1; i <= N; i++){
			if(i == pai) continue;
			goTo(i);
			goTo(pai);
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 62 ms 672 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 676 KB Output is correct
2 Correct 38 ms 676 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 51 ms 672 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 55 ms 696 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 37 ms 672 KB Solution didn't visit every node
2 Halted 0 ms 0 KB -