結果

問題 No.1183 コイン遊び
ユーザー CELICA
提出日時 2020-08-23 10:15:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 1,685 ms
コンパイル使用メモリ 166,660 KB
実行使用メモリ 10,840 KB
最終ジャッジ日時 2024-10-15 18:03:02
合計ジャッジ時間 5,485 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

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