結果

問題 No.854 公平なりんご分配
コンテスト
ユーザー CuriousFairy315
提出日時 2019-02-22 18:16:40
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 398 bytes
コンパイル時間 1,375 ms
コンパイル使用メモリ 55,504 KB
実行使用メモリ 13,768 KB
最終ジャッジ日時 2024-11-25 10:12:43
合計ジャッジ時間 104,573 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 78 TLE * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    4 | main(){
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;

main(){
int n;
cin >> n;
long long int a[n+1];
long long int b[n+1];
a[0]=1;
//b[0]=1;
for(int i=1;i<=n;i++){
cin >> a[i];
//b[i]=b[i-1]*a[i];
}
int q;
cin >> q;
int p,l,r;
for(int i=0;i<q;i++){
cin >> p >> l >> r;
int x=1;
for(int i=l;i<=r;i++){
x=x*a[i]%p;
}
if( x==0 ){
cout << "Yes" <<endl;
}else{
cout << "NO" <<endl;
}
}

} // 前テスターコード
0