#include "Anyalib.h"
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <cassert>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P2;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(x) x.begin(), x.end()
#define uniq(x) x.erase(unique(all(x)), x.end())
#define index(x, y) (int)(lower_bound(all(x), y) - x.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
const int D = 12;
//static int getL;
int N;
vector<int> G[500];
int dp[500][20];
int dfs(int x, int p, int d) {
if (dp[x][d] != -1) return dp[x][d];
int s = (d==0);
for (int t : G[x]) if (t != p) {
s += min(dfs(t, x, 0), d<D?dfs(t, x, d+1):INF);
}
cout<<"dp["<<x<<"]["<<d<<"]="<<s<<"\n";
return dp[x][d] = s;
}
void InitAnya(int NN, int A[] , int B[]) {
N = NN;
rep(i, N-1) {
G[A[i]].pb(B[i]);
G[B[i]].pb(A[i]);
}
rep(i, N) rep(j, D+1) dp[i][j] = -1;
int num = dfs(0, -1, 0);
cout<<"num="<<num<<"\n";
assert(num <= 55);
}
void Anya(int C[]) {
rep(i, 1000) Save(i, 0);
}
#include "Borislib.h"
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <cassert>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> P2;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(x) x.begin(), x.end()
#define uniq(x) x.erase(unique(all(x)), x.end())
#define index(x, y) (int)(lower_bound(all(x), y) - x.begin())
#define _1 first
#define _2 second
#define INF 1145141919
void InitBoris(int N , int A[] , int B[]) {
}
int Boris(int city) {
int i = Ask(0);
int j = Ask(1);
return 2;
}
Compilation message
Boris.cpp: In function 'int Boris(int)':
Boris.cpp:25:7: warning: unused variable 'i' [-Wunused-variable]
int i = Ask(0);
^
Boris.cpp:26:7: warning: unused variable 'j' [-Wunused-variable]
int j = Ask(1);
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
4188 KB |
Do not print anything on standard output. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
4188 KB |
Do not print anything on standard output. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
4188 KB |
Do not print anything on standard output. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
4188 KB |
Do not print anything on standard output. |
2 |
Halted |
0 ms |
0 KB |
- |