# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1260508 | cpdreamer | 이주 (IOI25_migrations) | C++20 | 27 ms | 460 KiB |
#include "migrations.h"
#include <cassert>
#include <cstdio>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define V vector
#define pb push_back
#define all(v) v.begin(),v.end()
const long long MOD=1e9+7;
#define F first
void file() {
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
int maxd=0;
int nd=0;
int dep[(int)1e4];
int send_message(int N, int i, int P){
dep[0]=0;
dep[i]=dep[P]+1;
maxd=max(maxd,dep[i]);
if (dep[i]==maxd) {
nd=i;
}
if (i>=N-14) {
if (nd==i) {
return 2;
}
if (((1<<(N-i-1))&nd)!=0) {
return 1;
}
return 0;
}
return 0;
}
std::pair<int, int> longest_path(std::vector<int> S) {
int n=(int)S.size();
for (int i=n-1;i>=n-14;i--) {
if (S[i]==2) {
return {0,i};
}
}
int x=0;
for (int i=n-1;i>=n-14;i--) {
x+=(1<<(n-i-1))*S[i];
}
return {0,x};
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |