結果
| 問題 |
No.2401 Dirty Shoes and Stairs
|
| コンテスト | |
| ユーザー |
Today03
|
| 提出日時 | 2023-08-05 16:30:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 346 bytes |
| コンパイル時間 | 1,656 ms |
| コンパイル使用メモリ | 194,856 KB |
| 最終ジャッジ日時 | 2025-02-15 23:37:22 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
vector<int> ch(n+1);
ch[0]=ch[n]=1;
for (int i=0;i<2;i++) {
int m;
cin>>m;
int sum=0;
for (int j=0;j<m;j++) {
int a;
cin>>a;
sum+=a;
ch[(i==0?sum:n-sum)]=1;
}
}
cout<<n+1-accumulate(ch.begin(),ch.end(),0)<<endl;
}
Today03