QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#367785#7979. 棋盘RedreamMer0 306ms7664kbC++202.2kb2024-03-26 13:59:002024-03-26 13:59:01

Judging History

你现在查看的是最新测评结果

  • [2024-03-26 13:59:01]
  • 评测
  • 测评结果:0
  • 用时:306ms
  • 内存:7664kb
  • [2024-03-26 13:59:00]
  • 提交

answer

// #pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;

#define PB emplace_back
#define int long long
#define ll long long
#define vi vector<int>
#define siz(a) ((int) ((a).size()))
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
void print(vi n) { rep(i, 0, siz(n) - 1) cerr << n[i] << " \n"[i == siz(n) - 1]; }

const int N = 1000;
int a, b, c, d, top, pw[16];
bool ans[N + 5];
char o[N + 5];
struct Bigint{
	int a[7];
	Bigint(int x=0)
	{
		a[0]=x;
		for(int i=1;i<7;i++) a[i]=0;
	}
	int& operator [](int w){return a[w];}
	void init()
	{
		cin >> o;
		int n=strlen(o);
		reverse(o,o+n);
		for(int i=0;i<7;i++) a[i]=0;
		for(int i=0;i<n;i++)
			a[i/15]+=pw[i%15]*(o[i]-'0');
	}
	void print()
	{
		for(int i=6;i>=0;i--)std::cout<<a[i]<<' ';
		std::cout<<'\n';
	}
	bool check()
	{
		for(int i=0;i<7;i++)if(a[i])return 1;
		return 0;
	}
} s[255][255], w[N + 5], x;
Bigint operator + (Bigint a,Bigint b)
{
	Bigint c;
	for(int i=0;i<7;i++)c[i]=a[i]+b[i];
	for(int i=0;i<6;i++)c[i+1]+=c[i]/pw[15],c[i]%=pw[15];
	return c;
}
Bigint operator - (Bigint a,Bigint b)
{
	Bigint c;
	for(int i=0;i<7;i++)c[i]=a[i]-b[i];
	for(int i=0;i<6;i++)if(c[i]<0)c[i]+=pw[15],c[i+1]--;
	return c;
}
bool operator >=(Bigint a,Bigint b)
{
	for(int i=6;i>=0;i--)if(a[i]!=b[i])return a[i]>b[i];
	return 1;
}

void ins(int n, int m) {
	w[++top] = s[n][m] = s[n - 1][m] + s[n][m - 1];
}

signed main() {
	// freopen(".in", "r", stdin);
	// freopen(".out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	pw[0]=1;
	rep(i, 1, 15) pw[i] = pw[i - 1] * 10;
	cin >> a >> b >> c >> d;
	top = 1;
	s[1][1] = w[1] = Bigint(1);
	rep(i, 1, 239) ins(i, i + 1), ins(i, i + 2), ins(i + 1, i + 1), ins(i + 2, i + 1);
	while(b--) {
		x.init();
		per(i, top, 1) {
			ans[i] = x >= w[i];
			if(ans[i]) x = x - w[i];
		}
		rep(i, 1, top) cout << ans[i];
		cout << '\n';
	}
	return cerr << endl << 1.0 * clock() / CLOCKS_PER_SEC << endl, 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 27ms
memory: 7616kb

input:

3 999 1000 340
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...

output:

000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

wrong output format Expected integer, but "000010000000000000000000000000...0000000000000000000000000000000" found

Subtask #2:

score: 0
Wrong Answer

Test #2:

score: 0
Wrong Answer
time: 258ms
memory: 7664kb

input:

12 10000 1000 340
358908473750
36343501002
904324605639
453955046266
725478753662
218319365131
882878650993
648345848966
474401697383
722377018680
718743783955
748051292505
167886140898
411111004914
327825244967
990026144963
623309580364
970889332700
319445927842
527624602835
453135227321
1153226125...

output:

000000001000000000000000100010001000001000001000100000000010001000100010000000001000000000100000000010001000100010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

wrong output format Expected integer, but "000000001000000000000000100010...0000000000000000000000000000000" found

Subtask #3:

score: 0
Wrong Answer

Test #5:

score: 0
Wrong Answer
time: 301ms
memory: 7624kb

input:

100 10000 1000 340
87490023455826213450979333037504606824522062808297739018786336978222089712660133428564103979384831
874900289913204769749000879539227331559680630241808944569515663934025397982898503777823815274323967
8749002899116133353924895735921513229471979456689635148877567298640178774668643967...

output:

000000000010001000000000000010000000001000000000001000100010000000100010000010000010001000001000100000001000100010000000100000000000001000100010000000001000000000100000000000000000000000001000000010000000001000000010001000001000100000000000001000000000000010000000001000000010000010000000000010000000...

result:

wrong output format Expected integer, but "000000000010001000000000000010...0000001000000010000000000000000" found

Subtask #4:

score: 0
Wrong Answer

Test #7:

score: 0
Wrong Answer
time: 306ms
memory: 7480kb

input:

100 10000 990 310
4083451712318559926139496762164571032902328806667934236880329773320213539959944736095945843081512968
7811890641057562314768022152641517082686481268288006737090208624016586608183953908313798353213188661
97358161226180890688421784730819518002666166790210320310558753031161862165361257...

output:

000010001000001000000010001000100010001000100000000010000000100000001000001000100000100010000000100000000000000000000000000010000010001000000000100010001000100000100000001000000000100010000000000010000000000000001000001000000000000000001000001000000000001000100010000000001000000000100000100010001000...

result:

wrong output format Expected integer, but "000010001000001000000010001000...1000000000001000000000100000001" found

Subtask #5:

score: 0
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 297ms
memory: 7532kb

input:

100 10000 1050 260
8749002899132047697490008908470485461412677723566863434996575047286849703722697797645542008396185599
8749002899132047697490008908470485461412677699052921091826559946707718798046219210886366418022957055
7655377536740541735303757766642121742076255665128332760334129720709510994307378...

output:

000010000000001000100000001000000000001000001000100010000000001000001000001000000000001000100000001000100000100000000010001000000000001000000010000010000010001000000010000000100010000000100010000010000000000010000010000010000000000000100010000010000000000000001000001000001000001000000000000000001000...

result:

wrong output format Expected integer, but "000010000000001000100000001000...0010001000100000000010000010011" found

Subtask #6:

score: 0
Wrong Answer

Test #11:

score: 0
Wrong Answer
time: 297ms
memory: 7416kb

input:

100 10000 1050 240
8749002899132047697490008908470485461412677723572849734285100881333676956761384191490477496469520383
874886939179415873527191365288672777702448917037688119492655525651250910013304087281579324577152991
87490028991320476974900089084704854614126777235728490149522637601883528949454159...

output:

000000001000000010000000000000000000100000000010000000100000100000001000000010001000000000000000001000001000001000000010000000100000000010000010000000100010000000001000100000000010000000001000000000000000100000001000100000100000100000001000100000100010001000000010000000001000100010001000000000001000...

result:

wrong output format Expected integer, but "000000001000000010000000000000...0010001000100000000010000010011" found

Subtask #7:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 2ms
memory: 7528kb

input:

100 1 980 260
8749002899132047697490008908470485461309833682610292204604841418296589481615503153703163411103219711

output:

000000000010001000001000100000000000000000000000000010001000001000000000100000000000100000000010001000001000000010000000001000000010001000100000000010001000001000000010000000100000100000100000000010000010000010001000100000100000001000000010001000100010001000001000000010000000000000001000100010000000...

result:

wrong output format Expected integer, but "000000000010001000001000100000...0010001000100000000010000010011" found

Subtask #8:

score: 0
Wrong Answer

Test #19:

score: 0
Wrong Answer
time: 296ms
memory: 7616kb

input:

100 10000 960 240
8749002899132047697015724510954438324957730968977252383122989921226002617013223698533483281626692607
8749002899132047697490008908470485461412677720507858663971304708923117942496885325656574463725010943
87148271065573131361716885470369961093519598137825155235803895087505468828694702...

output:

000000001000000000001000100000100010000000000000000000100010001000000010001000100010001000100000000000000000100000001000000000000000100000001000000000000010000000100010000000001000001000000000000000100000000010000010001000001000000010000010000000000010001000100000000000100000100010000000001000001000...

result:

wrong output format Expected integer, but "000000001000000000001000100000...0010001000100000000010000010011" found