結果

問題 No.2592 おでぶなおばけさん 2
ユーザー daiotadaiota
提出日時 2023-12-20 18:56:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 201 ms / 2,500 ms
コード長 840 bytes
コンパイル時間 1,971 ms
コンパイル使用メモリ 171,616 KB
実行使用メモリ 8,736 KB
最終ジャッジ日時 2023-12-20 18:56:45
合計ジャッジ時間 21,188 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 27 ms
6,548 KB
testcase_02 AC 74 ms
6,548 KB
testcase_03 AC 33 ms
6,548 KB
testcase_04 AC 46 ms
6,548 KB
testcase_05 AC 78 ms
8,516 KB
testcase_06 AC 74 ms
6,548 KB
testcase_07 AC 107 ms
6,548 KB
testcase_08 AC 72 ms
6,548 KB
testcase_09 AC 29 ms
6,548 KB
testcase_10 AC 70 ms
6,548 KB
testcase_11 AC 72 ms
6,548 KB
testcase_12 AC 20 ms
6,548 KB
testcase_13 AC 170 ms
6,548 KB
testcase_14 AC 171 ms
6,548 KB
testcase_15 AC 164 ms
6,548 KB
testcase_16 AC 172 ms
6,548 KB
testcase_17 AC 176 ms
7,680 KB
testcase_18 AC 159 ms
6,548 KB
testcase_19 AC 155 ms
6,548 KB
testcase_20 AC 169 ms
6,548 KB
testcase_21 AC 159 ms
6,548 KB
testcase_22 AC 184 ms
7,440 KB
testcase_23 AC 179 ms
7,712 KB
testcase_24 AC 166 ms
6,548 KB
testcase_25 AC 149 ms
6,548 KB
testcase_26 AC 150 ms
6,548 KB
testcase_27 AC 191 ms
8,736 KB
testcase_28 AC 199 ms
8,736 KB
testcase_29 AC 190 ms
8,736 KB
testcase_30 AC 189 ms
8,736 KB
testcase_31 AC 195 ms
8,736 KB
testcase_32 AC 192 ms
8,736 KB
testcase_33 AC 198 ms
8,736 KB
testcase_34 AC 194 ms
8,728 KB
testcase_35 AC 191 ms
8,736 KB
testcase_36 AC 192 ms
8,736 KB
testcase_37 AC 200 ms
8,736 KB
testcase_38 AC 201 ms
8,736 KB
testcase_39 AC 192 ms
8,736 KB
testcase_40 AC 190 ms
8,736 KB
testcase_41 AC 189 ms
8,736 KB
testcase_42 AC 189 ms
8,736 KB
testcase_43 AC 195 ms
8,736 KB
testcase_44 AC 201 ms
8,736 KB
testcase_45 AC 195 ms
8,736 KB
testcase_46 AC 195 ms
8,736 KB
testcase_47 AC 186 ms
8,736 KB
testcase_48 AC 186 ms
8,736 KB
testcase_49 AC 185 ms
8,736 KB
testcase_50 AC 188 ms
8,736 KB
testcase_51 AC 187 ms
8,736 KB
testcase_52 AC 192 ms
8,736 KB
testcase_53 AC 193 ms
8,736 KB
testcase_54 AC 195 ms
8,736 KB
testcase_55 AC 199 ms
8,736 KB
testcase_56 AC 193 ms
8,736 KB
testcase_57 AC 43 ms
8,736 KB
testcase_58 AC 192 ms
8,736 KB
testcase_59 AC 191 ms
8,736 KB
testcase_60 AC 195 ms
8,736 KB
testcase_61 AC 196 ms
8,736 KB
testcase_62 AC 191 ms
8,736 KB
testcase_63 AC 189 ms
8,736 KB
testcase_64 AC 192 ms
8,736 KB
testcase_65 AC 188 ms
8,736 KB
testcase_66 AC 189 ms
8,736 KB
testcase_67 AC 192 ms
8,736 KB
testcase_68 AC 188 ms
8,736 KB
testcase_69 AC 186 ms
8,736 KB
testcase_70 AC 187 ms
8,736 KB
testcase_71 AC 186 ms
8,736 KB
testcase_72 AC 187 ms
8,736 KB
testcase_73 AC 192 ms
8,736 KB
testcase_74 AC 2 ms
6,676 KB
testcase_75 AC 193 ms
8,736 KB
testcase_76 AC 193 ms
8,736 KB
testcase_77 AC 191 ms
8,736 KB
testcase_78 AC 190 ms
8,736 KB
testcase_79 AC 195 ms
8,736 KB
testcase_80 AC 192 ms
8,736 KB
testcase_81 AC 189 ms
8,736 KB
testcase_82 AC 191 ms
8,736 KB
testcase_83 AC 193 ms
8,736 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 a[100010];
vector<ll> c[7];
vector<ll> m={1000000007,1000000009,1000000021,1000000033,1000000087};


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

	ll n,q,k;
	cin >> n >> q >> k;
	for(i=1;i<=n;i++) cin >> a[i];


	REP(j,5){

	ll MOD=m[j];
	ll K=k%MOD;
	ll e=1;

	c[j].push_back(0);
	for(i=1;i<=n;i++){
		ll A=a[i]%MOD;
		A+=MOD;

		c[j].push_back((A*e)%MOD);

		e*=K;
		e%=MOD;
	}

	for(i=1;i<=n;i++){
		c[j][i]+=c[j][i-1];
		c[j][i]%=MOD;
	}

	}


	for(i=1;i<=q;i++){
	ll l,r;
	cin >> l >> r;

	bool f=false;
	REP(j,5){
		if((c[j][r]-c[j][l-1]+m[j])%m[j]!=0){
			f=true;
			cout << "Yes" << endl;
			break;
		}
	}

	if(!f) cout << "No" << endl;

	}



	return 0;

}
0