結果

問題 No.1183 コイン遊び
ユーザー kpinkcatkpinkcat
提出日時 2023-08-27 23:06:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 1,007 ms
コンパイル使用メモリ 103,844 KB
実行使用メモリ 19,004 KB
最終ジャッジ日時 2023-08-27 23:06:28
合計ジャッジ時間 12,284 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 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 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 8 ms
4,376 KB
testcase_11 AC 19 ms
4,376 KB
testcase_12 AC 185 ms
12,712 KB
testcase_13 AC 164 ms
11,720 KB
testcase_14 AC 298 ms
17,692 KB
testcase_15 AC 292 ms
18,604 KB
testcase_16 AC 295 ms
18,568 KB
testcase_17 AC 293 ms
18,792 KB
testcase_18 AC 297 ms
18,536 KB
testcase_19 AC 291 ms
18,580 KB
testcase_20 AC 293 ms
19,004 KB
testcase_21 AC 282 ms
18,508 KB
testcase_22 AC 283 ms
18,736 KB
testcase_23 AC 296 ms
18,596 KB
testcase_24 AC 293 ms
18,568 KB
testcase_25 AC 296 ms
18,544 KB
testcase_26 AC 291 ms
18,680 KB
testcase_27 AC 291 ms
18,776 KB
testcase_28 AC 292 ms
18,696 KB
testcase_29 AC 300 ms
18,520 KB
testcase_30 AC 286 ms
18,720 KB
testcase_31 AC 296 ms
18,684 KB
testcase_32 AC 292 ms
18,788 KB
testcase_33 AC 318 ms
18,652 KB
testcase_34 AC 291 ms
18,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using namespace std;


int main()
{
    int n, cnt = 0;
    bool yes = false;
    cin >> n;
    vector<long long> v1(n), v2(n);
    for (int i = 0; i < n; i++) cin >> v1[i];
    for (int i = 0; i < n; i++) cin >> v2[i];
    for (int i = 0; i < n; i++){
        if (!yes && v1[i] != v2[i]) yes = true;
        else if (yes && v1[i] == v2[i]){
            cnt++;
            yes = false;
        }
    }
    if (yes) cnt++;
    cout << cnt << endl;
}
0