QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#704876 | #1773. Breaking Bars | TheZone | AC ✓ | 759ms | 20328kb | C++20 | 5.0kb | 2024-11-02 21:21:55 | 2024-11-02 21:21:59 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define vi vector<int>
#define pi pair<int, int>
#define mod 998244353
template<typename T> bool chkmin(T &a, T b){return (b < a) ? a = b, 1 : 0;}
template<typename T> bool chkmax(T &a, T b){return (b > a) ? a = b, 1 : 0;}
ll ksm(ll a, ll b) {if (b == 0) return 1; ll ns = ksm(a, b >> 1); ns = ns * ns % mod; if (b & 1) ns = ns * a % mod; return ns;}
using namespace std;
int dp[1 << 21];
int ind[7][7];
vi mask[21];
int gid(int a, int b) {
if (a > b) swap(a, b);
return ind[a][b];
}
int ndp[1 << 21];
int sz[21];
int main() {
int cnt = 0;
for (int i = 1; i <= 6; i++)
for (int j = i; j <= 6; j++)
ind[i][j] = cnt++,
sz[ind[i][j]] = i * j;
for (int i = 1; i <= 6; i++)
for (int j = i; j <= 6; j++) {
int id = gid(i, j);
for (int s = 1; s < i; s++)
mask[id].pb((1 << gid(s, j)) ^ (1 << gid(i - s, j)));
for (int s = 1; s < j; s++)
mask[id].pb((1 << gid(i, s)) ^ (1 << gid(i, j - s)));
sort(mask[id].begin(), mask[id].end());
mask[id].erase(unique(mask[id].begin(), mask[id].end()), mask[id].end());
}
int n, t;
cin >> n >> t;
int need = 2 * t;
int total = 0;
vi cur;
for (int i = 1; i <= n; i++) {
char x[10];
scanf("%s", x);
int a = x[0] - '0', b = x[2] - '0';
total += a * b;
int nid = gid(a, b);
cur.pb(nid);
}
int waste = total - need;
sort(cur.begin(), cur.end());
dp[0] = 0;
for (int i = 1; i < (1 << 21); i++)
dp[i] = 1e9;
for (auto v : cur) {
//memcpy(ndp, dp, sizeof(dp));
fill(ndp, ndp + (1 << 21), 1e9);
for (int j = 0; j < (1 << 21); j++) {
for (auto h : mask[v])
chkmin(ndp[j ^ h], dp[j] + 1);
chkmin(ndp[j ^ (1 << v)], dp[j]);
}
memcpy(dp, ndp, sizeof(dp));
}
for (int s = 0; s < 2; s++)
for (int i = 20; i >= 0; i--) {
for (int j = 0; j < (1 << 21); j++) {
if (!(j & (1 << i))) continue;
for (auto v : mask[i])
chkmin(dp[j ^ v ^ (1 << i)], dp[j] + 1);
}
}
int ans = 1e9;
//cout << waste << endl;
for (int i = 0; i < (1 << 21); i++) {
int was = 0;
for (int j = 0; j < 21; j++)
if (i & (1 << j)) was += sz[j];
if (was <= waste) {
//if (!dp[i]) cout << "??? " << i << endl;
chkmin(ans, dp[i]);
}
}
cout << ans << endl;
return 0;
}
/*#include <bits/stdc++.h>
#define ll long long
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define vi vector<int>
#define pi pair<int, int>
#define mod 998244353
template<typename T> bool chkmin(T &a, T b){return (b < a) ? a = b, 1 : 0;}
template<typename T> bool chkmax(T &a, T b){return (b > a) ? a = b, 1 : 0;}
ll ksm(ll a, ll b) {if (b == 0) return 1; ll ns = ksm(a, b >> 1); ns = ns * ns % mod; if (b & 1) ns = ns * a % mod; return ns;}
using namespace std;
int dp[1 << 21];
int ind[7][7];
vi mask[21];
int gid(int a, int b) {
if (a > b) swap(a, b);
return ind[a][b];
}
int ndp[1 << 21];
int sz[21];
int main() {
int cnt = 0;
for (int i = 1; i <= 6; i++)
for (int j = i; j <= 6; j++)
ind[i][j] = cnt++,
sz[ind[i][j]] = i * j;
for (int i = 1; i <= 6; i++)
for (int j = i; j <= 6; j++) {
int id = gid(i, j);
for (int s = 1; s < i; s++)
mask[id].pb((1 << gid(s, j)) ^ (1 << gid(i - s, j)));
for (int s = 1; s < j; s++)
mask[id].pb((1 << gid(i, s)) ^ (1 << gid(i, j - s)));
sort(mask[id].begin(), mask[id].end());
mask[id].erase(unique(mask[id].begin(), mask[id].end()), mask[id].end());
}
int n, t;
cin >> n >> t;
int need = 2 * t;
int total = 0;
vi cur;
for (int i = 1; i <= n; i++) {
char x[10];
scanf("%s", x);
int a = x[0] - '0', b = x[2] - '0';
total += a * b;
int nid = gid(a, b);
cur.pb(nid);
}
int waste = total - need;
sort(cur.begin(), cur.end());
dp[0] = 0;
for (int i = 1; i < (1 << 21); i++)
dp[i] = 1e9;
for (auto v : cur) {
//memcpy(ndp, dp, sizeof(dp));
fill(ndp, ndp + (1 << 21), 1e9);
for (int j = 0; j < (1 << 21); j++) {
for (auto h : mask[v])
chkmin(ndp[j ^ h], dp[j] + 1);
chkmin(ndp[j ^ (1 << v)], dp[j]);
if (i & (1 << j)) was += sz[j];
if (was <= waste) {
//if (!dp[i]) cout << "??? " << i << endl;
chkmin(ans, dp[i]);
}
}
cout << ans << endl;
return 0;
}*/
詳細信息
Test #1:
score: 100
Accepted
time: 390ms
memory: 20276kb
input:
16 118 5x6 3x5 4x5 6x3 6x1 1x1 4x5 4x5 2x3 1x2 5x3 5x3 6x2 3x6 5x6 4x2
output:
4
result:
ok single line: '4'
Test #2:
score: 0
Accepted
time: 288ms
memory: 20316kb
input:
6 30 2x3 3x3 1x5 2x5 3x5 3x5
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 247ms
memory: 20096kb
input:
3 2 1x1 1x1 1x2
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 269ms
memory: 19976kb
input:
4 25 2x3 3x3 2x5 5x5
output:
2
result:
ok single line: '2'
Test #5:
score: 0
Accepted
time: 254ms
memory: 20096kb
input:
5 10 1x1 1x1 1x1 1x1 4x4
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 272ms
memory: 20032kb
input:
6 34 1x1 1x2 2x3 3x3 5x5 5x5
output:
2
result:
ok single line: '2'
Test #7:
score: 0
Accepted
time: 345ms
memory: 20044kb
input:
15 70 1x1 1x2 1x3 1x4 1x5 2x2 2x3 2x4 2x5 3x3 3x4 3x5 4x4 4x5 5x5
output:
7
result:
ok single line: '7'
Test #8:
score: 0
Accepted
time: 306ms
memory: 20312kb
input:
11 40 1x1 1x2 1x3 2x3 2x4 4x5 2x2 2x2 1x4 2x4 4x5
output:
3
result:
ok single line: '3'
Test #9:
score: 0
Accepted
time: 369ms
memory: 19980kb
input:
20 74 4x3 5x1 4x2 3x3 1x2 2x1 4x2 1x5 1x1 1x4 1x1 5x5 1x4 4x5 3x2 3x5 1x2 3x4 1x1 2x3
output:
6
result:
ok single line: '6'
Test #10:
score: 0
Accepted
time: 383ms
memory: 20312kb
input:
20 104 4x2 2x3 4x5 5x1 1x3 4x3 1x2 1x1 5x2 5x4 5x5 4x1 5x5 3x5 4x2 3x1 3x1 5x4 2x1 4x4
output:
6
result:
ok single line: '6'
Test #11:
score: 0
Accepted
time: 321ms
memory: 20044kb
input:
13 44 5x4 3x2 3x2 4x1 4x4 1x2 1x5 1x2 1x1 3x5 1x2 1x3 3x2
output:
5
result:
ok single line: '5'
Test #12:
score: 0
Accepted
time: 269ms
memory: 20028kb
input:
5 21 1x3 1x2 5x4 4x4 1x1
output:
3
result:
ok single line: '3'
Test #13:
score: 0
Accepted
time: 360ms
memory: 20044kb
input:
18 77 5x4 4x2 5x5 1x4 3x1 4x3 2x3 1x1 3x4 5x2 5x3 2x2 2x1 2x1 1x2 5x3 3x3 1x4
output:
6
result:
ok single line: '6'
Test #14:
score: 0
Accepted
time: 305ms
memory: 20032kb
input:
9 30 5x2 5x3 1x4 1x4 2x3 1x2 3x3 2x3 4x1
output:
5
result:
ok single line: '5'
Test #15:
score: 0
Accepted
time: 293ms
memory: 20328kb
input:
8 37 2x4 1x3 5x4 5x5 2x4 1x4 1x2 1x4
output:
2
result:
ok single line: '2'
Test #16:
score: 0
Accepted
time: 379ms
memory: 20092kb
input:
19 103 1x5 5x2 2x2 5x4 1x5 1x1 5x5 2x2 2x5 5x4 3x4 3x2 4x4 5x4 5x3 2x2 2x4 4x3 3x3
output:
7
result:
ok single line: '7'
Test #17:
score: 0
Accepted
time: 367ms
memory: 20324kb
input:
19 75 2x1 1x1 5x5 2x4 1x3 2x3 2x2 2x3 4x5 4x3 3x1 4x1 4x2 4x4 5x1 1x4 1x5 5x3 3x1
output:
7
result:
ok single line: '7'
Test #18:
score: 0
Accepted
time: 385ms
memory: 19988kb
input:
20 81 2x3 2x5 5x3 2x1 3x1 5x2 4x5 2x1 1x5 5x2 2x5 1x5 3x2 1x5 1x2 4x2 4x2 5x4 3x2 3x3
output:
2
result:
ok single line: '2'
Test #19:
score: 0
Accepted
time: 602ms
memory: 20056kb
input:
47 297 3x5 3x2 1x5 5x6 5x5 5x5 4x2 5x4 4x1 6x2 6x6 5x3 1x2 2x6 6x2 3x3 2x2 2x2 1x4 2x5 5x3 4x4 6x3 3x6 5x4 3x6 3x1 6x1 3x1 1x2 3x4 1x6 6x6 5x3 1x1 5x5 2x1 1x4 5x1 5x6 2x1 4x6 2x2 6x6 2x3 6x1 3x1
output:
9
result:
ok single line: '9'
Test #20:
score: 0
Accepted
time: 510ms
memory: 20244kb
input:
33 197 1x5 2x1 3x6 2x1 5x5 1x4 2x2 2x6 2x4 6x3 2x1 1x3 6x5 6x1 3x2 3x3 4x3 4x6 6x6 6x1 5x2 5x2 1x6 4x4 6x2 2x1 6x5 1x5 2x1 5x6 2x3 3x6 3x5
output:
9
result:
ok single line: '9'
Test #21:
score: 0
Accepted
time: 551ms
memory: 19984kb
input:
29 458 5x6 6x6 6x6 5x6 6x6 5x6 6x6 6x5 6x5 6x6 6x5 6x6 6x5 6x6 6x6 6x6 6x5 5x6 5x5 6x6 6x5 5x5 5x5 6x5 5x6 6x6 6x5 5x5 6x5
output:
1
result:
ok single line: '1'
Test #22:
score: 0
Accepted
time: 465ms
memory: 19984kb
input:
29 142 1x1 5x1 3x5 1x3 5x2 2x4 1x4 1x4 5x5 4x2 1x2 5x1 5x2 2x1 5x3 2x5 4x3 3x2 4x4 2x1 1x4 6x6 1x5 5x4 2x4 3x4 4x4 5x3 1x5
output:
5
result:
ok single line: '5'
Test #23:
score: 0
Accepted
time: 497ms
memory: 20024kb
input:
29 187 6x1 5x4 4x3 6x3 2x3 2x3 1x3 6x2 4x4 5x6 6x4 3x5 5x1 6x5 5x2 5x3 5x6 5x6 1x3 2x5 3x5 2x1 2x5 1x5 1x4 3x1 4x2 2x3 4x5
output:
7
result:
ok single line: '7'
Test #24:
score: 0
Accepted
time: 486ms
memory: 20312kb
input:
30 180 3x6 1x2 2x5 1x1 1x1 6x3 3x3 4x1 2x3 2x6 3x5 3x6 4x1 3x3 6x5 4x2 6x4 5x4 6x6 3x2 4x4 1x5 4x3 4x4 2x4 3x4 2x5 1x6 3x3 5x3
output:
8
result:
ok single line: '8'
Test #25:
score: 0
Accepted
time: 420ms
memory: 20056kb
input:
23 151 3x6 5x3 1x1 2x5 1x5 6x5 4x4 3x4 2x3 3x1 1x1 6x6 2x3 6x6 2x6 2x2 3x3 3x2 6x4 3x4 2x1 4x5 6x3
output:
5
result:
ok single line: '5'
Test #26:
score: 0
Accepted
time: 412ms
memory: 20012kb
input:
21 149 1x4 4x6 5x5 4x6 4x1 5x3 6x2 4x4 3x5 6x3 2x4 3x3 6x6 3x2 1x2 5x3 6x5 6x4 1x1 2x2 6x1
output:
9
result:
ok single line: '9'
Test #27:
score: 0
Accepted
time: 654ms
memory: 20312kb
input:
50 330 4x2 5x4 6x2 4x4 2x3 6x6 5x3 5x6 3x3 5x1 5x2 4x3 1x3 5x4 2x6 1x6 3x6 6x4 6x6 1x6 4x6 1x3 4x5 6x6 1x1 1x1 3x4 3x5 1x1 2x4 1x3 2x1 3x5 1x5 2x4 1x5 6x4 3x6 2x6 1x5 1x6 6x6 1x3 6x1 5x6 6x6 3x2 1x5 6x1 2x2
output:
8
result:
ok single line: '8'
Test #28:
score: 0
Accepted
time: 549ms
memory: 20328kb
input:
39 250 5x6 6x4 1x1 3x1 6x1 5x3 2x6 4x4 6x1 1x4 6x6 4x5 3x6 4x2 5x6 4x3 2x4 5x1 6x3 5x6 3x5 4x5 6x5 2x2 5x1 6x6 3x3 5x3 4x1 6x4 2x2 1x5 2x2 2x1 2x1 1x2 1x3 2x5 4x1
output:
7
result:
ok single line: '7'
Test #29:
score: 0
Accepted
time: 705ms
memory: 20056kb
input:
50 889 5x5 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 5x5 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6
output:
0
result:
ok single line: '0'
Test #30:
score: 0
Accepted
time: 272ms
memory: 20248kb
input:
4 31 2x2 2x5 4x3 6x6
output:
4
result:
ok single line: '4'
Test #31:
score: 0
Accepted
time: 346ms
memory: 19988kb
input:
14 85 1x1 6x5 1x6 4x6 5x6 1x5 5x5 4x3 4x3 1x3 3x3 1x4 2x4 1x1
output:
4
result:
ok single line: '4'
Test #32:
score: 0
Accepted
time: 464ms
memory: 20056kb
input:
27 174 6x2 6x1 3x5 3x3 1x4 5x6 5x4 3x2 3x1 1x6 4x4 6x5 4x1 4x4 3x6 2x4 4x6 6x6 6x6 5x2 4x2 1x6 1x2 1x3 1x2 3x4 1x6
output:
5
result:
ok single line: '5'
Test #33:
score: 0
Accepted
time: 437ms
memory: 20044kb
input:
25 138 4x6 3x4 1x3 4x4 3x1 3x4 5x2 1x1 5x3 1x6 6x4 6x3 2x1 5x2 1x6 1x6 4x2 4x6 6x2 4x6 3x1 5x1 6x2 1x5 3x5
output:
3
result:
ok single line: '3'
Test #34:
score: 0
Accepted
time: 650ms
memory: 20088kb
input:
50 269 2x6 4x3 2x4 2x4 3x1 2x1 5x6 2x6 3x6 6x1 3x3 4x6 1x6 2x5 6x6 1x2 2x3 1x5 5x3 5x6 3x1 2x3 3x4 6x3 4x2 3x2 4x3 3x6 1x2 2x2 2x3 3x4 2x6 1x5 2x4 5x3 6x3 6x4 1x2 1x6 1x5 1x5 1x4 6x5 4x3 3x4 2x5 1x3 3x1 1x3
output:
4
result:
ok single line: '4'
Test #35:
score: 0
Accepted
time: 630ms
memory: 20028kb
input:
46 260 6x5 1x6 2x4 5x1 5x6 4x4 1x4 5x3 2x6 3x2 1x5 1x2 3x2 4x3 5x1 5x1 6x2 1x6 6x2 5x6 2x2 3x1 4x2 4x1 5x6 1x6 6x1 6x4 4x4 6x1 3x4 2x2 3x1 2x6 2x3 2x3 3x1 2x1 5x4 6x5 3x6 6x5 3x4 6x2 2x5 6x1
output:
4
result:
ok single line: '4'
Test #36:
score: 0
Accepted
time: 546ms
memory: 20052kb
input:
41 194 2x1 1x5 3x1 2x1 6x5 1x5 5x3 6x1 5x2 1x5 1x5 6x3 2x1 1x2 3x2 3x6 6x5 5x2 4x5 2x4 6x1 5x1 3x1 2x3 5x3 5x5 1x2 4x2 4x2 2x2 5x3 1x3 5x3 4x6 3x2 4x1 6x3 3x3 4x1 4x1 1x2
output:
5
result:
ok single line: '5'
Test #37:
score: 0
Accepted
time: 576ms
memory: 20324kb
input:
43 242 6x3 3x5 1x2 5x4 2x6 1x6 2x4 1x6 3x2 2x5 2x1 3x1 4x1 3x5 6x3 3x6 6x4 1x2 2x1 2x3 6x3 4x6 5x4 5x3 3x5 1x5 1x3 1x1 4x4 2x2 4x6 1x2 2x2 2x5 3x2 5x6 2x3 6x3 5x5 1x4 6x5 2x2 1x3
output:
5
result:
ok single line: '5'
Test #38:
score: 0
Accepted
time: 279ms
memory: 20048kb
input:
5 29 1x5 2x5 3x3 2x3 6x5
output:
3
result:
ok single line: '3'
Test #39:
score: 0
Accepted
time: 638ms
memory: 20044kb
input:
49 230 3x3 4x3 4x6 3x6 4x6 2x3 5x6 1x3 6x6 5x1 1x2 6x6 1x1 1x4 6x6 3x3 2x3 1x2 4x4 5x2 6x3 5x5 1x4 1x4 1x1 6x3 4x6 5x1 6x5 5x6 1x6 1x6 1x3 3x3 2x1 6x1 4x5 4x2 6x6 3x1 4x5 2x2 3x4 4x5 3x2 6x1 2x3 6x6 3x6
output:
0
result:
ok single line: '0'
Test #40:
score: 0
Accepted
time: 632ms
memory: 20060kb
input:
45 304 2x4 2x5 6x6 1x5 3x3 2x5 1x6 4x1 5x5 2x2 5x3 5x1 6x6 5x4 6x5 6x5 1x5 2x3 6x4 4x3 1x2 6x1 1x5 6x2 1x5 5x2 4x3 6x1 4x5 2x5 6x4 2x6 5x5 6x5 3x1 5x6 3x3 3x2 4x4 6x3 6x4 1x6 3x3 4x6 1x6
output:
4
result:
ok single line: '4'
Test #41:
score: 0
Accepted
time: 633ms
memory: 20048kb
input:
44 278 2x3 6x2 6x6 6x1 3x3 3x5 1x6 3x3 1x4 5x2 3x3 3x4 2x5 6x3 2x5 2x6 5x1 6x2 5x6 5x6 4x2 6x1 1x6 1x2 1x1 1x1 4x6 4x3 4x3 6x3 2x1 1x6 5x3 4x3 6x4 5x6 4x1 5x6 4x4 3x4 6x6 4x1 5x2 5x6
output:
4
result:
ok single line: '4'
Test #42:
score: 0
Accepted
time: 645ms
memory: 20320kb
input:
48 261 4x4 1x2 2x4 6x3 3x3 6x5 5x1 5x3 1x3 5x6 1x5 4x6 6x4 3x5 6x5 5x3 2x5 4x5 3x6 2x5 2x2 2x6 4x2 2x6 2x6 6x5 6x4 5x1 3x3 4x2 2x6 6x2 4x4 4x4 3x3 4x1 1x5 1x5 4x1 1x4 4x2 2x2 1x3 5x3 3x4 2x4 5x4 3x5
output:
1
result:
ok single line: '1'
Test #43:
score: 0
Accepted
time: 581ms
memory: 20312kb
input:
40 260 3x5 5x6 1x5 6x4 2x2 1x2 5x1 3x5 2x4 1x6 3x6 6x5 4x2 6x5 4x5 1x5 5x3 6x4 4x5 2x2 4x1 2x4 2x4 6x1 5x6 6x6 6x3 6x6 6x1 4x2 5x5 3x2 3x3 4x6 2x2 4x2 6x4 4x3 4x2 3x1
output:
2
result:
ok single line: '2'
Test #44:
score: 0
Accepted
time: 240ms
memory: 20316kb
input:
1 1 1x3
output:
2
result:
ok single line: '2'
Test #45:
score: 0
Accepted
time: 675ms
memory: 20312kb
input:
49 324 4x3 1x6 1x5 1x5 5x4 4x5 6x5 1x2 5x6 4x1 2x2 4x6 6x5 5x5 4x2 5x2 4x6 1x5 5x3 1x6 5x1 3x5 5x1 6x4 6x3 2x3 1x2 4x6 5x5 1x5 1x6 2x4 6x1 3x3 4x4 3x4 5x4 6x1 5x6 4x6 6x1 4x2 1x6 3x5 5x1 1x2 2x4 6x6 3x4
output:
8
result:
ok single line: '8'
Test #46:
score: 0
Accepted
time: 561ms
memory: 20024kb
input:
40 222 1x3 4x1 3x3 1x3 4x5 3x2 1x3 2x2 3x6 5x2 2x3 1x3 2x1 6x3 1x4 5x4 2x5 4x2 1x4 1x2 5x4 1x4 6x4 5x2 6x6 4x4 1x1 6x1 5x3 4x2 6x5 6x3 3x5 4x5 1x5 3x4 6x2 5x4 3x5 4x3
output:
6
result:
ok single line: '6'
Test #47:
score: 0
Accepted
time: 592ms
memory: 20056kb
input:
43 229 2x4 5x1 5x2 1x4 4x4 6x3 3x1 6x4 3x1 5x1 4x4 3x1 2x5 5x3 2x3 4x4 6x4 3x1 4x6 3x4 1x2 4x5 2x3 3x5 4x1 2x3 3x3 1x3 1x6 2x6 1x6 2x3 5x5 5x2 6x6 5x1 4x3 2x5 4x1 1x5 5x6 6x1 5x3
output:
5
result:
ok single line: '5'
Test #48:
score: 0
Accepted
time: 613ms
memory: 20092kb
input:
46 295 6x1 2x6 4x3 3x5 4x2 4x4 1x5 6x1 5x6 3x5 5x6 5x5 4x5 4x2 5x2 3x2 5x1 1x1 5x1 5x4 5x1 6x5 4x1 6x6 5x5 1x6 3x3 3x5 1x3 2x2 5x6 3x2 5x1 4x1 3x3 6x6 3x5 6x4 2x1 3x1 5x1 2x2 3x1 2x6 5x5 3x5
output:
6
result:
ok single line: '6'
Test #49:
score: 0
Accepted
time: 642ms
memory: 20044kb
input:
50 318 3x2 6x5 6x2 4x5 3x3 1x2 6x4 4x4 2x1 1x5 1x6 5x4 4x3 3x6 2x4 5x5 4x4 6x6 2x1 3x4 1x5 3x6 6x1 4x1 1x1 6x2 4x6 5x5 2x3 2x1 4x6 2x1 4x2 3x3 4x4 6x6 1x2 2x4 4x3 4x1 3x5 6x2 4x2 5x6 2x4 3x3 2x1 1x2 3x5 5x6
output:
6
result:
ok single line: '6'
Test #50:
score: 0
Accepted
time: 555ms
memory: 20024kb
input:
30 294 5x5 5x5 2x6 4x4 2x6 2x5 6x5 6x5 6x5 6x3 5x4 6x5 4x4 6x2 4x6 6x5 5x6 6x4 2x6 4x4 5x6 5x6 4x6 6x6 6x6 1x5 4x6 3x5 6x6 4x4
output:
1
result:
ok single line: '1'
Test #51:
score: 0
Accepted
time: 602ms
memory: 20052kb
input:
37 305 3x3 4x2 3x6 3x6 4x4 4x5 5x3 3x6 6x5 3x6 4x5 6x1 3x5 4x6 4x4 4x2 4x6 3x5 6x4 4x4 6x6 6x6 6x4 4x4 2x6 5x5 5x4 6x5 4x5 3x5 6x2 5x5 6x4 5x4 6x1 3x6 3x6
output:
0
result:
ok single line: '0'
Test #52:
score: 0
Accepted
time: 736ms
memory: 20048kb
input:
50 459 4x6 1x6 2x6 3x4 4x1 4x5 6x4 4x6 4x6 2x6 4x5 3x4 2x4 6x6 5x5 5x6 6x3 2x6 5x4 2x6 5x3 4x6 6x5 4x6 5x3 2x5 6x4 6x2 5x2 6x6 6x2 6x6 5x5 1x6 5x1 5x4 5x6 3x6 2x3 5x6 6x1 3x5 5x2 6x5 3x6 5x6 3x3 4x1 6x5 4x6
output:
7
result:
ok single line: '7'
Test #53:
score: 0
Accepted
time: 750ms
memory: 20024kb
input:
50 453 4x6 6x3 6x5 4x3 5x5 6x6 6x5 2x6 3x5 5x5 6x3 4x5 5x5 3x4 4x2 4x5 5x6 4x5 6x5 5x6 5x2 6x6 6x6 6x1 3x4 5x2 5x3 5x6 4x5 6x6 3x6 3x1 6x6 6x5 3x4 5x2 2x6 6x2 6x6 6x4 5x4 6x5 5x4 4x5 5x3 1x6 5x5 6x5 6x5 5x3
output:
0
result:
ok single line: '0'
Test #54:
score: 0
Accepted
time: 759ms
memory: 20088kb
input:
50 452 5x6 6x6 2x5 4x5 5x4 2x5 5x6 5x4 3x5 6x5 2x5 5x6 5x6 6x6 5x3 3x3 5x5 5x6 5x5 3x6 4x6 6x3 5x4 6x6 6x2 1x6 6x3 5x6 4x4 5x2 6x6 5x6 3x5 3x5 2x5 5x5 6x6 3x5 5x5 5x4 6x6 2x1 4x5 6x3 5x6 5x3 5x6 2x4 6x3 5x6
output:
0
result:
ok single line: '0'
Test #55:
score: 0
Accepted
time: 731ms
memory: 20028kb
input:
50 900 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6
output:
0
result:
ok single line: '0'
Test #56:
score: 0
Accepted
time: 729ms
memory: 20048kb
input:
50 894 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 6x6 5x5
output:
3
result:
ok single line: '3'
Test #57:
score: 0
Accepted
time: 687ms
memory: 20096kb
input:
47 399 4x5 6x6 6x1 6x6 6x2 3x4 4x3 6x6 6x4 5x5 6x3 2x4 4x1 5x6 3x5 6x6 6x3 5x4 5x6 2x4 6x4 2x1 3x4 5x5 5x3 3x4 5x5 5x5 6x3 4x6 3x3 6x6 6x6 2x4 5x4 2x6 5x6 2x6 2x1 4x6 1x6 5x6 1x4 6x4 6x4 3x5 6x6
output:
0
result:
ok single line: '0'