QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#95633#5232. Liczenie punktów [C]kasper10 ✓2ms3516kbC++20708b2023-04-11 00:24:052023-04-11 00:24:07

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-11 00:24:07]
  • 评测
  • 测评结果:10
  • 用时:2ms
  • 内存:3516kb
  • [2023-04-11 00:24:05]
  • 提交

answer

#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <ranges>
#include <set>
#include <string>
#include <vector>

using namespace std;

int solve() {
    int n;
    string s;
    cin >> n >> s;
    int res = 0;

    int d = n / 10;
    for (int i = 0; i < 10; i++) {
        bool ok = true;
        for (int j = 0; j < d; j++) {
            ok &= s[i * d + j] == 'T';
        }
        res += ok;
    }
    return res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.exceptions(cin.failbit);
    cin.tie(0);
    cout << solve() << "\n";
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 2ms
memory: 3424kb

input:

10
TNTNNNNNNN

output:

2

result:

ok single line: '2'

Test #2:

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

input:

10
NTTNNNNNTN

output:

3

result:

ok single line: '3'

Test #3:

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

input:

10
NNNTNTTNNT

output:

4

result:

ok single line: '4'

Test #4:

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

input:

10
TNNNNTNNNN

output:

2

result:

ok single line: '2'

Test #5:

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

input:

10
NNNTNNNTTT

output:

4

result:

ok single line: '4'

Test #6:

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

input:

10
NTNTNTNTNT

output:

5

result:

ok single line: '5'

Subtask #2:

score: 1
Accepted

Test #7:

score: 1
Accepted
time: 2ms
memory: 3424kb

input:

20
TNNNNTTTTNTNNTNTNNTN

output:

1

result:

ok single line: '1'

Test #8:

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

input:

20
TTTTTNNTTNTNNNTTTTTT

output:

5

result:

ok single line: '5'

Test #9:

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

input:

20
TNNTTTNTTTNTNTNNTTNT

output:

3

result:

ok single line: '3'

Test #10:

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

input:

20
TNTTTNTNTNTTTTNTTTNT

output:

4

result:

ok single line: '4'

Test #11:

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

input:

20
TNTTTTTTTNTTTTNTTNTT

output:

6

result:

ok single line: '6'

Test #12:

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

input:

20
NTTNTTNTTNTTNTTNTTNT

output:

3

result:

ok single line: '3'

Subtask #3:

score: 1
Accepted

Test #13:

score: 1
Accepted
time: 2ms
memory: 3512kb

input:

100
NNTNNNTTNNTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTTTTTTTTTNTTTTTTNTNNTTTNNTTTTTTTTTTTNTTTTTTTTTTTTNTTTTTT

output:

4

result:

ok single line: '4'

Test #14:

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

input:

50
TNTTTTTTTTTTTNTNTNTTNTTNNTTTTTTTTTTTTTNNTNTTNTTTTT

output:

4

result:

ok single line: '4'

Test #15:

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

input:

40
TTNTNTTTTTTNTTNTTTTTTTTNTTTTTTTTTTTTTTTT

output:

5

result:

ok single line: '5'

Test #16:

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

input:

60
TTTTTTTTTTNTNTTNNNTTNNNNTTTTNTNNNNNTNTNTTNTTTTTTTTTTTTTTTTNT

output:

3

result:

ok single line: '3'

Test #17:

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

input:

40
TTTTNNTNTTTNTTNTTTTTTTNTTTTTNTNTTTTTNNTN

output:

4

result:

ok single line: '4'

Test #18:

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

input:

30
NTTTNTTTNTTTNTTTNTTTNTTTNTTTNT

output:

2

result:

ok single line: '2'

Subtask #4:

score: 1
Accepted

Test #19:

score: 1
Accepted
time: 2ms
memory: 3412kb

input:

10
NTNNTNNNTN

output:

3

result:

ok single line: '3'

Test #20:

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

input:

100
TNTTNNTNNTTTTTTNTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTTTTTNTTTNNTNNNTTTTTTNTTT

output:

5

result:

ok single line: '5'

Test #21:

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

input:

40
TTNTTTTTTTTTTTTTNTTTNTTTTNTTTTNNTTTTTTNT

output:

4

result:

ok single line: '4'

Test #22:

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

input:

80
TNNNTTTNTTNNNNNTNTNNTTTTNNTTTNTTTTNTTTTTTTNTTTTTTNTTTTNNTTTTTTTTTTTTTTTTTNTNNTNT

output:

2

result:

ok single line: '2'

Test #23:

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

input:

80
NTNTTNNNTTTTTTTTNTTNTTNTTTTTTTTTTTTTTTTTTTTNNNTNTTTTTTTTNNNNTTTNTTNTTTTTNNNTTNNN

output:

4

result:

ok single line: '4'

Test #24:

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

input:

40
NTTTTNTTTTNTTTTNTTTTNTTTTNTTTTNTTTTNTTTT

output:

2

result:

ok single line: '2'

Subtask #5:

score: 1
Accepted

Test #25:

score: 1
Accepted
time: 2ms
memory: 3456kb

input:

90
NTTTTNTNNTTTTNTTTTTTTTTTTTTTTTTTTTTNTTTTTTTTTTTTNNTTTNTTTTTTTTTTTNTTTTTTTTTTTTTTTTTTNTTTTT

output:

4

result:

ok single line: '4'

Test #26:

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

input:

40
TTTTTTTTTTTNTTTTNTNNNNTTTTTNTTTNTTTTTTNT

output:

4

result:

ok single line: '4'

Test #27:

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

input:

10
NTTNNNNTTN

output:

4

result:

ok single line: '4'

Test #28:

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

input:

40
TTTTTNTTTTTTTTTNTTTTTNTTTTNTTTTTTTTNTTTT

output:

5

result:

ok single line: '5'

Test #29:

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

input:

80
TTNNNNTTTTNTNNNTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTNTNNNTNTNTTTTTNTTTTTNTTTTTTTTTTTTTT

output:

4

result:

ok single line: '4'

Test #30:

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

input:

90
TTTTTTTTTNTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTTTTTTNTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTTTTTTNTTTTTTTT

output:

5

result:

ok single line: '5'

Test #31:

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

input:

50
NTTTTTNTTTTTNTTTTTNTTTTTNTTTTTNTTTTTNTTTTTNTTTTTNT

output:

1

result:

ok single line: '1'

Subtask #6:

score: 1
Accepted

Test #32:

score: 1
Accepted
time: 2ms
memory: 3432kb

input:

70
NTNNTNTTTTTTTTTTTTTTTNTNNNNNNTNNNTTTTTTTTTTTTTTTTTTTNTTTTTTTTTNTTTTTTT

output:

5

result:

ok single line: '5'

Test #33:

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

input:

50
TNTTNTNNNNTTNTTTTTTTNTTTTNNTNNTTTTTTTTTTNTTNTNNNTT

output:

3

result:

ok single line: '3'

Test #34:

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

input:

90
TTTTTNTNTTTTTTTTTTTTTTTTTTTTTTTTTTTNNNNNTTTTTTTTTTTTTTTTTNTTTNTTTTTTTTTTNTTTTTTTTTTTNTTTTT

output:

4

result:

ok single line: '4'

Test #35:

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

input:

10
NNNNNNTTNT

output:

3

result:

ok single line: '3'

Test #36:

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

input:

50
TTTTTTTTTTTTTTNTTTTTTNTTTNNNNNTNTNNTTTTTTTTTTTTTTT

output:

6

result:

ok single line: '6'

Test #37:

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

input:

100
TTTTTTTTTTNTTTTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTT

output:

5

result:

ok single line: '5'

Test #38:

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

input:

60
NTTTTTTNTTTTTTNTTTTTTNTTTTTTNTTTTTTNTTTTTTNTTTTTTNTTTTTTNTTT

output:

1

result:

ok single line: '1'

Subtask #7:

score: 1
Accepted

Test #39:

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

input:

30
TNTNNTTTTTTTTNTTTNTTTTNTTTNTNT

output:

3

result:

ok single line: '3'

Test #40:

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

input:

40
TTTTTTTTNTTNTTTTTTNTTTTTNNTNTTTNTTTTTTTN

output:

5

result:

ok single line: '5'

Test #41:

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

input:

60
NNTNTNTNNTNTNTNNTTNTNTTNTTTTTNTNTTTTTTTTTTTTNTTTTTTTTTTTTTTT

output:

3

result:

ok single line: '3'

Test #42:

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

input:

50
TTTTTNNNTTTTTTNNNTTTTTNTTTTTNTTTTTTTTTNTTTTTTTTTNT

output:

3

result:

ok single line: '3'

Test #43:

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

input:

70
TTTTTTNTTTTNTTNTTTTTTTTTTTTNTTTTTTTTNNTTTNTTNTTTTNTTTNNNTTNTTTNTTTTTTT

output:

2

result:

ok single line: '2'

Test #44:

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

input:

90
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

output:

10

result:

ok single line: '10'

Test #45:

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

input:

70
NTTTTTTTNTTTTTTTNTTTTTTTNTTTTTTTNTTTTTTTNTTTTTTTNTTTTTTTNTTTTTTTNTTTTT

output:

1

result:

ok single line: '1'

Subtask #8:

score: 1
Accepted

Test #46:

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

input:

40
NNNTTNNTTTTTTTTTNTTNTNNNNNNTNTNTTTTTTTTT

output:

4

result:

ok single line: '4'

Test #47:

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

input:

80
TTTTTTTTNNTTNNTTNTNTTNNNNNNTNTNNTTTTNTTTTTTTTTTTNTNNTTTNTTTTTTTTNNNNTNNNTTTTTTNT

output:

3

result:

ok single line: '3'

Test #48:

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

input:

20
TTTTNNTTNTTNTNTTTTNT

output:

5

result:

ok single line: '5'

Test #49:

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

input:

90
TTTTTTTTTTTNTTTTTTTTTTTTTTTTTTTTTTTNNNTNNTTTTTTNNNTTNNTTTTTTTTTTTTTTTTTTTTTTNTTTTNTTTTTTTT

output:

4

result:

ok single line: '4'

Test #50:

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

input:

10
TNTNNTNNNT

output:

4

result:

ok single line: '4'

Test #51:

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

input:

100
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

output:

10

result:

ok single line: '10'

Test #52:

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

input:

80
NTTTTTTTTNTTTTTTTTNTTTTTTTTNTTTTTTTTNTTTTTTTTNTTTTTTTTNTTTTTTTTNTTTTTTTTNTTTTTTT

output:

1

result:

ok single line: '1'

Subtask #9:

score: 1
Accepted

Test #53:

score: 1
Accepted
time: 1ms
memory: 3480kb

input:

80
TNNNNNNNTTTTNTTTTNTNTTNTTTTTTTTTTNTTNNTTTNNNNTNNTNNNTTTTTTTTTTTNTTTTTTTTTTTTTTTT

output:

3

result:

ok single line: '3'

Test #54:

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

input:

40
TTNTNNTTTTTTTNTTNTNTTTTTNTTTNTTNTTTTNNTT

output:

3

result:

ok single line: '3'

Test #55:

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

input:

50
TTTTNTTTTTNNTNNNTTTTTTNTTTTTNTTNTTNNTTTNTNTTTTTTTT

output:

2

result:

ok single line: '2'

Test #56:

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

input:

50
NTTTTTTTTTTNNNNNTTTTNNTTNNTTTTTTTTTTTTTTTTTTTTTTTT

output:

5

result:

ok single line: '5'

Test #57:

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

input:

60
TTTTTTNNTTNNNTTTTNNNNTNNNNTNNNTTNNNNNNTNNTTTTTTTTTTTTTTNTTTT

output:

3

result:

ok single line: '3'

Test #58:

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

input:

90
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

output:

0

result:

ok single line: '0'

Test #59:

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

input:

90
NTTTTTTTTTNTTTTTTTTTNTTTTTTTTTNTTTTTTTTTNTTTTTTTTTNTTTTTTTTTNTTTTTTTTTNTTTTTTTTTNTTTTTTTTT

output:

1

result:

ok single line: '1'

Subtask #10:

score: 1
Accepted

Test #60:

score: 1
Accepted
time: 2ms
memory: 3412kb

input:

100
NTTTNNTTTTNNNTNNNNNTTTTTTTTTTTNTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTNTTTTTTNTTTTNTTTTTNNN

output:

4

result:

ok single line: '4'

Test #61:

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

input:

90
TTNNNNNNNTTTTTTTTTNTTTTTTTTTNTTNNNNTTNTTNNTNNTTTTTTTTNTTTNTTTTTNNNNNNNNTTTTTTTTTTTTNTTTTNT

output:

2

result:

ok single line: '2'

Test #62:

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

input:

90
TTTTNTTTNTTTTTTTTTTNTTTTTTTTTNTTTTTTTTTTNNTNNTTNNNNTNNTNTTNNNTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

output:

4

result:

ok single line: '4'

Test #63:

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

input:

60
TTTTTTTTTTTTTNTTTTTTTTTNTTTTTTTTTTTTTTTTNTTTTNTTTNTTTTTTTTTT

output:

5

result:

ok single line: '5'

Test #64:

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

input:

70
TTNTNNTTTNTTNTTTTTTTTTTTTTTTTTNNNNTTTTTTTTTTTTTTTNTTTTTTTTTTTTTTTTTTTN

output:

5

result:

ok single line: '5'

Test #65:

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

input:

100
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN

output:

0

result:

ok single line: '0'

Test #66:

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

input:

100
NTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTNTTTTTTTTTTN

output:

0

result:

ok single line: '0'

Extra Test:

score: 0
Extra Test Passed