結果

問題 No.2592 おでぶなおばけさん 2
ユーザー daiotadaiota
提出日時 2023-12-20 09:36:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 910 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 168,048 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-20 11:18:00
合計ジャッジ時間 19,234 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 15 ms
6,676 KB
testcase_02 AC 64 ms
6,676 KB
testcase_03 AC 30 ms
6,676 KB
testcase_04 AC 44 ms
6,676 KB
testcase_05 AC 50 ms
6,676 KB
testcase_06 AC 63 ms
6,676 KB
testcase_07 AC 96 ms
6,676 KB
testcase_08 AC 57 ms
6,676 KB
testcase_09 AC 24 ms
6,676 KB
testcase_10 AC 69 ms
6,676 KB
testcase_11 AC 56 ms
6,676 KB
testcase_12 AC 17 ms
6,676 KB
testcase_13 AC 153 ms
6,676 KB
testcase_14 AC 156 ms
6,676 KB
testcase_15 AC 147 ms
6,676 KB
testcase_16 AC 155 ms
6,676 KB
testcase_17 AC 157 ms
6,676 KB
testcase_18 AC 150 ms
6,676 KB
testcase_19 AC 146 ms
6,676 KB
testcase_20 AC 149 ms
6,676 KB
testcase_21 AC 149 ms
6,676 KB
testcase_22 AC 153 ms
6,676 KB
testcase_23 AC 158 ms
6,676 KB
testcase_24 AC 150 ms
6,676 KB
testcase_25 AC 143 ms
6,676 KB
testcase_26 AC 143 ms
6,676 KB
testcase_27 AC 162 ms
6,676 KB
testcase_28 AC 165 ms
6,676 KB
testcase_29 AC 164 ms
6,676 KB
testcase_30 AC 163 ms
6,676 KB
testcase_31 AC 166 ms
6,676 KB
testcase_32 AC 163 ms
6,676 KB
testcase_33 AC 166 ms
6,676 KB
testcase_34 AC 166 ms
6,676 KB
testcase_35 AC 169 ms
6,676 KB
testcase_36 AC 163 ms
6,676 KB
testcase_37 AC 165 ms
6,676 KB
testcase_38 AC 164 ms
6,676 KB
testcase_39 AC 164 ms
6,676 KB
testcase_40 AC 170 ms
6,676 KB
testcase_41 AC 165 ms
6,676 KB
testcase_42 AC 166 ms
6,676 KB
testcase_43 AC 168 ms
6,676 KB
testcase_44 AC 169 ms
6,676 KB
testcase_45 AC 173 ms
6,676 KB
testcase_46 AC 172 ms
6,676 KB
testcase_47 AC 163 ms
6,676 KB
testcase_48 AC 165 ms
6,676 KB
testcase_49 AC 162 ms
6,676 KB
testcase_50 AC 163 ms
6,676 KB
testcase_51 AC 160 ms
6,676 KB
testcase_52 AC 174 ms
6,676 KB
testcase_53 AC 169 ms
6,676 KB
testcase_54 AC 167 ms
6,676 KB
testcase_55 AC 168 ms
6,676 KB
testcase_56 AC 167 ms
6,676 KB
testcase_57 AC 17 ms
6,676 KB
testcase_58 AC 162 ms
6,676 KB
testcase_59 AC 166 ms
6,676 KB
testcase_60 AC 165 ms
6,676 KB
testcase_61 AC 163 ms
6,676 KB
testcase_62 AC 162 ms
6,676 KB
testcase_63 AC 162 ms
6,676 KB
testcase_64 AC 164 ms
6,676 KB
testcase_65 AC 161 ms
6,676 KB
testcase_66 AC 163 ms
6,676 KB
testcase_67 AC 159 ms
6,676 KB
testcase_68 AC 161 ms
6,676 KB
testcase_69 AC 162 ms
6,676 KB
testcase_70 AC 159 ms
6,676 KB
testcase_71 AC 160 ms
6,676 KB
testcase_72 AC 163 ms
6,676 KB
testcase_73 AC 159 ms
6,676 KB
testcase_74 WA -
testcase_75 AC 161 ms
6,676 KB
testcase_76 AC 163 ms
6,676 KB
testcase_77 AC 163 ms
6,676 KB
testcase_78 AC 162 ms
6,676 KB
testcase_79 AC 168 ms
6,676 KB
testcase_80 AC 165 ms
6,676 KB
testcase_81 AC 163 ms
6,676 KB
testcase_82 AC 164 ms
6,676 KB
testcase_83 AC 161 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],c[100010];
const ll MOD=998244353,mod=1e9+7,C=1e9+9;


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,kc=k%C;
	ll eM=1,em=1,eC=1;
	for(i=1;i<=n;i++){
		ll a;
		cin >> a;
		ll AM=a%MOD,am=a%mod,ac=a%C;
		AM+=MOD;
		am+=mod;
		ac+=C;

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

		eM*=kM;
		eM%=MOD;
		em*=km;
		em%=mod;
		eC*=kc;
		eC%=C;

	}

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

	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 && (c[r]-c[l-1]+C)%C==0) cout << "No" << endl;
		else cout << "Yes" << endl;

	}



	return 0;
}
0