結果
| 問題 |
No.142 単なる配列の操作に関する実装問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-27 14:09:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 433 bytes |
| コンパイル時間 | 1,312 ms |
| コンパイル使用メモリ | 36,352 KB |
| 実行使用メモリ | 25,148 KB |
| 最終ジャッジ日時 | 2024-07-06 10:56:51 |
| 合計ジャッジ時間 | 19,072 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 TLE * 1 -- * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d%d%d%d%d%d",&N,&S,&X,&Y,&Z,&Q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d%d%d%d",&S,&T,&U,&V);S--,T--,U--,V--;
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <vector>
#include <cstdio>
using namespace std;
int main(){
int N,S,X,Y,Z,Q;
scanf("%d%d%d%d%d%d",&N,&S,&X,&Y,&Z,&Q);
vector<int>A(N),B(N);
A[0]=S;
for(int i=1;i<N;i++)A[i]=(X*A[i-1]+Y)%Z;
for(;Q--;){
int S,T,U,V;
scanf("%d%d%d%d",&S,&T,&U,&V);S--,T--,U--,V--;
B.clear();
for(int i=S;i<=T;i++)B[i-S]=A[i];
for(int i=U;i<=V;i++)A[i]^=B[i-U];
}
for(int i=0;i<N;i++)putchar(A[i]%2?'O':'E');
putchar('\n');
}