Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<iostream>
- #include<set>
- #include<map>
- #include<queue>
- #include<vector>
- #include<string.h>
- #include<algorithm>
- #include <iomanip>
- #define sc scanf
- #define pr printf
- #define fr first
- #define se second
- #define pb push_back
- #define mp make_pair
- using namespace std;
- const int MN = 510;
- const int INF = 10000010;
- const double eps = 1e-12;
- int k, n, t, T;
- char c;
- main(){
- freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
- for(sc("%d%d", &k, &n); n--; ){
- sc("%d %c", &t, &c);
- T += t;
- if(T>=210){
- pr("%d\n", k);
- return 0;
- }
- if(c == 'T'){
- k = (k%8)+1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment