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