結果
| 問題 |
No.142 単なる配列の操作に関する実装問題
|
| コンテスト | |
| ユーザー |
Lepton_s
|
| 提出日時 | 2015-02-02 00:25:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,372 bytes |
| コンパイル時間 | 747 ms |
| コンパイル使用メモリ | 82,416 KB |
| 実行使用メモリ | 16,896 KB |
| 最終ジャッジ日時 | 2024-06-23 05:59:39 |
| 合計ジャッジ時間 | 13,613 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:53:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
53 | scanf(" %d %d %d %d", &s, &t, &u, &v);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<25;
typedef pair<int,int> P;
typedef long long ll;
typedef unsigned long long ull;
#define N 2000000
int a[N];
ull A[N/64+100], B[N/64+100];
void bxor(ull *A, int a, ull *B, int b, int n){
int ma = a%64, mb = b%64;
int aa = a/64, bb = b/64;
for(int i = 0; i < (n+64); i++){
ull e = (B[bb+i]>>mb) | (B[bb+i])<<(64-mb);
int ct = i+64-n;
if(ct>0) e = (e<<ct)>>ct;
A[aa+i] ^= e<<ma; A[aa+i+1] ^= e>>(64-ma);
}
}
int main(){
ll n, x, y, z;
cin>>n>>a[0]>>x>>y>>z;
for(int i = 1; i < n; i++)
a[i] = (a[i-1]*x+y)%z;
for(int i = 0; i < n; i++)
A[i/64] |= (a[i]&1)<<(i%64);
int q;
cin>>q;
for(int i = 0; i < q; i++){
int s, t, u, v;
scanf(" %d %d %d %d", &s, &t, &u, &v);
s--; u--;
int ss = s/64*64, uu = u/64*64;
int m = t-s;
memset(B, 0, sizeof(B)/8);
bxor(B, 0, A, s, m);
bxor(A, u, B, 0, m);
}
for(int i = 0; i < n; i++)
printf("%c",A[i/64]&(1<<i)?'O':'E');
puts("");
return 0;
}
Lepton_s