QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#667927#9296. Golden Spirit4eyebird#WA 3ms3712kbC++17724b2024-10-23 09:48:482024-10-23 09:48:50

Judging History

你现在查看的是最新测评结果

  • [2024-10-23 09:48:50]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3712kb
  • [2024-10-23 09:48:48]
  • 提交

answer

#include <iostream>


using namespace std;

#define Buff ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define int long long


void solve()
{
    int n, x, t;
    cin >> n >> x >> t;
    int ans = 0;
    ans += n * t * 2;
    if (ans - 2 * t >= x)
        ans += n * t * 2;
    else
    {
        int ans2 = ans;
        ans += n * t * 2 + (x - (ans - 2 * t));
        ans2 += t;
        if (ans2 >= x)
            ans2 += n * t * 2;
        else
            ans2 += n * t * 2 + (x - ans2);
        ans = min(ans, ans2);
    }
    cout << ans << '\n';
}

signed main()
{
    Buff;
    int _T_ = 1;
    cin >> _T_;
    while (_T_--)
        solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3616kb

input:

3
2 2 2
3 1 10
11 45 14

output:

16
120
616

result:

ok 3 lines

Test #2:

score: 0
Accepted
time: 3ms
memory: 3556kb

input:

10000
3050395 689380 200550
5885929 822329 269033
6682339 28476 346976
9571342 934182 89292
9928491 668975 401621
6524373 173981 202472
5331629 482403 456644
9661686 231207 298636
5454412 961564 632648
5186684 9125 590489
8036028 738212 913802
1211903 553317 790831
6044436 222947 254859
2202128 6558...

output:

2447026869000
6334036546628
9274445027456
3418577079456
15949961935644
5284011400224
9738625572304
11541309041184
13802891371904
12250719393904
29373353833824
3833641845572
6161915658096
2696646672192
889295255040
9043948257972
6143939454024
1326337246416
23705160125976
15247208366860
5472590146452
...

result:

ok 10000 lines

Test #3:

score: 0
Accepted
time: 3ms
memory: 3560kb

input:

10000
594723114 407981328 896391000
649329149 783500515 408569329
237642390 590800940 644908695
992988926 426982043 960904958
921097575 232371931 795650931
710943322 738763456 432346937
845005795 879271899 469762267
158882486 766347309 285249
748274327 755325962 863110734
233975557 855627552 5150046...

output:

2132417787526296000
1061183898828284084
613030574446324200
3816671928929980432
2931488572362369300
1229496670589218856
1587807351549349060
181284280996056
2583374414441304072
48199399000633792
1052133454101117168
1309226869082755812
1724129411130706192
263762517467447900
3058789427644673032
12923964...

result:

ok 10000 lines

Test #4:

score: -100
Wrong Answer
time: 3ms
memory: 3712kb

input:

10000
99016579 761786640 160
71737493 984241598 977
27826041 277148547 990
88973784 901941720 46
46441172 371196151 280
92324360 30679269 825
93045364 702608274 160
68873875 179647153 698
87041665 911660065 344
55223138 469037823 897
71831310 223505225 199
19495836 830028859 673
23181306 539965245 6...

output:

63370610560
280350122644
110191122360
16371176256
52014112640
304670388000
59549032960
192295859000
119769331040
198140619144
57177722760
52482790512
64258580232
300299282316
22788201656
79983599820
112947271032
37014643596
274156860472
103941031356
126017484800
70121503680
327844796928
35906135200
...

result:

wrong answer 39th lines differ - expected: '909686418', found: '909686415'