結果
問題 | No.2401 Dirty Shoes and Stairs |
ユーザー | syun0713 |
提出日時 | 2023-08-04 21:28:18 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 5,367 bytes |
コンパイル時間 | 4,418 ms |
コンパイル使用メモリ | 270,300 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 19:25:17 |
合計ジャッジ時間 | 5,961 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 2 ms
5,248 KB |
testcase_03 | AC | 18 ms
5,248 KB |
testcase_04 | AC | 23 ms
5,248 KB |
testcase_05 | AC | 8 ms
5,248 KB |
testcase_06 | AC | 17 ms
5,248 KB |
testcase_07 | AC | 34 ms
5,248 KB |
testcase_08 | AC | 16 ms
5,248 KB |
testcase_09 | AC | 4 ms
5,248 KB |
testcase_10 | AC | 12 ms
5,248 KB |
testcase_11 | AC | 47 ms
5,248 KB |
testcase_12 | AC | 36 ms
5,248 KB |
testcase_13 | AC | 3 ms
5,248 KB |
testcase_14 | AC | 2 ms
5,248 KB |
testcase_15 | AC | 2 ms
5,248 KB |
testcase_16 | AC | 3 ms
5,248 KB |
testcase_17 | AC | 2 ms
5,248 KB |
testcase_18 | AC | 3 ms
5,248 KB |
testcase_19 | AC | 2 ms
5,248 KB |
testcase_20 | AC | 2 ms
5,248 KB |
testcase_21 | AC | 3 ms
5,248 KB |
testcase_22 | AC | 2 ms
5,248 KB |
testcase_23 | AC | 3 ms
5,248 KB |
testcase_24 | AC | 2 ms
5,248 KB |
testcase_25 | AC | 3 ms
5,248 KB |
testcase_26 | AC | 2 ms
5,248 KB |
testcase_27 | AC | 3 ms
5,248 KB |
testcase_28 | AC | 3 ms
5,248 KB |
testcase_29 | AC | 3 ms
5,248 KB |
testcase_30 | AC | 2 ms
5,248 KB |
testcase_31 | AC | 3 ms
5,248 KB |
testcase_32 | AC | 2 ms
5,248 KB |
コンパイルメッセージ
main.cpp:50:21: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts' 50 | void ain(set<T>& Y, auto n) { | ^~~~ main.cpp:57:26: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts' 57 | void ain(multiset<T>& Y, auto n) { | ^~~~
ソースコード
#include<bits/stdc++.h>#include <atcoder/all>using namespace atcoder;using mint = modint998244353;using namespace std;template<typename T>using vec = vector<T>;using ll = long long;using vi = vec<int>;using vs = vec<string>;using si = set<int>;using sll = set<ll>;using vc = vec<char>;using vvi = vec<vi>;using vll = vec<ll>;using vvll = vec<vll>;using pii = pair<int, int>;using pll = pair<ll, ll>;using mii = map<int, int>;using mll = map<ll, ll>;using msi = map<string, int>;using vpii = vec<pii>;using vpll = vec<pll>;using spii = set<pii>;using spll = set<pll>;#define rep(i,j,n) for(ll i=j;i<n;i++)#define rrep(i,j,n) for (ll i = n-1; i >=j; i--)#define rp(i,n) rep(i,0,n)#define rrp(i,n) rrep(i,0,n)#define all(v) v.begin(), v.end()#define pb push_back#define ins insert#define yes cout<<"Yes"<<endl;#define no cout<<"No"<<endl;#define yn(jg) cout<<(jg? "Yes":"No")<<endl;#define NL {cout<<endl;}#define n0 {cout<<"-1"<<endl;}#define fst first#define snd second#define lwb lower_bound#define upb upper_bound#define sz size()#define fi first#define se secondtemplate<typename... T>void in(T&... X) { (cin >> ... >> X); }template<typename T>void ain(vec<T>& Y) { rp(K, Y.size()) cin >> Y[K]; }template<typename T>void ain(set<T>& Y, auto n) {rp(i, n) {T YY; cin >> YY;Y.insert(YY);}}template<typename T>void ain(multiset<T>& Y, auto n) {rp(i, n) {T YY; cin >> YY;Y.insert(YY);}}template<typename T>void bin(vec<vec<T>>& Z) { rp(L, Z.size()) ain(Z[L]); }ll mod0 = 998244353, lmax = 9e18, inf = 2e9;double pi = 3.141592653589793238462643;template<typename T>void aout(T& a) { for (auto I : a) cout << I << " "; cout << endl; }template<typename T>void aout(queue<T> a) {while (!a.empty()) { cout << a.front(); a.pop(); }}template<typename T>void aout(stack<T> a) {while (!a.empty()) { cout << a.top(); a.pop(); }}#define bout(a) {for(auto J:a) aout(J);cout<<endl;}template<typename T>bool chmin(T& M1, T M2) {if (M1 > M2) { M1 = M2; return 1; }else return 0;}template<typename T>bool chmax(T& M1, T M2) {if (M1 < M2) { M1 = M2; return 1; }else return 0;}template<typename T>auto vmax(T& a) {return *max_element(all(a));}template<typename T>auto vmin(T& a) {return *min_element(all(a));}template<typename T>auto lwa(vector<T>& a, T b) {//aでbより小さい最大の値のイテレータauto i = lwb(all(a), b);if (i == a.begin()) return a.end();else i--;return i;}template<typename T>auto lwa(set<T>& a, T b) {//aでbより小さい最大の値のイテレータauto i = a.lwb(b);if (i == a.begin()) return a.end();else i--;return i;}template<typename T>auto lwa(multiset<T>& a, T b) {//aでbより小さい最大の値のイテレータauto i = a.lwb(b);if (i == a.begin()) return a.end();else i--;return i;}template<typename T>auto lwc(vector<T>& a, T b) {//aでb以下の最大の値のイテレータauto i = lwb(all(a), b);if (i != a.end() && *i == b) return i;if (i == a.begin()) return a.end();else i--;return i;}template<typename T>auto lwc(set<T>& a, T b) {//aでb以下の最大の値のイテレータauto i = a.lwb(b);if (i != a.end() && *i == b) return i;if (i == a.begin()) return a.end();else i--;return i;}template<typename T>auto lwc(multiset<T>& a, T b) {//aでb以下の最大の値のイテレータauto i = a.lwb(b);if (i != a.end() && *i == b) return i;if (i == a.begin()) return a.end();else i--;return i;}template<typename T>vec<T> rsw(vec<T>& a) {//累積和vec<T> b = a;rep(i, 1, b.size()) b[i] += b[i - 1];return b;}bool kai(string S) {//回文か判定bool ans = 1;rp(i, S.size()) if (S[i] != S[S.size() - 1 - i]) ans = 0;return ans;}sll yk(ll n) {//約数全列挙O(sqrt(N)),set<int>sll yaku;for (ll i = 1; i * i <= n; i++) if (n % i == 0) {yaku.insert(i);yaku.insert(n / i);}return yaku;}vi ssa(int n) {//n:必要な素数の最大値 素数全列挙vector<int> prime;vector<int>lpf(n + 1, 0);rep(i, 2, n + 1) {if (lpf[i] == 0) {lpf[i] = i;prime.push_back(i);}for (int k : prime) {if (k * i > n || k > lpf[i]) break;//k最小素因数よりk<=ilpf[k * i] = k;//kを最小素因数に持つ数k*iを拾う}}return prime;}vector<pll> sib(ll x) {//素因数分解if (x == 1) return vector<pll>(1, { 1,1 });vector<pll> ans;for (ll i = 2; i * i <= x; i++) {//rootx回iを回しxで割るll kaisu = 0;while (x % i == 0) {x /= i; kaisu++;}if (kaisu > 0) ans.pb({ i,kaisu });}if (x != 1) ans.pb({ x,1 });return ans;}template<typename T>vec<T> zat(vec<T> a) {//座標圧縮auto b = a;sort(all(b));b.erase(unique(all(b)), b.end());vec<T> c(a.size());rp(i, a.size()) {c[i] = lwb(all(b), a[i]) - b.begin();}return c;}//segtreeeee//Range min queryint op(int a, int b) {return min(a, b);}int e() {return (int)(1e9);}ll cc(ll a, ll b) {return (a * a + b * b) * (a + b);}//cout<<setprecision(15)<<fixed<<int main() {int n; cin >> n;vi ans(n + 1, 0);rp(i, 2) {int m; cin >> m;vi a(m);rp(j, m) cin >> a[j];int nd = 0;ans[0] = 0; ans[n] = 0;rp(j, m) {nd += a[j];if (i == 0) ans[nd] = 1;else ans[n - nd] = 1;}}int aans = 0;rp(i, n) if (ans[i] == 0) aans++;cout << aans;}