結果
| 問題 |
No.854 公平なりんご分配
|
| コンテスト | |
| ユーザー |
Izac_55555333
|
| 提出日時 | 2019-02-22 15:48:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 350 bytes |
| コンパイル時間 | 532 ms |
| コンパイル使用メモリ | 56,492 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-25 10:06:28 |
| 合計ジャッジ時間 | 12,984 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 WA * 5 RE * 69 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
4 | main(){
| ^~~~
ソースコード
#include<iostream>
using namespace std;
main(){
int n;
cin >> n;
long long int a[n+1],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;
if( (b[r]/b[l-1])%p==0 ){
cout << "Yes" <<endl;
}else{
cout << "NO" <<endl;
}
}
}
Izac_55555333