結果
問題 |
No.2401 Dirty Shoes and Stairs
|
ユーザー |
![]() |
提出日時 | 2023-10-22 17:20:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 569 bytes |
コンパイル時間 | 912 ms |
コンパイル使用メモリ | 106,840 KB |
実行使用メモリ | 11,648 KB |
最終ジャッジ日時 | 2024-09-22 09:47:02 |
合計ジャッジ時間 | 2,454 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#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; }