結果
問題 | No.2592 おでぶなおばけさん 2 |
ユーザー | Misuki |
提出日時 | 2024-02-08 22:03:33 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 5,248 bytes |
コンパイル時間 | 2,913 ms |
コンパイル使用メモリ | 215,024 KB |
実行使用メモリ | 91,780 KB |
最終ジャッジ日時 | 2024-09-28 12:52:47 |
合計ジャッジ時間 | 20,447 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 110 ms
89,612 KB |
testcase_01 | AC | 115 ms
89,620 KB |
testcase_02 | AC | 123 ms
89,740 KB |
testcase_03 | AC | 115 ms
89,744 KB |
testcase_04 | WA | - |
testcase_05 | AC | 133 ms
89,744 KB |
testcase_06 | AC | 133 ms
89,616 KB |
testcase_07 | AC | 135 ms
89,744 KB |
testcase_08 | AC | 124 ms
90,004 KB |
testcase_09 | AC | 115 ms
89,656 KB |
testcase_10 | AC | 122 ms
89,612 KB |
testcase_11 | AC | 128 ms
89,744 KB |
testcase_12 | AC | 116 ms
89,616 KB |
testcase_13 | AC | 147 ms
89,960 KB |
testcase_14 | AC | 147 ms
89,740 KB |
testcase_15 | AC | 137 ms
89,740 KB |
testcase_16 | AC | 143 ms
90,956 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 139 ms
89,616 KB |
testcase_20 | AC | 139 ms
89,616 KB |
testcase_21 | AC | 136 ms
89,672 KB |
testcase_22 | AC | 140 ms
89,616 KB |
testcase_23 | AC | 140 ms
90,212 KB |
testcase_24 | AC | 135 ms
89,748 KB |
testcase_25 | AC | 127 ms
89,832 KB |
testcase_26 | AC | 128 ms
89,660 KB |
testcase_27 | WA | - |
testcase_28 | AC | 149 ms
89,744 KB |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | AC | 148 ms
89,804 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | AC | 158 ms
91,528 KB |
testcase_36 | AC | 160 ms
89,644 KB |
testcase_37 | AC | 156 ms
89,744 KB |
testcase_38 | AC | 157 ms
89,620 KB |
testcase_39 | AC | 152 ms
91,568 KB |
testcase_40 | AC | 157 ms
89,872 KB |
testcase_41 | AC | 158 ms
91,336 KB |
testcase_42 | AC | 154 ms
90,472 KB |
testcase_43 | AC | 156 ms
89,872 KB |
testcase_44 | AC | 151 ms
89,872 KB |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | AC | 148 ms
89,744 KB |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | AC | 150 ms
89,740 KB |
testcase_53 | AC | 150 ms
89,872 KB |
testcase_54 | WA | - |
testcase_55 | AC | 146 ms
89,716 KB |
testcase_56 | AC | 149 ms
89,872 KB |
testcase_57 | AC | 126 ms
89,872 KB |
testcase_58 | WA | - |
testcase_59 | AC | 150 ms
90,976 KB |
testcase_60 | AC | 149 ms
89,744 KB |
testcase_61 | AC | 150 ms
89,744 KB |
testcase_62 | AC | 151 ms
89,676 KB |
testcase_63 | AC | 149 ms
89,876 KB |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | AC | 148 ms
89,744 KB |
testcase_67 | AC | 146 ms
89,740 KB |
testcase_68 | WA | - |
testcase_69 | AC | 150 ms
89,748 KB |
testcase_70 | AC | 145 ms
89,620 KB |
testcase_71 | AC | 149 ms
89,612 KB |
testcase_72 | AC | 150 ms
89,744 KB |
testcase_73 | AC | 147 ms
89,872 KB |
testcase_74 | AC | 113 ms
89,872 KB |
testcase_75 | AC | 153 ms
89,748 KB |
testcase_76 | AC | 153 ms
89,744 KB |
testcase_77 | WA | - |
testcase_78 | WA | - |
testcase_79 | AC | 148 ms
89,612 KB |
testcase_80 | AC | 148 ms
89,744 KB |
testcase_81 | AC | 147 ms
91,336 KB |
testcase_82 | AC | 152 ms
89,876 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; }