Skip to content

Commit

Permalink
Add 09517.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jan 29, 2024
1 parent 454c27f commit 3bd403c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions 09xxx/09517.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <iostream>
#include <utility>
#include <vector>
using namespace std;

void solve(void) {
int k; cin >> k;
int n; cin >> n;
vector<pair<int, char>> v(n);
for (int i=0; i<n; i++) cin >> v[i].first >> v[i].second;

int cur = k, time = 0;
for (int i=0; i<n; i++) {
time += v[i].first;
if (time >= 210) break;
if (v[i].second == 'T') cur = (cur % 8) + 1;
}
cout << cur;
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

solve();
return 0;
}

0 comments on commit 3bd403c

Please sign in to comment.