結果
| 問題 | No.142 単なる配列の操作に関する実装問題 |
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2018-11-25 22:27:10 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 745 bytes |
| 記録 | |
| コンパイル時間 | 1,273 ms |
| コンパイル使用メモリ | 213,720 KB |
| 実行使用メモリ | 18,560 KB |
| 最終ジャッジ日時 | 2026-06-07 04:35:55 |
| 合計ジャッジ時間 | 14,279 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 4 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//INSERT ABOVE HERE
signed main(){
int n,s,x,y,z;
scanf("%d %d %d %d %d",&n,&s,&x,&y,&z);
const int MAX=2e6+100;
bitset<MAX> res(0),all(0);
for(int i=0;i<MAX;i++) all[i]=1;
for(int i=0,a=s;i<n;i++){
res[i]=a&1;
a=(1LL*x*a+y)%z;
}
int q;
scanf("%d",&q);
for(int i=0;i<q;i++){
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
a--;c--;
int l=b-a;
res^=((res>>a)&(all>>(MAX-l)))<<c;
}
for(int i=0;i<n;i++)
printf("%c",res[i]?'O':'E');
puts("");
return 0;
}
beet