結果

問題 No.2592 おでぶなおばけさん 2
ユーザー daiotadaiota
提出日時 2023-12-20 04:34:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 749 bytes
コンパイル時間 1,627 ms
コンパイル使用メモリ 167,784 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-20 04:34:57
合計ジャッジ時間 19,507 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 14 ms
6,548 KB
testcase_02 AC 65 ms
6,548 KB
testcase_03 AC 29 ms
6,548 KB
testcase_04 AC 44 ms
6,548 KB
testcase_05 AC 50 ms
6,548 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 154 ms
6,548 KB
testcase_14 AC 154 ms
6,548 KB
testcase_15 AC 149 ms
6,548 KB
testcase_16 AC 153 ms
6,548 KB
testcase_17 AC 158 ms
6,548 KB
testcase_18 AC 175 ms
6,548 KB
testcase_19 AC 147 ms
6,548 KB
testcase_20 AC 144 ms
6,548 KB
testcase_21 AC 141 ms
6,548 KB
testcase_22 AC 149 ms
6,548 KB
testcase_23 AC 158 ms
6,548 KB
testcase_24 AC 153 ms
6,548 KB
testcase_25 AC 171 ms
6,548 KB
testcase_26 AC 146 ms
6,548 KB
testcase_27 AC 163 ms
6,548 KB
testcase_28 AC 164 ms
6,548 KB
testcase_29 AC 165 ms
6,548 KB
testcase_30 AC 165 ms
6,548 KB
testcase_31 AC 174 ms
6,548 KB
testcase_32 AC 165 ms
6,548 KB
testcase_33 AC 164 ms
6,548 KB
testcase_34 AC 163 ms
6,548 KB
testcase_35 AC 164 ms
6,548 KB
testcase_36 AC 163 ms
6,548 KB
testcase_37 AC 163 ms
6,548 KB
testcase_38 AC 168 ms
6,548 KB
testcase_39 AC 163 ms
6,548 KB
testcase_40 AC 164 ms
6,548 KB
testcase_41 AC 162 ms
6,548 KB
testcase_42 AC 162 ms
6,548 KB
testcase_43 AC 163 ms
6,548 KB
testcase_44 AC 164 ms
6,548 KB
testcase_45 AC 165 ms
6,548 KB
testcase_46 AC 163 ms
6,548 KB
testcase_47 AC 156 ms
6,548 KB
testcase_48 AC 156 ms
6,548 KB
testcase_49 AC 156 ms
6,548 KB
testcase_50 AC 183 ms
6,676 KB
testcase_51 AC 156 ms
6,676 KB
testcase_52 AC 163 ms
6,676 KB
testcase_53 AC 164 ms
6,676 KB
testcase_54 AC 162 ms
6,676 KB
testcase_55 AC 163 ms
6,676 KB
testcase_56 AC 164 ms
6,676 KB
testcase_57 AC 15 ms
6,676 KB
testcase_58 AC 163 ms
6,676 KB
testcase_59 AC 162 ms
6,676 KB
testcase_60 AC 162 ms
6,676 KB
testcase_61 AC 166 ms
6,676 KB
testcase_62 AC 163 ms
6,676 KB
testcase_63 AC 165 ms
6,676 KB
testcase_64 AC 164 ms
6,676 KB
testcase_65 AC 160 ms
6,676 KB
testcase_66 WA -
testcase_67 AC 162 ms
6,676 KB
testcase_68 AC 160 ms
6,676 KB
testcase_69 AC 161 ms
6,676 KB
testcase_70 WA -
testcase_71 WA -
testcase_72 AC 159 ms
6,676 KB
testcase_73 AC 158 ms
6,676 KB
testcase_74 AC 162 ms
6,676 KB
testcase_75 AC 164 ms
6,676 KB
testcase_76 AC 182 ms
6,676 KB
testcase_77 AC 164 ms
6,676 KB
testcase_78 AC 164 ms
6,676 KB
testcase_79 AC 163 ms
6,676 KB
testcase_80 AC 163 ms
6,676 KB
testcase_81 AC 163 ms
6,676 KB
testcase_82 AC 189 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)


ll M[100010],m[100010];
const ll MOD=1e9+9,mod=1e9+7;


int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	ll i,j;

	ll n,q,k;
	cin >> n >> q >> k;

	ll kM=k%MOD,km=k%mod;
	ll eM=1,em=1;
	for(i=1;i<=n;i++){
		ll a;
		cin >> a;
		ll AM=a%MOD,am=a%mod;

		M[i]=(AM*eM)%MOD;
		m[i]=(am*em)%mod;

		eM*=kM;
		eM%=MOD;
		em*=km;
		em%=MOD;
	}

	for(i=1;i<=n;i++){
		M[i]+=M[i-1];
		M[i]%=MOD;
		m[i]+=m[i-1];
		m[i]%=mod;
	}

	while(q--){
		ll l,r;
		cin >> l >> r;

		if((M[r]-M[l-1]+MOD)%MOD==0 && (m[r]-m[l-1]+mod)%mod==0) cout << "No" << endl;
		else cout << "Yes" << endl;

	}



	return 0;
}
0