QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#10730#2039. BubblesQingyuAC ✓3ms3588kbC++20408b2021-06-18 11:49:452023-08-25 01:09:40

Judging History

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

  • [2023-08-25 01:09:40]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3588kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2021-06-18 11:49:45]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main() {
    int P, W, N, index, pcount, wcount;
    pcount = 0;
    wcount = 0;
    char dir;
    cin >> P >> W >> N;
    for (int i=0; i<N; i++) {
        cin >> dir >> index;
        if (dir == 'P') {
            pcount++;
        } else {
            wcount++;
        }
    }
    cout << wcount*W+pcount*P-pcount*wcount << endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3404kb

input:

2 3 2
W 1
P 1

output:

4

result:

ok single line: '4'

Test #2:

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

input:

200000 200000 10000
W 1
W 2
W 3
W 4
W 5
W 6
W 7
W 8
W 9
W 10
W 11
W 12
W 13
W 14
W 15
W 16
W 17
W 18
W 19
W 20
W 21
W 22
W 23
W 24
W 25
W 26
W 27
W 28
W 29
W 30
W 31
W 32
W 33
W 34
W 35
W 36
W 37
W 38
W 39
W 40
W 41
W 42
W 43
W 44
W 45
W 46
W 47
W 48
W 49
W 50
W 51
W 52
W 53
W 54
W 55
W 56
W 57
W 58...

output:

1975000000

result:

ok single line: '1975000000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3400kb

input:

3 4 0

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3392kb

input:

1 6 2
P 5
W 0

output:

6

result:

ok single line: '6'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

72 1 2
P 0
W 37

output:

72

result:

ok single line: '72'

Test #6:

score: 0
Accepted
time: 1ms
memory: 3444kb

input:

5 10 1
W 1

output:

10

result:

ok single line: '10'

Test #7:

score: 0
Accepted
time: 1ms
memory: 3416kb

input:

146094 193838 5236
P 184853
P 110239
W 9264
P 125741
P 180379
W 78675
W 140012
P 151445
W 121963
P 175588
W 144152
P 67351
P 105556
W 20220
W 52590
P 48642
W 136353
W 67141
P 164445
P 115374
P 100079
P 133839
P 90720
W 126205
P 169552
P 159687
W 38028
P 54290
W 41592
W 88768
W 23435
P 193175
W 96470...

output:

881465912

result:

ok single line: '881465912'

Test #8:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

45660 64463 2587
W 34462
P 61352
W 36462
P 53222
P 25626
P 32743
W 11371
W 28497
P 1812
W 32980
P 38640
W 31786
P 16227
P 20899
P 57280
P 63550
W 41367
P 27916
P 55201
P 7919
P 9799
W 6713
P 11846
P 59357
P 10001
W 42769
W 17271
W 5047
W 8405
P 36054
W 1872
P 41323
P 46446
W 39740
P 3045
W 25042
W 1...

output:

141081480

result:

ok single line: '141081480'