結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー monnu
提出日時 2023-08-04 21:27:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 1,401 ms
コンパイル使用メモリ 170,928 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-10-14 19:24:46
合計ジャッジ時間 2,727 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    int N;
    cin >> N;
    set<int> s;
    int x = 0;
    int M1;
    cin >> M1;
    for (int i = 0; i < M1; i++)
    {
        int A;
        cin >> A;
        x += A;
        s.insert(x);
    }
    int M2;
    cin >> M2;
    for (int i = 0; i < M2; i++)
    {
        int B;
        cin >> B;
        x -= B;
        s.insert(x);
    }

    cout << N + 1 - s.size() << endl;
}
0