Submission #2852987
Source Code Expand
#include <iostream> #include <algorithm> #include <cmath> #include <map> #include <vector> #include <queue> #include <functional> #include <string> #include <stack> #include <set> #include <sstream> #include <iomanip> #include <limits> #include <cstring> using namespace std; using ll = long long; typedef unsigned long long ull; typedef pair<ll, ll> P; typedef pair<string, string> sP; typedef pair<ll, pair<ll, ll>> PP; const ll MOD = 1e9 + 7; const ll MOD2 = 998244353; const ll INF = 1 << 30; const ll INF2 = 9e18; const double INF3 = 9e14; const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 }; const int px[6] = { 0,1,-1,1,0,1 }, py[6] = { -1,-1,0,0,1,1 }; const int tx[8] = { -1,0,1,-1,1,-1,0,1 }, ty[8] = { -1,-1,-1,0,0,1,1,1 }; #define ALL(x) (x).begin(),(x).end() #define ALLR(x) (x).rbegin(),(x).rend() #define pb push_back #define eb emplace_back #define fr first #define sc second bool dpx[30000][8010], dpy[30000][8010]; int main() { string s; int x, y, now = 16000, fl = 2, fx = 0, fy = 0; cin >> s >> x >> y; x += 16000, y += 16000; int i = 0, b = 0; for (;i < s.size();i++) { if (s[i] == 'T')break; b++; } i++; dpx[16000 + b][fx] = 1, dpy[16000][0] = 1,fl = 1; while (i < (int)s.size()) { int cnt = 0; for (;i < s.size();i++) { if (s[i] == 'T')break; else cnt++; } if (fl) { fl = 0; fy++; for (int j = 8000;j <= 24000;j++) { if (dpy[j - cnt][fy - 1])dpy[j][fy] = 1; else if (dpy[j + cnt][fy - 1])dpy[j][fy] = 1; else dpy[j][fy] = 0; } } else { fl = 1; fx++; for (int j = 8000;j <= 24000;j++) { if (dpx[j - cnt][fx - 1])dpx[j][fx] = 1; else if (dpx[j + cnt][fx - 1])dpx[j][fx] = 1; else dpx[j][fx] = 0; } } i++; } if (dpx[x][fx] && dpy[y][fy])cout << "Yes" << endl; else cout << "No" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - FT Robot |
User | kakakakaneko |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1915 Byte |
Status | RE |
Exec Time | 423 ms |
Memory | 254336 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 0_05.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 0_05.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt, 1_26.txt, 1_27.txt, 1_28.txt, 1_29.txt, 1_30.txt, 1_31.txt, 1_32.txt, 1_33.txt, 1_34.txt, 1_35.txt, 1_36.txt, 1_37.txt, 1_38.txt, 1_39.txt, 1_40.txt, 1_41.txt, 1_42.txt, 1_43.txt, 1_44.txt, 1_45.txt, 1_46.txt, 1_47.txt, 1_48.txt, 1_49.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 50 ms | 254208 KB |
0_01.txt | AC | 50 ms | 254208 KB |
0_02.txt | AC | 2 ms | 4352 KB |
0_03.txt | AC | 26 ms | 129280 KB |
0_04.txt | AC | 50 ms | 254208 KB |
0_05.txt | AC | 51 ms | 254208 KB |
1_00.txt | AC | 2 ms | 4352 KB |
1_01.txt | AC | 2 ms | 4352 KB |
1_02.txt | AC | 26 ms | 129280 KB |
1_03.txt | AC | 26 ms | 129280 KB |
1_04.txt | RE | 143 ms | 237824 KB |
1_05.txt | RE | 144 ms | 237824 KB |
1_06.txt | AC | 237 ms | 254208 KB |
1_07.txt | AC | 236 ms | 254208 KB |
1_08.txt | AC | 299 ms | 254336 KB |
1_09.txt | AC | 300 ms | 254208 KB |
1_10.txt | AC | 300 ms | 254208 KB |
1_11.txt | AC | 299 ms | 254208 KB |
1_12.txt | AC | 174 ms | 254208 KB |
1_13.txt | AC | 174 ms | 254208 KB |
1_14.txt | AC | 237 ms | 254208 KB |
1_15.txt | AC | 237 ms | 254208 KB |
1_16.txt | AC | 236 ms | 254208 KB |
1_17.txt | AC | 237 ms | 254208 KB |
1_18.txt | AC | 233 ms | 254208 KB |
1_19.txt | AC | 232 ms | 254208 KB |
1_20.txt | AC | 233 ms | 254208 KB |
1_21.txt | AC | 235 ms | 254208 KB |
1_22.txt | AC | 236 ms | 254208 KB |
1_23.txt | AC | 233 ms | 254208 KB |
1_24.txt | AC | 237 ms | 254208 KB |
1_25.txt | AC | 232 ms | 254208 KB |
1_26.txt | AC | 414 ms | 254208 KB |
1_27.txt | AC | 423 ms | 254208 KB |
1_28.txt | AC | 233 ms | 254208 KB |
1_29.txt | AC | 235 ms | 254208 KB |
1_30.txt | AC | 144 ms | 254208 KB |
1_31.txt | AC | 139 ms | 254208 KB |
1_32.txt | AC | 99 ms | 254208 KB |
1_33.txt | AC | 98 ms | 254208 KB |
1_34.txt | AC | 75 ms | 254208 KB |
1_35.txt | AC | 74 ms | 254208 KB |
1_36.txt | AC | 64 ms | 254208 KB |
1_37.txt | AC | 66 ms | 254208 KB |
1_38.txt | AC | 59 ms | 254208 KB |
1_39.txt | AC | 59 ms | 254208 KB |
1_40.txt | AC | 55 ms | 254208 KB |
1_41.txt | AC | 56 ms | 254208 KB |
1_42.txt | AC | 178 ms | 254208 KB |
1_43.txt | AC | 178 ms | 254208 KB |
1_44.txt | AC | 179 ms | 254208 KB |
1_45.txt | AC | 184 ms | 254208 KB |
1_46.txt | AC | 176 ms | 254208 KB |
1_47.txt | AC | 182 ms | 254208 KB |
1_48.txt | AC | 182 ms | 254208 KB |
1_49.txt | AC | 187 ms | 254208 KB |