結果

問題 No.2401 Dirty Shoes and Stairs
ユーザー momoyuumomoyuu
提出日時 2023-10-22 17:20:20
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 569 bytes
コンパイル時間 969 ms
コンパイル使用メモリ 106,364 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2023-10-22 17:20:24
合計ジャッジ時間 3,678 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 32 ms
7,764 KB
testcase_04 AC 33 ms
8,780 KB
testcase_05 AC 12 ms
5,200 KB
testcase_06 AC 31 ms
7,796 KB
testcase_07 AC 54 ms
10,332 KB
testcase_08 AC 21 ms
6,796 KB
testcase_09 AC 4 ms
4,348 KB
testcase_10 AC 17 ms
5,768 KB
testcase_11 AC 79 ms
10,936 KB
testcase_12 AC 73 ms
11,776 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 3 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 3 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<stack>
#include<vector>
#include<set>

using namespace std;
using ll = long long;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int n;
    cin>>n;
    int ans = 1+n;
    int now = 0;
    set<int> s;
    int a;
    cin>>a;
    for(int i = 0;i<a;i++){
        int k;
        cin>>k;
        now += k;
        s.insert(now);
    }
    cin>>a;
    for(int i = 0;i<a;i++){
        int k;
        cin>>k;
        now -= k;
        s.insert(now);
    }
    ans -= s.size();
    cout<<ans<<endl;
}
0