답안 #644813

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
644813 2022-09-25T09:44:30 Z PanTkd Speedrun (RMI21_speedrun) C++14
0 / 100
3500 ms 4156 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 Adj[1001][1001]={};
vector<vi> Ad;
void assignHints(int subtask, int N, int A[], int B[]) { 
    setHintLen(N);
    Ad.assign(N+1,vi());
    for(ll i=1;i<N;i++){
        //cout<<A[i]<<"--->"<<B[i]<<endl;
        Adj[A[i]][B[i]]=1;
        Adj[B[i]][A[i]]=1;
        Ad[A[i]].push_back(B[i]);
        Ad[B[i]].push_back(A[i]);

        setHint(A[i],B[i],1);
        setHint(B[i],A[i],1);
    }
    for(ll i=1;i<=N;i++){
        for(ll j=i;j<=N;j++){
            if(!Adj[i][j]){
                setHint(i,j,0);
                setHint(j,i,0);
            }
        }
    }

}
vi V;
ll l;

void dfs(ll s,ll p=-1){
    for(ll i=1;i<=l;i++){
        if(i==p)continue;
        if(getHint(i)){
            goTo(i);
            dfs(i,s);
        }
    }
    goTo(p);
}
void speedrun(int subtask, int N, int start) { /* your solution here */
    l = getLength();
    dfs(start);
}



# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3503 ms 4156 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB The length is too large
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB The length is too large
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB The length is too large
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB The length is too large
2 Halted 0 ms 0 KB -