結果
問題 |
No.854 公平なりんご分配
|
ユーザー |
![]() |
提出日時 | 2019-02-22 15:35:47 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 332 bytes |
コンパイル時間 | 498 ms |
コンパイル使用メモリ | 56,552 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 10:00:57 |
合計ジャッジ時間 | 15,751 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 RE * 1 |
other | AC * 9 WA * 6 RE * 77 |
コンパイルメッセージ
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]; 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; } } }