Task: | volim |
Sender: | eXeP |
Submission time: | 2016-08-01 15:08:13 +0300 |
Language: | C++ |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.06 s | details |
#2 | ACCEPTED | 0.05 s | details |
#3 | ACCEPTED | 0.06 s | details |
#4 | ACCEPTED | 0.06 s | details |
#5 | ACCEPTED | 0.06 s | details |
#6 | ACCEPTED | 0.06 s | details |
#7 | ACCEPTED | 0.06 s | details |
#8 | ACCEPTED | 0.06 s | details |
#9 | ACCEPTED | 0.06 s | details |
#10 | ACCEPTED | 0.06 s | details |
#11 | ACCEPTED | 0.06 s | details |
#12 | ACCEPTED | 0.05 s | details |
#13 | ACCEPTED | 0.05 s | details |
Code
#include <bits/stdc++.h> #define i64 long long #define u64 unsigned long long #define i32 int #define u32 unsigned int #define pii pair<int, int> #define pll pair<long long, long long> #define ld long double #define defmod 1000000007 #define mati64(a,b) vector<vector<i64>>(a, vector<i64>(b, 0)); using namespace std; int main(){ cin.sync_with_stdio(0); cin.tie(0); int k; cin >> k; k--; int n; cin >> n; int lol = 0; int ans = -1; for(int i = 0; i < n; ++i){ int ti; char c; cin >> ti >> c; lol+=ti; if(lol >= 210 && ans == -1){ ans = k+1; } if(c == 'T') k = (k+1)%8; } cout << ans << endl; return 0; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
1
5 20 T 50 T 80 T ... |
correct output |
---|
5 |
user output |
---|
5 |
Test 2
Verdict: ACCEPTED
input |
---|
3
5 100 T 100 N 100 T ... |
correct output |
---|
4 |
user output |
---|
4 |
Test 3
Verdict: ACCEPTED
input |
---|
5
6 70 T 50 P 30 N ... |
correct output |
---|
7 |
user output |
---|
7 |
Test 4
Verdict: ACCEPTED
input |
---|
2
6 50 T 100 T 50 T ... |
correct output |
---|
5 |
user output |
---|
5 |
Test 5
Verdict: ACCEPTED
input |
---|
7
7 20 T 80 T 60 T ... |
correct output |
---|
3 |
user output |
---|
3 |
Test 6
Verdict: ACCEPTED
input |
---|
4
9 30 N 20 N 70 T ... |
correct output |
---|
6 |
user output |
---|
6 |
Test 7
Verdict: ACCEPTED
input |
---|
6
8 40 T 20 N 50 N ... |
correct output |
---|
2 |
user output |
---|
2 |
Test 8
Verdict: ACCEPTED
input |
---|
4
5 50 N 100 N 10 N ... |
correct output |
---|
4 |
user output |
---|
4 |
Test 9
Verdict: ACCEPTED
input |
---|
1
6 30 T 70 P 20 T ... |
correct output |
---|
4 |
user output |
---|
4 |
Test 10
Verdict: ACCEPTED
input |
---|
5
8 20 P 10 P 30 P ... |
correct output |
---|
8 |
user output |
---|
8 |
Test 11
Verdict: ACCEPTED
input |
---|
2
5 50 T 20 P 30 N ... |
correct output |
---|
4 |
user output |
---|
4 |
Test 12
Verdict: ACCEPTED
input |
---|
5
10 20 P 20 N 20 T ... |
correct output |
---|
1 |
user output |
---|
1 |
Test 13
Verdict: ACCEPTED
input |
---|
8
12 20 T 20 T 10 T ... |
correct output |
---|
2 |
user output |
---|
2 |