QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#470362 | #5591. Fading Wind | YGRXZYGR | AC ✓ | 0ms | 3708kb | C++14 | 779b | 2024-07-10 12:09:45 | 2024-07-10 12:09:45 |
Judging History
answer
#include <iostream>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
typedef long long ll;
const int N =1e3 +5;
const int M = 1e9 +7;
const int inf = 0x3fffffff;
void solve(){
int h,k,v,s;
cin>>h>>k>>v>>s;
ll ss=0;
while(h>0){
v+=s;
v-=max(1,(v/10));
if(v>=k){
h++;
}
else if(v>0&&v<k){
h--;
if(h==0){
v=0;
}
}
if(v<=0){
h=0;
v=0;
}
ss+=v;
if(s>0){
s--;
}
}
cout<<ss<<"\n";
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);
//int t;cin>>t;while(t--)
solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
1 1 1 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
2 2 2 2
output:
9
result:
ok single line: '9'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
1 2 3 4
output:
68
result:
ok single line: '68'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
314 159 265 358
output:
581062
result:
ok single line: '581062'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1000 1000 1000 1000
output:
4513860
result:
ok single line: '4513860'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
1000 1 1000 1000
output:
4513860
result:
ok single line: '4513860'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
1000 1000 1 1000
output:
4504869
result:
ok single line: '4504869'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1000 1000 1000 1
output:
9179
result:
ok single line: '9179'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
1 1000 1000 1000
output:
4513860
result:
ok single line: '4513860'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1 1 1000 1000
output:
4513860
result:
ok single line: '4513860'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
1 1000 1 1000
output:
0
result:
ok single line: '0'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1 1000 1000 1
output:
0
result:
ok single line: '0'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1000 1 1 1000
output:
4504869
result:
ok single line: '4504869'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1000 1 1000 1
output:
9179
result:
ok single line: '9179'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
1000 1000 1 1
output:
1
result:
ok single line: '1'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
999 1 999 999
output:
4504850
result:
ok single line: '4504850'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
100 100 100 100
output:
46613
result:
ok single line: '46613'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
1000 1 1 1
output:
1
result:
ok single line: '1'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
1 1000 1 1
output:
0
result:
ok single line: '0'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
1 1 1000 1
output:
9179
result:
ok single line: '9179'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
1 1 1 1000
output:
4504869
result:
ok single line: '4504869'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
535 425 827 311
output:
444405
result:
ok single line: '444405'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
984 375 297 179
output:
147948
result:
ok single line: '147948'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
785 723 722 554
output:
1390470
result:
ok single line: '1390470'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
678 285 113 940
output:
3981799
result:
ok single line: '3981799'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
28 255 394 835
output:
3145213
result:
ok single line: '3145213'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
765 430 259 881
output:
3499391
result:
ok single line: '3499391'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
514 822 326 656
output:
1942752
result:
ok single line: '1942752'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
867 701 968 742
output:
2489959
result:
ok single line: '2489959'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
412 141 565 64
output:
24003
result:
ok single line: '24003'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
144 833 811 897
output:
3632429
result:
ok single line: '3632429'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
202 155 904 723
output:
2364034
result:
ok single line: '2364034'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
546 573 822 979
output:
4325137
result:
ok single line: '4325137'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
703 216 339 553
output:
1382052
result:
ok single line: '1382052'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
127 904 733 655
output:
1940529
result:
ok single line: '1940529'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
71 317 420 84
output:
36151
result:
ok single line: '36151'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
520 963 880 486
output:
1073341
result:
ok single line: '1073341'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
656 615 146 699
output:
2203518
result:
ok single line: '2203518'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
832 419 833 519
output:
1222286
result:
ok single line: '1222286'
Test #40:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
943 345 19 444
output:
889596
result:
ok single line: '889596'
Test #41:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
382 586 53 919
output:
3805521
result:
ok single line: '3805521'
Test #42:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
771 757 364 52
output:
15903
result:
ok single line: '15903'
Test #43:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
983 489 384 594
output:
1594253
result:
ok single line: '1594253'
Test #44:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
793 6 889 416
output:
788940
result:
ok single line: '788940'
Test #45:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
245 120 571 219
output:
222225
result:
ok single line: '222225'
Test #46:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
981 255 540 981
output:
4340284
result:
ok single line: '4340284'
Test #47:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
369 60 274 66
output:
22616
result:
ok single line: '22616'
Test #48:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
806 283 198 766
output:
2646006
result:
ok single line: '2646006'
Test #49:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
619 849 569 546
output:
1349469
result:
ok single line: '1349469'
Test #50:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
567 924 133 257
output:
299855
result:
ok single line: '299855'
Test #51:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
675 315 939 357
output:
583904
result:
ok single line: '583904'
Test #52:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
327 175 341 97
output:
46120
result:
ok single line: '46120'
Test #53:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
931 589 593 802
output:
2903738
result:
ok single line: '2903738'
Test #54:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
280 344 10 52
output:
12727
result:
ok single line: '12727'