QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#561384 | #9238. Tree | bulijiojiodibuliduo# | 0 | 37ms | 17496kb | C++17 | 1.0kb | 2024-09-12 22:05:52 | 2024-09-12 22:05:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef basic_string<int> BI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head
const int N=201000;
int n,lef;
vector<int> p, w;
VI son[N];
void init(std::vector<int> P, std::vector<int> W) {
p = P;
w = W;
n = (int)p.size();
rep(i,1,n) son[p[i]].pb(i);
lef=0;
rep(i,0,n) if (SZ(son[i])==0) lef++;
}
long long query(int L, int R) {
return max((ll)lef*L-R,0ll);
//return n * (long long)(R - L);
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 31ms
memory: 16764kb
input:
ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0 200000 0 0 2 2 4 5 4 5 8 9 10 9 8 10 14 15 14 15 18 19 20 21 18 22 21 24 24 27 22 27 30 31 31 33 30 19 20 33 38 38 40 41 41 43 44 43 44 47 48 49 50 49 50 53 54 53 48 54 58 58 60 60 62 62 64 64 66 66 67 67 70 71 72 71 72 75 70 75 78 78 80 81 80 81 84 85 86 86 88 89 90...
output:
11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1 OK 528500 642799 80163 483099 447932 960684 1008012 322411 282246 1002876
result:
wrong answer 3rd lines differ - on the 1st token, expected: '682654248246', found: '528500'
Subtask #2:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 2ms
memory: 8888kb
input:
ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0 2000 0 0 1 1 4 4 6 7 6 7 10 10 12 12 14 15 14 15 18 19 19 21 18 21 24 24 26 27 26 27 30 30 32 32 34 34 36 37 38 39 39 41 37 38 36 41 46 47 48 47 48 51 51 53 54 54 56 56 58 58 60 61 61 63 64 64 66 67 66 67 70 71 72 72 74 75 76 76 75 74 70 77 63 60 77 85 85 87 87 89 89...
output:
11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1 OK 164210 592266 760315 37407 967142 576429 155126 30638 121308 251804
result:
wrong answer 3rd lines differ - on the 1st token, expected: '175909322571', found: '164210'
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Wrong Answer
Test #33:
score: 0
Wrong Answer
time: 37ms
memory: 17496kb
input:
ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0 200000 0 1 0 1 2 2 6 6 7 7 10 11 11 13 14 13 14 17 10 17 20 21 22 22 23 21 20 23 28 29 28 29 32 33 34 32 33 34 38 39 39 40 42 42 44 45 46 47 48 45 46 48 52 53 53 54 56 56 58 58 60 61 62 63 63 65 61 66 62 66 70 71 71 72 72 75 60 65 75 79 52 44 70 47 40 54 79 87 87 89 ...
output:
11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1 OK 9164723424 57282868014 2561977686 785890032 695318787 51443359783 6070970082 266062403 24439467289 37401771972 3523686969 29276187182 13405886528 20634647546 16055293364 4057864340 28891982365 53361605529 46661038402 21414564823 14063199187 14061505092 762644510 2...
result:
wrong answer 3rd lines differ - on the 1st token, expected: '18330254280', found: '9164723424'
Subtask #5:
score: 0
Skipped
Dependency #4:
0%
Subtask #6:
score: 0
Wrong Answer
Test #47:
score: 0
Wrong Answer
time: 22ms
memory: 16752kb
input:
ZYKrr4gCMcKeyfk6kbZU5k4ZyW3sAGT0 200000 0 1 0 1 4 5 5 7 7 9 9 11 12 13 13 11 14 12 14 19 20 19 20 23 24 25 26 26 28 28 30 31 32 33 33 35 35 30 32 31 37 41 42 43 24 44 46 46 48 49 50 51 51 53 54 55 55 56 56 48 50 54 44 59 49 25 59 67 68 67 68 71 71 72 72 75 76 76 78 79 80 37 80 83 83 85 86 85 79 41 8...
output:
11XNDQnkdGXK8y3iaqfMvWKu4vqrBbz1 OK 40615 40306 42867 42811 40252 41068 41774 41476 42239 40054 40570 40817 40059 42757 41377 42259 40414 42801 41902 43976 41854 41745 41977 41238 41501 43835 40035 43087 43007 42557 41887 43082 43382 42331 40430 40767 43246 40065 43827 43975 40614 43374 42231 41693 ...
result:
wrong answer 3rd lines differ - on the 1st token, expected: '44399242169', found: '40615'
Subtask #7:
score: 0
Skipped
Dependency #1:
0%