結果
問題 |
No.2401 Dirty Shoes and Stairs
|
ユーザー |
|
提出日時 | 2023-08-04 22:05:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 44 ms / 2,000 ms |
コード長 | 402 bytes |
コンパイル時間 | 4,123 ms |
コンパイル使用メモリ | 251,244 KB |
最終ジャッジ日時 | 2025-02-15 22:46:30 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) int main(){ int n; cin>>n; vector<int> d(n+1,0); int nw=0; int m; cin>>m; rep(i,m){ int a; cin>>a; nw+=a; d.at(nw)=1; } cin>>m; rep(i,m){ int b; cin>>b; nw-=b; d.at(nw)=1; } int ans=0; rep(i,n+1) if(!d.at(i)) ans++; cout<<ans<<endl; }