QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#857952 | #9675. 电池检测 | World_Creater | 0 | 413ms | 7560kb | C++17 | 448b | 2025-01-16 11:06:34 | 2025-01-16 11:06:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n=1000,f[1005][1005];
int main()
{
for(int i=2;i<=n;i++)
{
for(int j=0;j<=n;j++)
{
if(j==0) f[i][j]=1;
else if(j==1) f[i][j]=(j>2)?2:3;
else
{
f[i][j]=f[i][j-1]+j+1;
for(int k=1;k<=j;k++)
{
f[i][j]=min(f[i][j],f[i-1][j-k]+k*(k+1)/2);
}
}
}
}
int t;
cin>>t;
while(t--)
{
int a,b;
cin>>a>>b;
cout<<f[a][b]<<"\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 409ms
memory: 7380kb
input:
3 2 1 3 1 2 2
output:
3 3 1
result:
wrong answer 2nd numbers differ - expected: '2', found: '3'
Subtask #2:
score: 0
Wrong Answer
Test #3:
score: 0
Wrong Answer
time: 411ms
memory: 7560kb
input:
1000 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 2 26 2 27 2 28 2 29 2 30 2 31 2 32 2 33 2 34 2 35 2 36 2 37 2 38 2 39 2 40 2 41 2 42 2 43 2 44 2 45 2 46 2 47 2 48 2 49 2 50 2 51 2 52 2 53 2 54 2 55 2 56 2 57 2 58 2 59 2 60 2 61...
output:
3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
wrong answer 2nd numbers differ - expected: '6', found: '1'
Subtask #3:
score: 0
Wrong Answer
Test #4:
score: 0
Wrong Answer
time: 411ms
memory: 7512kb
input:
1000 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 21 3 22 3 23 3 24 3 25 3 26 3 27 3 28 3 29 3 30 3 31 3 32 3 33 3 34 3 35 3 36 3 37 3 38 3 39 3 40 3 41 3 42 3 43 3 44 3 45 3 46 3 47 3 48 3 49 3 50 3 51 3 52 3 53 3 54 3 55 3 56 3 57 3 58 3 59 3 60 3 61...
output:
3 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...
result:
wrong answer 1st numbers differ - expected: '2', found: '3'
Subtask #4:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 413ms
memory: 7508kb
input:
1000 907 241 495 435 227 139 616 1 433 35 588 407 533 322 995 961 748 310 212 36 968 500 294 187 375 371 307 14 648 180 122 28 304 253 818 812 41 5 286 62 573 340 547 224 347 35 279 56 151 85 626 410 456 248 578 470 11 6 952 771 404 302 77 27 168 40 524 517 171 147 407 294 268 106 100 27 549 196 973...
output:
243 437 141 3 37 409 324 963 312 38 502 189 373 16 182 30 255 814 7 64 342 226 37 58 87 412 250 472 8 773 304 29 42 519 149 296 108 29 198 375 36 338 237 93 715 833 466 378 71 497 142 53 39 48 633 356 97 330 131 396 234 125 816 409 202 21 57 631 545 63 380 619 416 18 132 266 180 233 317 110 61 267 8...
result:
wrong answer 1st numbers differ - expected: '242', found: '243'
Subtask #5:
score: 0
Skipped
Dependency #1:
0%
Subtask #6:
score: 0
Skipped
Dependency #5:
0%
Subtask #7:
score: 0
Skipped
Dependency #1:
0%