結果
| 問題 |
No.142 単なる配列の操作に関する実装問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-27 21:24:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 699 bytes |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 37,504 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 11:12:18 |
| 合計ジャッジ時間 | 4,968 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 5 |
コンパイルメッセージ
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,&T,&U,&V,&Q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:16:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d%d%d%d",&S,&T,&U,&V);S--,U--;
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <vector>
#include <cstdio>
using namespace std;
typedef unsigned long long ull;
int main(){
int N,S,T,U,V,Q;
scanf("%d%d%d%d%d%d",&N,&S,&T,&U,&V,&Q);
vector<ull>A((N+127)/64),B((N+127)/64);
A[0]=S%2;
for(int i=1;i<N;i++){
S=((ull)T*S+U)%V;
int y=i/64,x=i%64;
A[i/64]|=(ull)S%2<<(i%64);
}
for(;Q--;){
scanf("%d%d%d%d",&S,&T,&U,&V);S--,U--;
int L=(T-S+63)/64;
for(int i=0;i<L;i++){
B[i]=A[S/64+i]>>S%64;
if(S%64)B[i]|=A[S/64+i+1]<<(64-S%64);
}
if(V=(T-S)%64)B[L-1]=B[L-1]<<(64-V)>>(64-V);
for(int i=0;i<L;i++){
A[U/64+i]^=B[i]<<U%64;
if(U%64)A[U/64+i+1]^=B[i]>>(64-U%64);
}
}
for(int i=0;i<N;i++)putchar((A[i/64]>>(i%64)%2)?'O':'E');
putchar('\n');
}