結果

問題 No.1183 コイン遊び
ユーザー CELICACELICA
提出日時 2020-08-23 10:15:41
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 1,313 ms
コンパイル使用メモリ 164,688 KB
実行使用メモリ 12,256 KB
最終ジャッジ日時 2023-08-05 21:01:56
合計ジャッジ時間 5,501 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 7 ms
7,200 KB
testcase_13 AC 6 ms
6,692 KB
testcase_14 AC 8 ms
8,528 KB
testcase_15 AC 9 ms
8,096 KB
testcase_16 AC 11 ms
12,164 KB
testcase_17 AC 10 ms
11,184 KB
testcase_18 AC 10 ms
11,972 KB
testcase_19 AC 10 ms
11,200 KB
testcase_20 AC 10 ms
10,684 KB
testcase_21 AC 10 ms
11,268 KB
testcase_22 AC 10 ms
12,256 KB
testcase_23 AC 10 ms
10,704 KB
testcase_24 AC 9 ms
11,112 KB
testcase_25 AC 10 ms
11,168 KB
testcase_26 AC 9 ms
11,648 KB
testcase_27 AC 11 ms
10,640 KB
testcase_28 AC 10 ms
10,832 KB
testcase_29 AC 10 ms
11,120 KB
testcase_30 AC 10 ms
12,244 KB
testcase_31 AC 11 ms
12,236 KB
testcase_32 AC 10 ms
10,884 KB
testcase_33 AC 10 ms
12,092 KB
testcase_34 AC 10 ms
8,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ul = unsigned long;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    string sa, sb;
    cin.ignore();
    getline(cin, sa);
    getline(cin, sb);

    int res{sa[0] != sb[0]};
    for (int i = 0; i < n * 2 - 3; i += 2)
        res += (sa[i] != sa[i + 2]) != (sb[i] != sb[i + 2]);
    
    cout << ++res / 2 << "\n";

    return 0;
}
0