0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 04:51:59 +00:00
OI-codes/AtCoder/ABC244/B/B.cpp

28 lines
488 B
C++

#include <iostream>
#include <string>
using std::cin;
using std::cout;
const char endl = '\n';
const int mod = 4;
const int to[4][2] = {{1, 0}, {0, -1}, {-1, 0}, {0, 1}};
int n, x, y, d;
std::string s;
int main() {
std::ios::sync_with_stdio(false);
cin >> n >> s;
for (char c : s) {
if (c == 'S') {
x += to[d][0];
y += to[d][1];
} else {
d = ++d % mod;
}
}
cout << x << ' ' << y << endl;
return 0;
}