結果
問題 | No.2401 Dirty Shoes and Stairs |
ユーザー |
|
提出日時 | 2023-11-03 10:03:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 687 bytes |
コンパイル時間 | 1,909 ms |
コンパイル使用メモリ | 171,300 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-25 18:34:08 |
合計ジャッジ時間 | 3,241 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;#define rep(i,m,n) for(int i=m; i<n; ++i)#define repl(i,m,n) for(ll i=m; i<n; ++i)int main(){int N, L1;cin >> N >> L1;vector<int> A(L1);for(int &a : A) cin >> a;int L2;cin >> L2;vector<int> B(L2);for(int &b : B) cin >> b;vector<bool> clean(N+1, true);clean[0] = clean[N] = false;int S = 0;rep(i, 0, L1){S += A[i];clean[S] = false;}int T = N;rep(i, 0, L2){T -= B[i];clean[T] = false;}int ans = 0;rep(i, 0, N+1){if(clean[i]) ans++;}cout << ans << endl;return 0;}