結果
問題 | No.2592 おでぶなおばけさん 2 |
ユーザー | Misuki |
提出日時 | 2024-02-08 22:03:33 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 5,248 bytes |
コンパイル時間 | 4,192 ms |
コンパイル使用メモリ | 215,092 KB |
実行使用メモリ | 90,304 KB |
最終ジャッジ日時 | 2024-02-08 22:03:57 |
合計ジャッジ時間 | 22,696 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 111 ms
90,304 KB |
testcase_01 | AC | 119 ms
90,304 KB |
testcase_02 | AC | 124 ms
90,304 KB |
testcase_03 | AC | 128 ms
90,304 KB |
testcase_04 | AC | 130 ms
90,304 KB |
testcase_05 | AC | 132 ms
90,304 KB |
testcase_06 | AC | 125 ms
90,304 KB |
testcase_07 | AC | 129 ms
90,304 KB |
testcase_08 | AC | 127 ms
90,304 KB |
testcase_09 | AC | 117 ms
90,304 KB |
testcase_10 | AC | 121 ms
90,304 KB |
testcase_11 | AC | 126 ms
90,304 KB |
testcase_12 | AC | 126 ms
90,304 KB |
testcase_13 | WA | - |
testcase_14 | AC | 144 ms
90,304 KB |
testcase_15 | AC | 149 ms
90,304 KB |
testcase_16 | AC | 182 ms
90,304 KB |
testcase_17 | AC | 147 ms
90,304 KB |
testcase_18 | AC | 139 ms
90,304 KB |
testcase_19 | WA | - |
testcase_20 | AC | 133 ms
90,304 KB |
testcase_21 | AC | 131 ms
90,304 KB |
testcase_22 | AC | 134 ms
90,304 KB |
testcase_23 | AC | 159 ms
90,304 KB |
testcase_24 | WA | - |
testcase_25 | AC | 133 ms
90,304 KB |
testcase_26 | WA | - |
testcase_27 | AC | 162 ms
90,304 KB |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | AC | 162 ms
90,304 KB |
testcase_33 | AC | 163 ms
90,304 KB |
testcase_34 | AC | 162 ms
90,304 KB |
testcase_35 | WA | - |
testcase_36 | AC | 152 ms
90,304 KB |
testcase_37 | WA | - |
testcase_38 | AC | 152 ms
90,304 KB |
testcase_39 | AC | 151 ms
90,304 KB |
testcase_40 | AC | 152 ms
90,304 KB |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | AC | 151 ms
90,304 KB |
testcase_44 | AC | 151 ms
90,304 KB |
testcase_45 | WA | - |
testcase_46 | AC | 153 ms
90,304 KB |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | AC | 169 ms
90,304 KB |
testcase_50 | AC | 145 ms
90,304 KB |
testcase_51 | WA | - |
testcase_52 | AC | 152 ms
90,304 KB |
testcase_53 | AC | 151 ms
90,304 KB |
testcase_54 | AC | 151 ms
90,304 KB |
testcase_55 | AC | 175 ms
90,304 KB |
testcase_56 | WA | - |
testcase_57 | AC | 125 ms
90,304 KB |
testcase_58 | AC | 152 ms
90,304 KB |
testcase_59 | AC | 161 ms
90,304 KB |
testcase_60 | AC | 152 ms
90,304 KB |
testcase_61 | AC | 162 ms
90,304 KB |
testcase_62 | AC | 190 ms
90,304 KB |
testcase_63 | AC | 151 ms
90,304 KB |
testcase_64 | WA | - |
testcase_65 | AC | 149 ms
90,304 KB |
testcase_66 | AC | 163 ms
90,304 KB |
testcase_67 | AC | 162 ms
90,304 KB |
testcase_68 | AC | 149 ms
90,304 KB |
testcase_69 | AC | 162 ms
90,304 KB |
testcase_70 | AC | 147 ms
90,304 KB |
testcase_71 | AC | 147 ms
90,304 KB |
testcase_72 | AC | 148 ms
90,304 KB |
testcase_73 | WA | - |
testcase_74 | AC | 109 ms
90,304 KB |
testcase_75 | AC | 205 ms
90,304 KB |
testcase_76 | AC | 150 ms
90,304 KB |
testcase_77 | WA | - |
testcase_78 | AC | 161 ms
90,304 KB |
testcase_79 | AC | 164 ms
90,304 KB |
testcase_80 | AC | 153 ms
90,304 KB |
testcase_81 | AC | 192 ms
90,304 KB |
testcase_82 | AC | 152 ms
90,304 KB |
testcase_83 | WA | - |
ソースコード
#pragma GCC optimize("O2") #include <algorithm> #include <array> #include <bit> #include <bitset> #include <cassert> #include <cctype> #include <cfenv> #include <cfloat> #include <chrono> #include <cinttypes> #include <climits> #include <cmath> #include <compare> #include <complex> #include <concepts> #include <cstdarg> #include <cstddef> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <functional> #include <initializer_list> #include <iomanip> #include <ios> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <map> #include <memory> #include <new> #include <numbers> #include <numeric> #include <ostream> #include <queue> #include <random> #include <ranges> #include <set> #include <span> #include <sstream> #include <stack> #include <streambuf> #include <string> #include <tuple> #include <type_traits> #include <variant> #define int ll #define INT128_MAX (__int128)(((unsigned __int128) 1 << ((sizeof(__int128) * __CHAR_BIT__) - 1)) - 1) #define INT128_MIN (-INT128_MAX - 1) #define clock chrono::steady_clock::now().time_since_epoch().count() #ifdef DEBUG #define dbg(x) cout << (#x) << " = " << x << '\n' #else #define dbg(x) #endif namespace R = std::ranges; namespace V = std::views; using namespace std; using ll = long long; using ull = unsigned long long; using ldb = long double; using pii = pair<int, int>; using pll = pair<ll, ll>; //#define double ldb template<class T> ostream& operator<<(ostream& os, const pair<T, T> pr) { return os << pr.first << ' ' << pr.second; } template<class T, size_t N> ostream& operator<<(ostream& os, const array<T, N> &arr) { for(const T &X : arr) os << X << ' '; return os; } template<class T> ostream& operator<<(ostream& os, const vector<T> &vec) { for(const T &X : vec) os << X << ' '; return os; } template<class T> ostream& operator<<(ostream& os, const set<T> &s) { for(const T &x : s) os << x << ' '; return os; } //note: inversion only works when MOD is a prime struct mint { static long long MOD; long long _val; mint(long long init = 0) { _val = init % MOD; (*this).norm(); } mint POW(long long index) { if (index == 0) return mint(1ll); mint base = *this; mint res = (base == 0ll ? 0ll : 1ll); while(index) { if (index & 1) res *= base; base *= base, index >>= 1; } return res; } mint inv() { return (*this).POW(MOD - 2); } mint& norm() { if (_val >= MOD) _val -= MOD; if (_val < 0) _val += MOD; return *this; } mint& operator+=(mint b) { _val += b._val; return (*this).norm(); } mint& operator-=(mint b) { _val -= b._val; return (*this).norm(); } mint& operator*=(mint b) { _val = (_val * b._val) % MOD; return *this; } mint& operator/=(mint b) { _val = (_val * b.inv()._val) % MOD; return *this; } mint& operator++() { _val += 1; return (*this).norm(); } mint& operator--() { _val -= 1; return (*this).norm(); } mint operator++(signed) { mint tmp = *this; ++(*this); return tmp; } mint operator--(signed) { mint tmp = *this; --(*this); return tmp; } mint operator-() { return mint(-_val); } bool operator==(mint b) { return _val == b._val; } bool operator!=(mint b) { return _val != b._val; } friend mint operator+(mint a, mint b) { return a += b; } friend mint operator-(mint a, mint b) { return a -= b; } friend mint operator*(mint a, mint b) { return a *= b; } friend mint operator/(mint a, mint b) { return a /= b; } friend ostream& operator<<(ostream& os, const mint& b) { return os << b._val; } friend istream& operator>>(istream& is, mint& b) { long long val; is >> val; b = mint(val); return is; } }; ll mint::MOD = 2; const int C = 10000001; vector<int> prime; int mpf[C]; void sieve() { for(int i = 1; i < C; i++) mpf[i] = i; for(int i = 2; i < C; i++) { if (mpf[i] == i) prime.emplace_back(i); for(int P : prime) { if (P > mpf[i] or i * P >= C) break; mpf[i * P] = P; } } } vector<pii> factorize(int val) { vector<pii> res; while(val > 1) { int p = mpf[val]; res.emplace_back(p, 0); while(val % p == 0) res.back().second += 1, val /= p; } return res; } vector<int> factors(int val) { vector<int> res(1, 1); for(auto [p, idx] : factorize(val)) { vector<int> tmp; for(int i = 0, base = 1; i <= idx; i++, base *= p) for(int X : res) tmp.emplace_back(X * base); res.swap(tmp); } return res; } mt19937 rng(clock); uniform_int_distribution<int> unif(600000, 664578); signed main() { ios::sync_with_stdio(false), cin.tie(NULL); sieve(); int n, q, k; cin >> n >> q >> k; while(k % (mint::MOD = unif(rng)) == 0); dbg(mint::MOD); vector<mint> a(n + 1); for(mint &x : a | V::drop(1)) cin >> x; mint tmp = k; for(int i = 1; i <= n; i++) a[i] *= tmp, tmp *= k; partial_sum(a.begin(), a.end(), a.begin()); while(q--) { int l, r; cin >> l >> r; cout << (a[r] - a[l - 1] == 0 ? "No\n" : "Yes\n"); } return 0; }