71182023-12-31 09:07:07MagyarKendeSZLGTáblajáték 2 (70 pont)cpp17Wrong answer 26/703ms4260 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)
#define cinv(v) for (auto& e : v) cin >> e;
#define all(v) v.begin(), v.end()
#define has(s, e) s.count(e)

using namespace std;
using ll = long long;
using point = array<int, 2>;

int main() {
    speed;

    int K, row = 0, col = 0;
    cin >> K;
    while (K--) {
        char m;
        cin >> m;

        if (m == '0') {
            row++;
            col *= 10;
        }
        else if (m == '1') {
            row++;
            col *= 10;
            col++;
        }
        else if (m == '2') {
            row++;
            col *= 10;
            col += 2;
        }
        else if (m == '3') {
            row--;
            col /= 10;
        }
        else if (m == '4') {
            if (col % 10) {
                col--;
            } else {
                col -= 8;
            }
        }
        else {
            if (col % 10 == 2) {
                col += 8;
            } else {
                col++;
            }
        }
    }

    cout << row << '\n' << col;
}
SubtaskSumTestVerdictTimeMemory
base26/70
1Accepted0/03ms1892 KiB
2Wrong answer0/03ms2088 KiB
3Accepted2/23ms2316 KiB
4Partially correct1/33ms2532 KiB
5Accepted3/33ms2736 KiB
6Partially correct1/33ms2968 KiB
7Partially correct1/33ms2928 KiB
8Partially correct1/33ms2932 KiB
9Partially correct1/33ms2936 KiB
10Partially correct1/33ms3068 KiB
11Partially correct1/33ms3152 KiB
12Partially correct1/33ms3284 KiB
13Partially correct1/33ms3376 KiB
14Partially correct1/33ms3376 KiB
15Partially correct1/43ms3508 KiB
16Partially correct1/43ms3732 KiB
17Partially correct1/43ms3948 KiB
18Partially correct1/43ms4032 KiB
19Partially correct1/43ms4032 KiB
20Partially correct1/43ms4040 KiB
21Partially correct1/43ms4048 KiB
22Partially correct1/43ms4180 KiB
23Accepted3/33ms4260 KiB