結果

問題 No.2716 Falcon Method
ユーザー futamegawafutamegawa
提出日時 2024-04-05 23:19:31
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 726 bytes
コンパイル時間 2,984 ms
コンパイル使用メモリ 247,752 KB
実行使用メモリ 13,480 KB
最終ジャッジ日時 2024-04-05 23:19:39
合計ジャッジ時間 7,333 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using llu = long long unsigned;

// メイン関数
int main() {
    int n, q;
    string s;
    cin >> n >> q >> s;

    vector<pair<int, int>> data(n+1);
    for (int i=0; i<n; ++i) {
        if (s[i] == 'D') { data[i+1] = make_pair(data[i].first, data[i].second+1); }
        else { data[i+1] = make_pair(data[i].first+1, data[i].second); }
    }
    for (int i=0; i<q; ++i) {
        int h, w, p;
        cin >> h >> w >> p;
        for (int j=0; j<n; ++j) {
            if (data[j].first == w || data[j].second == h) {
                break;
            }
            p++;
            p %= n;
        }
        cout << p << endl;
    }
    return 0;
}
0