QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#392975 | #1197. Draw in Straight Lines | XY_Eleven | AC ✓ | 45ms | 5084kb | C++23 | 5.5kb | 2024-04-18 00:47:11 | 2024-04-18 00:47:11 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize(3)
#define DB double
#define LL long long
#define ULL unsigned long long
#define in128 __int128
#define cint const int
#define cLL const LL
#define For(z,e1,e2) for(int z=(e1);z<=(e2);z++)
#define Rof(z,e1,e2) for(int z=(e2);z>=(e1);z--)
#define For_(z,e1,e2) for(int z=(e1);z<(e2);z++)
#define Rof_(z,e1,e2) for(int z=(e2);z>(e1);z--)
#define inint(e) scanf("%d",&e)
#define inll(e) scanf("%lld",&e)
#define inpr(e1,e2) scanf("%d%d",&e1,&e2)
#define in3(e1,e2,e3) scanf("%d%d%d",&e1,&e2,&e3)
#define outint(e) printf("%d\n",e)
#define outint_(e) printf("%d%c",e," \n"[i==n])
#define outint2_(e,e1,e2) printf("%d%c",e," \n"[(e1)==(e2)])
#define outll(e) printf("%lld\n",e)
#define outll_(e) printf("%lld%c",e," \n"[i==n])
#define outll2_(e,e1,e2) printf("%lld%c",e," \n"[(e1)==(e2)])
#define exc(e) if(e) continue
#define stop(e) if(e) break
#define ret(e) if(e) return
#define ll(e) (1ll*(e))
#define pb push_back
#define ft first
#define sc second
#define clean(e) while(!e.empty()) e.pop()
#define all(ev) ev.begin(),ev.end()
#define sz(ev) ((int)ev.size())
#define debug(x) printf("%s=%d\n",#x,x)
#define x0 __xx00__
#define y1 __yy11__
#define ffo fflush(stdout)
cLL mod=998244353,G=404;
template <typename Type> void get_min(Type &w1,const Type w2) { if(w2<w1) w1=w2; } template <typename Type> void get_max(Type &w1,const Type w2) { if(w2>w1) w1=w2; }
template <typename Type> Type up_div(Type w1,Type w2) { return (w1/w2+(w1%w2?1:0)); }
template <typename Type> Type gcd(Type X_,Type Y_) { Type R_=X_%Y_; while(R_) { X_=Y_; Y_=R_; R_=X_%Y_; } return Y_; } template <typename Type> Type lcm(Type X_,Type Y_) { return (X_/gcd(X_,Y_)*Y_); }
template <typename Type> Type md(Type w1,const Type w2=mod) { w1%=w2; if(w1<0) w1+=w2; return w1; } template <typename Type> Type md_(Type w1,const Type w2=mod) { w1%=w2; if(w1<=0) w1+=w2; return w1; }
void ex_gcd(LL &X_,LL &Y_,LL A_,LL B_) { if(!B_) { X_=1ll; Y_=0ll; return ; } ex_gcd(Y_,X_,B_,A_%B_); X_=md(X_,B_); Y_=(1ll-X_*A_)/B_; } LL inv(LL A_,LL B_=mod) { LL X_=0ll,Y_=0ll; ex_gcd(X_,Y_,A_,B_); return X_; }
template <typename Type> void add(Type &w1,const Type w2,const Type M_=mod) { w1=md(w1+w2,M_); } void mul(LL &w1,cLL w2,cLL M_=mod) { w1=md(w1*md(w2,M_),M_); } template <typename Type> Type pw(Type X_,Type Y_,Type M_=mod) { Type S_=1; while(Y_) { if(Y_&1) mul(S_,X_,M_); Y_>>=1; mul(X_,X_,M_); } return S_; }
template <typename Type> Type bk(vector <Type> &V_) { auto T_=V_.back(); V_.pop_back(); return T_; } template <typename Type> Type tp(stack <Type> &V_) { auto T_=V_.top(); V_.pop(); return T_; } template <typename Type> Type frt(queue <Type> &V_) { auto T_=V_.front(); V_.pop(); return T_; }
template <typename Type> Type bg(set <Type> &V_) { auto T_=*V_.begin(); V_.erase(V_.begin()); return T_; } template <typename Type> Type bk(set <Type> &V_) { auto T_=*prev(V_.end()); V_.erase(*prev(V_.end())); return T_; }
mt19937 gen(time(NULL)); int rd() { return abs((int)gen()); }
cint L=43,N=L*L*4,M=L*L*12;
int n,m;
int d1,d2;
int br[L][L],bc[L][L],wr[L][L],wc[L][L];
char sr[L];
vector <pair<int,int> > v[N];
cint inf=1e9;
int w[M<<1];
void bld(int x,int y,int lw)
{
w[(++m)<<1]=lw;
v[x].pb({y,m<<1});
v[y].pb({x,m<<1|1});
}
int dis[N],now[N];
queue <int> q;
bool bfs()
{
memset(now,0,sizeof(int)*(n+1));
memset(dis,0xff,sizeof(int)*(n+1));
clean(q); q.push(0); dis[0]=0;
while(!q.empty())
{
int p=q.front(); q.pop();
for(auto [i,id]:v[p])
{
exc(!w[id]||~dis[i]);
dis[i]=dis[p]+1;
q.push(i);
}
}
return (~dis[1]);
}
int dfs(int p,int f)
{
if(p==1) return f;
int len=sz(v[p]),s=0;
for(int i_=now[p]++;i_<len&&f;now[p]=(++i_)+1)
{
auto [i,id]=v[p][i_];
exc(!w[id]||dis[i]!=dis[p]+1);
int d=dfs(i,min(f,w[id]));
s+=d,f-=d,w[id]-=d,w[id^1]+=d;
}
return s;
}
int dinic()
{
int ans=0;
while(bfs()) ans+=dfs(0,inf);
return ans;
}
void main_solve()
{
inpr(d1,d2);
int ck,cb,c; in3(ck,cb,c);
n=1,m=0;
For(i,1,d1) For(j,1,d2)
{
bld(0,br[i][j]=++n,ck),bld(bc[i][j]=++n,1,ck);
bld(0,wc[i][j]=++n,ck),bld(wr[i][j]=++n,1,ck);
if(i>1)
{
bld(br[i][j],br[i-1][j],cb);
bld(wr[i-1][j],wr[i][j],cb);
}
if(i==d1)
{
bld(0,br[i][j],cb);
bld(wr[i][j],1,cb);
}
if(j>1)
{
bld(wc[i][j],wc[i][j-1],cb);
bld(bc[i][j-1],bc[i][j],cb);
}
if(j==d2)
{
bld(0,wc[i][j],cb);
bld(bc[i][j],1,cb);
}
}
For(i,1,d1)
{
scanf("%s",sr+1);
For(j,1,d2)
{
if(sr[j]=='#')
{
bld(br[i][j],bc[i][j],c);
bld(0,wc[i][j],inf);
bld(wr[i][j],1,inf);
}
else
{
bld(wc[i][j],br[i][j],c);
bld(bc[i][j],wr[i][j],c);
bld(bc[i][j],br[i][j],inf);
}
}
}
outint(dinic());
}
int main()
{
// ios::sync_with_stdio(0); cin.tie(0);
// freopen("in.txt","r",stdin);
// freopen("out1.txt","w",stdout);
// srand(time(NULL));
// main_init();
// int _; inint(_); For(__,1,_) // T>1 ?
// printf("\n------------\n\n"),
main_solve();
return 0;
}
/*
*/
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3936kb
input:
3 3 1 2 3 .#. ### .#.
output:
10
result:
ok answer is '10'
Test #2:
score: 0
Accepted
time: 0ms
memory: 4228kb
input:
2 7 0 1 1 ###.### ###.###
output:
3
result:
ok answer is '3'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
5 5 1 4 4 ..#.. ..#.. ##.## ..#.. ..#..
output:
24
result:
ok answer is '24'
Test #4:
score: 0
Accepted
time: 1ms
memory: 4024kb
input:
7 24 1 10 10 ###...###..#####....###. .#...#...#.#....#..#...# .#..#......#....#.#..... .#..#......#####..#..... .#..#......#......#..... .#...#...#.#.......#...# ###...###..#........###.
output:
256
result:
ok answer is '256'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3972kb
input:
5 5 0 3 2 ..#.. ..#.. ##.## ..#.. ..#..
output:
11
result:
ok answer is '11'
Test #6:
score: 0
Accepted
time: 1ms
memory: 4732kb
input:
40 40 40 40 40 ######################################## ######################################## ######################################## ######################################## ######################################## ######################################## #######################################...
output:
64000
result:
ok answer is '64000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3984kb
input:
1 1 0 0 0 .
output:
0
result:
ok answer is '0'
Test #8:
score: 0
Accepted
time: 1ms
memory: 4304kb
input:
9 18 18 39 28 ############.####. ...........#.####. ############.##### ##............#### ................#. #######..######.## .................. ##................ #######.#######.#.
output:
1857
result:
ok answer is '1857'
Test #9:
score: 0
Accepted
time: 1ms
memory: 4448kb
input:
18 22 22 36 36 .##################... .###.................. ..######.#...##.#....# ########.##.########## ............#.###....# ............#.###....# .....................# .#######..#.######...# ########..#.#.###....# ...#......#.####.....# ...#.................# ...#........#.#......# ...#........
output:
4180
result:
ok answer is '4180'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3952kb
input:
5 22 24 33 32 ###################### ...####............... ...................... #####################. ......................
output:
1226
result:
ok answer is '1226'
Test #11:
score: 0
Accepted
time: 1ms
memory: 4524kb
input:
24 23 28 16 33 #................#..... ....................... #...................... ....................... #.....#..........#..... .....................#. .......#............... #...................... ..#.........#.......... .................###... ......................# .............#..........
output:
1151
result:
ok answer is '1151'
Test #12:
score: 0
Accepted
time: 2ms
memory: 4496kb
input:
32 32 13 33 21 ....####...##...#............... .............................#.. .....#.##.#.###.........###..#.# ....................#........#.. ....................#........... ...###.#..#.###.##..#........... ..#.#..#..#.#.......#........##. ..............................#. ........................
output:
4165
result:
ok answer is '4165'
Test #13:
score: 0
Accepted
time: 1ms
memory: 4084kb
input:
4 39 0 36 15 ......####...................#########. ....################################... .###############.###############....... .......................................
output:
159
result:
ok answer is '159'
Test #14:
score: 0
Accepted
time: 1ms
memory: 4096kb
input:
19 14 0 27 11 .............# .#.#####.##### .........##### .#....#......# .#....#......# .#............ .#....#....#.# .#....#....#.# .............. ##.#####.##### ......#...##.# ......#...##.# ......#...##.# ......#...##.# ......#...##.# ......#...##.# ......#...##.# ...........#.# ##############
output:
336
result:
ok answer is '336'
Test #15:
score: 0
Accepted
time: 2ms
memory: 4104kb
input:
25 11 2 21 22 .###.##.#.. ..##....#.# #.#####...# #.#####...# ..###.#...# #.....#...# #.###.#...# #.#####...# ........... #.#####...# #.#.###...# #.#.###...# #.#.###...# #.#.###...# #.#.###...# #.#.##....# #.#.##....# ###.###...# ###.###...# #.........# #.#.###..## ........... .##..##.##. #...###.##...
output:
886
result:
ok answer is '886'
Test #16:
score: 0
Accepted
time: 3ms
memory: 4832kb
input:
40 40 7 23 21 ........................................ ......................#.........#....... ........................................ .....#.....#.......#..#.#..#....##...... ..................#..................... .#.#.#...###.............##.....#....... ...#.................................#.....
output:
2709
result:
ok answer is '2709'
Test #17:
score: 0
Accepted
time: 16ms
memory: 4836kb
input:
40 40 5 30 35 ......#................................. ...##.##.###.###.###.####.##.####.#...#. ......#.#....#..#.#....#.#....#...#...#. ####.#..###.###.#..#.####.#.#.#..#....#. .......#..#....####..#....#...#...#..... #.....###....#.#.#..#..#.##...#..##...#. #....##...............................#....
output:
11420
result:
ok answer is '11420'
Test #18:
score: 0
Accepted
time: 1ms
memory: 3984kb
input:
9 6 0 4 1 #..... #....# #....# #.#### #..#.# #....# .#...# .#...# .#...#
output:
15
result:
ok answer is '15'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
2 26 6 23 28 ##...#..................## .....................#####
output:
151
result:
ok answer is '151'
Test #20:
score: 0
Accepted
time: 1ms
memory: 4340kb
input:
23 11 3 28 6 ####..##### ##.#..##### #..#..##### #..#..##### #..#..##### #..#.....## #..#..#.### #..#....### #..#....### #..#....### #.......... #..#....### #.......... #..#......# #..#..#.### #.....#.### #.#...#.### #.....#.### #.....#.### #.....#.### #.....#.### #.##..#.### ####.##.###
output:
691
result:
ok answer is '691'
Test #21:
score: 0
Accepted
time: 3ms
memory: 4248kb
input:
20 32 0 6 3 ###............................. ................................ .####.##......#.#........#..#... ..............................## .#.............................. ................................ .................##..#.#..###.#. .#.##..........................# .......#......#.#..........
output:
219
result:
ok answer is '219'
Test #22:
score: 0
Accepted
time: 1ms
memory: 4020kb
input:
6 24 5 32 28 #......................# #####....##.##########.# .......................# ......................#. #####..######.####....#. ######################..
output:
611
result:
ok answer is '611'
Test #23:
score: 0
Accepted
time: 0ms
memory: 4684kb
input:
38 35 37 17 39 ..........................#........ ..........................#........ ..........................#........ ..........................#........ ........#.........#.......#........ ........#.........#.......#........ .#......#.........#.......#........ .#......#.........#.......#.........
output:
8402
result:
ok answer is '8402'
Test #24:
score: 0
Accepted
time: 2ms
memory: 4104kb
input:
15 25 4 24 21 ######..##############.## .#....................... ######..##############.## .#.#..........########... .#.#....#####..#######.#. .#.###..#.###..#######.## .#.#....#.###..#######.## .#.###..#.##..#....###... .#.###.##..........###... .#.#......###.##....##... .#.#..........#.....##... ...
output:
1601
result:
ok answer is '1601'
Test #25:
score: 0
Accepted
time: 2ms
memory: 4960kb
input:
39 33 2 32 11 ................................. ................................. ................................. ...#............................. ...#............................. ...#............................. ...#.....................#....... ...#.....................#...#... ...#....######...
output:
481
result:
ok answer is '481'
Test #26:
score: 0
Accepted
time: 2ms
memory: 4756kb
input:
40 40 8 23 29 ........................................ ........................................ ........................................ .....#.................................. ........................................ ........................................ ...........................................
output:
784
result:
ok answer is '784'
Test #27:
score: 0
Accepted
time: 3ms
memory: 4804kb
input:
40 40 27 28 37 ......................................#. ........................................ .........#............#.....#.........#. .........#............#....##.#.......#. ...........................#.........##. ...................##..#...#..#......##. ....#.....#...........#...##.##..#........
output:
10864
result:
ok answer is '10864'
Test #28:
score: 0
Accepted
time: 7ms
memory: 4740kb
input:
31 29 1 14 13 ######.###..............#.##. ..........#.................. ..........#.#................ ..........#.#................ ............................. ..........#.#.......###...... ..#.......#.#.......###...... ............................. ..##...............####...... ...#......###......
output:
760
result:
ok answer is '760'
Test #29:
score: 0
Accepted
time: 0ms
memory: 4468kb
input:
39 12 8 22 13 ##..#.#.#.## ##.#....#.## ##.##..##### ##.##..##### ##.###.##### ...........# ##.###.##### ##.###.##### ##.##..##### ##.##..##### ##.##..##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ##.###.##### ...
output:
3454
result:
ok answer is '3454'
Test #30:
score: 0
Accepted
time: 1ms
memory: 4072kb
input:
14 13 6 36 32 ############# ##......###.# #####.#.###.# ###.....###.# #######.###.# ####.##.###.# ........###.# ####.##.###.# ####.##.###.# ............. ####.##.###.# ####.##.###.# ####.######.# ####.####.#.#
output:
1540
result:
ok answer is '1540'
Test #31:
score: 0
Accepted
time: 2ms
memory: 4152kb
input:
15 27 0 18 16 ........................... ..#.###...####............. ...........#............... .......##.........#..#.#.#. #.###..##..###.....#.....#. ........#..#.#..##...#.#... ###.........##..##.#..###.. .........#...............#. ..##....###......#..#...... #..........#.............#. .........
output:
1008
result:
ok answer is '1008'
Test #32:
score: 0
Accepted
time: 3ms
memory: 4144kb
input:
14 25 1 34 29 .##...##....#............ .#....................... .#...#.#................. .#....#.................. .#....#.................. .#....................... .#..##.#................. ......................... ......................... .#...#.###.###.####...... ......................... ...
output:
440
result:
ok answer is '440'
Test #33:
score: 0
Accepted
time: 1ms
memory: 4312kb
input:
22 6 1 6 2 ..##.# #..#.# #..#.# ...#.# ...#.# ...#.# ...#.# .....# .....# .....# .....# .....# .....# .....# .....# .....# ...... .....# .....# .....# ..#..# ..#.##
output:
55
result:
ok answer is '55'
Test #34:
score: 0
Accepted
time: 4ms
memory: 4292kb
input:
27 24 0 30 16 ....################.... ...#############...#.... ...####.#.#........#.... ..##.##.######.....#.... ..##.##.########.#.#..## ..##.##........#...#..## ..##.##.#.##...#.....### .###.##.#.##.........### .##..##.###.####.#...### .##..##.###..........### ###.###########......### ###..##.###...
output:
1114
result:
ok answer is '1114'
Test #35:
score: 0
Accepted
time: 11ms
memory: 4900kb
input:
37 39 12 39 40 ............#.............#...#.#.#.... ...###################################. ..############.#######################. .#........#.#..#....#.###.#...#.######. ....................................... .....#.#..#.#..#.#..#.###.#...#.####### .#############.######################## ...##...
output:
14907
result:
ok answer is '14907'
Test #36:
score: 0
Accepted
time: 7ms
memory: 5064kb
input:
40 40 6 36 20 ......................#........#........ ...........#.#........#...............#. ....####.###..####..........##.#.##...#. ....#......#.#.#......#.#......#......#. .#.##......#.#.#......#.#......#........ .#.##.##...#######.##.#.#..#...#..#...#. .#.##......................................
output:
5274
result:
ok answer is '5274'
Test #37:
score: 0
Accepted
time: 5ms
memory: 4832kb
input:
40 40 1 12 12 ........................................ ..........#............................. .........#.........##.....#............. ........................................ ..........................#............. ..........................#............. ....................#......................
output:
782
result:
ok answer is '782'
Test #38:
score: 0
Accepted
time: 1ms
memory: 4248kb
input:
24 23 0 30 3 ....................... ....................... ........###.###.##..... ....................... ....................... ....................... ....................... ....................... ..................#.... ..................#.... ..................#.... ..................#.......
output:
75
result:
ok answer is '75'
Test #39:
score: 0
Accepted
time: 5ms
memory: 4556kb
input:
26 25 4 30 19 ........................# ..#######..#..#..#....... #####.................... #........................ ..###.###..##.#####.#.... ......................... #####.###..##..####.#..#. #........................ #...................##.#. #.#.#.###..#.#.####..#... #........................ ...
output:
2612
result:
ok answer is '2612'
Test #40:
score: 0
Accepted
time: 0ms
memory: 4400kb
input:
32 28 2 12 7 ............................ ............................ ............................ ............................ ............................ ............................ ............................ ............................ ............................ .............................
output:
252
result:
ok answer is '252'
Test #41:
score: 0
Accepted
time: 7ms
memory: 4728kb
input:
38 38 5 40 31 ...........#......#......#....#....... ..........#..........................# .#.................................... .#...#......#..#...##................. ..#......#.###....#.#.....##....#....# ...#.#.#.............#....#...##...... ..#..........#........#.#..........#.. ....#.......#...
output:
8164
result:
ok answer is '8164'
Test #42:
score: 0
Accepted
time: 1ms
memory: 4144kb
input:
40 9 0 9 6 ........# ......... #.......# #........ ......... .......#. .......#. ......... #........ .......#. ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ......... ............
output:
63
result:
ok answer is '63'
Test #43:
score: 0
Accepted
time: 2ms
memory: 4236kb
input:
13 35 6 20 23 ####......................######### ##.##........................#####. ##.####.################.########## ##.###...........................#. #.....#.################.......#.#. ##.####.################.#########. #........................#########. #..####.################.#########...
output:
2259
result:
ok answer is '2259'
Test #44:
score: 0
Accepted
time: 2ms
memory: 4692kb
input:
32 24 2 23 18 ........................ ........................ ........................ ........................ ........................ ........................ ........................ ........#............... ........#............... ........#............... ........#............... ........#.....
output:
189
result:
ok answer is '189'
Test #45:
score: 0
Accepted
time: 9ms
memory: 4368kb
input:
22 36 1 34 19 .................................... #..#.#.###.######################### #......###.###################...... #............####................... #..#.#.###.###########.####......... #..#...............###.###########.. #........#.##########.......####.... ..............................
output:
1392
result:
ok answer is '1392'
Test #46:
score: 0
Accepted
time: 7ms
memory: 4812kb
input:
40 40 3 11 11 ...........................#.#.##.#.#... ..##.##.................##.###..#####... ..##..########.#######..##.###..#.####.. ...#...##.#.##.#######..##.###..######.. ..................................###... ..........#..#...#...#.....###..#.####.. ..##..#.######.#######..##.###..######.#...
output:
3036
result:
ok answer is '3036'
Test #47:
score: 0
Accepted
time: 5ms
memory: 5056kb
input:
40 40 11 38 25 ....#..###.#..#.####.##.....#....#.#.... ..#...........#..........#...#...####.#. ......###.##....#.#.....#...###......... ..##....#.#.....#......#..#............. ..............##.#.#......#.##.###.##... ......#........#.......#................ ...#..##..###.#.##..#..#..#...............
output:
9278
result:
ok answer is '9278'
Test #48:
score: 0
Accepted
time: 9ms
memory: 4372kb
input:
33 25 2 36 13 ############.#########... #.###..####..##.######.#. ############.############ #.###..#####.###########. #.###.###.##.###########. #########.##.#########.#. #.#######.##.#########.#. #########.#..###########. #########.#..###########. #########.#..#########.#. #########.#..############ ...
output:
2873
result:
ok answer is '2873'
Test #49:
score: 0
Accepted
time: 1ms
memory: 4076kb
input:
13 12 2 27 24 #........... #.##..##.##. #.##..##.### #..#..#..##. ##.#..##.##. ####.....##. #####....##. #####.##.##. #####.##.##. #####.##.### #####.##.##. ...........# .#.##....#..
output:
631
result:
ok answer is '631'
Test #50:
score: 0
Accepted
time: 1ms
memory: 4468kb
input:
39 11 0 4 2 ..#........ ..#........ ..#.#..#... ..#.#..#... ..#.#..#... ..#.#..#... ..#.#..#... ..#.#..#... ..#.#..#... ....#..#... ....#..#... ....#..#... ....#..#... ....#..#... ....#..#... ....#..###. ....#..#... ....#..#... ..#.#..#... ..#.#..#... ..#.#..#... ..#.#..#... ..#.#..#... ........... ...
output:
30
result:
ok answer is '30'
Test #51:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
38 2 5 20 11 #. .# #. .# ## .# .. .# .# .# .# .# .# .. .# .# .# .. .. .# .. .# .# .# .# .# .# .# .# .# .. .# .# .. .. .. .# .#
output:
276
result:
ok answer is '276'
Test #52:
score: 0
Accepted
time: 2ms
memory: 4492kb
input:
19 25 3 40 17 ...#...#..#....#####..... ..#..#....#...#.#........ ....#..##.##..#.##.#....# ...#.#....#...#.##.#....# ....#...#..##...#..#....# ..#..##.......#.#..##.... #....#.##.#.#.#....#.##.. ...#.#.#.##......###..... ...#.......##.........#.. ....#..##..#.###.#.##.#.. ..#####.....#...#..#.##.# ...
output:
2262
result:
ok answer is '2262'
Test #53:
score: 0
Accepted
time: 0ms
memory: 4180kb
input:
38 15 2 16 16 .......#.#.#..# ##.#######.#..# #..#######.#..# #....#####.#..# #........#.#.## #....#####.#.## #....#####.#.## #..#.#####.#.## #..#######.#.## #..#.#####.#.## #..#######.#### #..#######.#.## ##.#######.#.## ##.#######.#.## ##.#######.#.## ##..######.#.## ##..######.#.## ##..######.#.#...
output:
1222
result:
ok answer is '1222'
Test #54:
score: 0
Accepted
time: 15ms
memory: 4548kb
input:
35 30 4 40 13 ....########.##############.#. ####.#######.################. ...#..###.##.##.##..#....#..#. ####.###.###.##.##########.##. ...#..##.###.##.###.#....#.##. ####.###.###.##.#####.####.### ..##.###.###.##.###.#....#.##. ..##.###.###.##.#######..#.##. .#............................ ..##.##...
output:
5123
result:
ok answer is '5123'
Test #55:
score: 0
Accepted
time: 2ms
memory: 4292kb
input:
30 24 13 37 17 ..##########.##########. #####....#.#..#..##.###. ############.##########. ############.##.###.###. ############.########### ############.##.###.#### #.##########.##.###.#### ############.########### #.###..#.###.##########. ############.######.###. #.##.#######.##########. ####.###.#...
output:
8691
result:
ok answer is '8691'
Test #56:
score: 0
Accepted
time: 27ms
memory: 4836kb
input:
40 40 1 39 26 ........................................ ........................................ ..................#..................... ........................................ .......#................#............... ..#######..###.##.#.##.##.#...####...... ...........................................
output:
1955
result:
ok answer is '1955'
Test #57:
score: 0
Accepted
time: 17ms
memory: 4760kb
input:
40 40 7 31 26 .######.##.#####.#.###.###########...... ................#..#.#...#.....#..#..... ....##.##############.##..#####.##.##### ...#.####.##...##..#.....#.....#..#..... ....#...#.##.......#.#...#.#..###.#..... ########..############.#.#.#.####....#.. ##..#.##...#.#.##.##.#...#.#.####....#.....
output:
13479
result:
ok answer is '13479'
Test #58:
score: 0
Accepted
time: 3ms
memory: 4816kb
input:
32 32 6 28 26 .........#................#..... .........#...#...........##...#. .........................##...#. ................................ ................................ .........#...............#....#. .........##..............#....#. .........##..#................#. ..........#..............
output:
2268
result:
ok answer is '2268'
Test #59:
score: 0
Accepted
time: 7ms
memory: 4548kb
input:
39 31 7 28 28 ....#..........#..###..#..#...# .##########################...# ###.#..#####################..# ###.#..##################.#...# ############################### ###.#.#..#.######.###..#.##...# ###.#.#..#.#################..# ###.#.#..####################.# #############################....
output:
8575
result:
ok answer is '8575'
Test #60:
score: 0
Accepted
time: 2ms
memory: 4360kb
input:
19 11 2 39 23 .####.####. .#..#..##.. .#..#..##.. ........... ........... ........... .#.....##.. .#..#..##.. ........... .#.##..##.. ........... .#.##..##.. .......##.. ##.##..##.. ##.##...... ........... .#.##..##.. ........... #####.###..
output:
907
result:
ok answer is '907'
Test #61:
score: 0
Accepted
time: 1ms
memory: 3964kb
input:
7 16 3 35 8 .##...########## ..#..##.######## ...............# ##.###.#........ #####..#.......# #..#######.##### #............###
output:
398
result:
ok answer is '398'
Test #62:
score: 0
Accepted
time: 1ms
memory: 4156kb
input:
24 15 0 31 29 ............... ...........#... ............... ...........#... ............... ..........#.... ...........#... ..........#.... #....###..##... ............... ...........#... ..#............ ..#.......##... ...........#... ............... ............... ..#.......##... ..........##.....
output:
476
result:
ok answer is '476'
Test #63:
score: 0
Accepted
time: 7ms
memory: 4400kb
input:
40 24 1 24 24 ..#........#.......#.... ..#......#.#.......#.... ######...#.#.......#.... ####.....#.#.#.....#.... #.#......#.#.##....#.... #.#......#.#.##....#.... #.#......#.#.##....#.... #.#......#.#.##....#.... #.#......#.#.##....#.... #.#......#.#.##....#.... #.#......#.#.##....#.... #.#########...
output:
979
result:
ok answer is '979'
Test #64:
score: 0
Accepted
time: 2ms
memory: 4236kb
input:
34 18 3 11 9 #.###......####### #.##......##...### #.#..#.#.###...### #.#....#.###.#.##. ................#. ###............##. ###....#..##.#.##. ###....#..##.#.##. ###.......##.#.##. ###.......##.#.#.. ###............#.. ###.......###..#.. ###.........#..#.. ###.......###..#.. ###.......###..#.. ##...
output:
1020
result:
ok answer is '1020'
Test #65:
score: 0
Accepted
time: 9ms
memory: 4580kb
input:
35 35 3 39 20 ..############.####................ ..#................................ ..#......#####...................#. ..#................#............... ..#...............##............... ..#...............#................ ..#...............#................ ..#..#.#.#####.####.#.#########......
output:
2074
result:
ok answer is '2074'
Test #66:
score: 0
Accepted
time: 5ms
memory: 4816kb
input:
40 40 0 3 2 ........................................ ........................................ ........................................ ........................................ ........................................ .......#......##.................##..... ...........#......###.#................. ....
output:
53
result:
ok answer is '53'
Test #67:
score: 0
Accepted
time: 37ms
memory: 5052kb
input:
40 40 1 37 27 ........................................ .#.#############....#..................# ....##.#######.#.#.###.################# ......#######..#.#.#.##########....#...# ......................########.######### .................................#.#...# .................................#.#.#.#...
output:
3881
result:
ok answer is '3881'
Test #68:
score: 0
Accepted
time: 3ms
memory: 4232kb
input:
40 13 1 32 13 .....##...#.. .#...###..#.. ............. .#........... ##.#.###..#.. ##.#.###..##. ##.#.###..##. ##.#.###..##. ##.#.###..### ##.#.##...... ##.#.##...##. ##.#.##...##. ##.#.##...##. ##.#.##...##. ##.#.##...##. ####.##...##. ##.#.##...##. ##........##. ##.#.##...##. ##.#.##...##. ##.#.#...
output:
801
result:
ok answer is '801'
Test #69:
score: 0
Accepted
time: 3ms
memory: 4368kb
input:
36 19 5 33 25 ..#......###....... #####.#########.##. .##....#.###..#.... ###....#.###.##..#. ###....#.######..#. ###....########..#. ###.#.#########.##. ###....########..#. ###....####.###..#. ###.#.#####.###.##. ###...###.#.###..#. ###...###.#.###..#. #.#...###.#.###..#. #.#...###.#.###..#. #.#......
output:
3092
result:
ok answer is '3092'
Test #70:
score: 0
Accepted
time: 4ms
memory: 4408kb
input:
13 25 1 24 19 ...############.######### #..############.####.#### ##.#.##########.####.#### ................####.#### ##.#.########............ ##.....................## ##.#.#########..####.#### #..........##.....#..#... ##.#.####............###. ##.#.##..........######## ......................... ...
output:
767
result:
ok answer is '767'
Test #71:
score: 0
Accepted
time: 3ms
memory: 4324kb
input:
19 40 0 11 8 .###............................###.#.## ...##.............................#####. ........#............................... ......#####..##.#....................... ......#.#......#.#.##.###...#..####.##.. ........................................ .......#.#..###..##...............#.#### ...
output:
510
result:
ok answer is '510'
Test #72:
score: 0
Accepted
time: 2ms
memory: 4076kb
input:
33 10 1 13 10 .......... #....#.... #....##..# ##.......# #..#.##... #....##... ##....#..# .......... #.....#..# .#....#... ...#...... .#........ .#........ ...#..#... .#........ .#.##.#... .#.##..... ...#...... .#........ .......... .#..#..... .#..#..... .#........ .#.##..... .#..#..... .####..... ...
output:
485
result:
ok answer is '485'
Test #73:
score: 0
Accepted
time: 1ms
memory: 4424kb
input:
19 22 0 25 13 ...................... ...#....############## ...#...............#.. ...#...............##. ...##..............##. ...#...............##. .#.#...............##. .#.#...............##. .#.#...............##. .#.####..##.####.####. .###...............### .###...............##. .###.........
output:
327
result:
ok answer is '327'
Test #74:
score: 0
Accepted
time: 4ms
memory: 4432kb
input:
37 24 0 28 21 ................#....... ..........#####.#..#.... ................#..#.... ................#..#.... #...##.##.###.###..#.... ...................#.... #....................... #..................##... #....................... #..................##... #.#................##... #.####..#.#...
output:
763
result:
ok answer is '763'
Test #75:
score: 0
Accepted
time: 6ms
memory: 4372kb
input:
37 24 8 35 19 ........................ .#####.#..###.#########. .##.#................##. .#####.#...............# .###...#...#.......##### .###...#...##..###.####. .##....#...##..###.####. .##........##..###.####. .##........##........### .##........##..###.##### .##........##..###.##### .##...........
output:
5271
result:
ok answer is '5271'
Test #76:
score: 0
Accepted
time: 14ms
memory: 4772kb
input:
40 40 4 28 24 ......#..#.#...............#......###... ....######..#.########.#####.######.##.# ..#...#..#.##.....####.####.#.#####....# ..#..#####.#####.###.#.##..#.##..###...# ..#...#.##.###########.#.#####.#.###...# ......#.##..#.........###.#..##..##....# .#########.#######..########.###.###...#...
output:
8112
result:
ok answer is '8112'
Test #77:
score: 0
Accepted
time: 13ms
memory: 5084kb
input:
40 40 1 11 7 ...................................#.... ......#............................#.... .....#####..#.##.##...#.##.#..#######... .....##................#................ ......#............................#.... ...##.#.####.####.....#............#.... .....###................................ ...
output:
1556
result:
ok answer is '1556'
Test #78:
score: 0
Accepted
time: 4ms
memory: 4196kb
input:
21 22 1 20 15 .############......... .##################### .#..#........#........ .#..#........#........ .#..#.####...#...##... .##.###......#...#...# .#.................... ..#.###......#..##...# .#############.###...# .####.########.###..## ..#.###......#..##..## ..#.###......#..#...## ..#.###......
output:
775
result:
ok answer is '775'
Test #79:
score: 0
Accepted
time: 2ms
memory: 4512kb
input:
21 29 0 26 25 ...##.#######.........##..... ###########################.. #..########################## #..##.#...#.##.......###..... #..##.#####..#.......###....# #..##.######.###########....# #..##.##..#..#..####.###....# #..##.######.##############.# #.#######.#..#....#..###..... #..##.##...........
output:
933
result:
ok answer is '933'
Test #80:
score: 0
Accepted
time: 2ms
memory: 4132kb
input:
14 19 1 21 16 #........#......... ..########.###..... ................... .....#####.#.###.#. .........#...#...#. .......###.######## ...#.#####.######## ................### ...#.#####.###...#. .............#..... ................... ....#........#..... .............#..... ...................
output:
406
result:
ok answer is '406'
Test #81:
score: 0
Accepted
time: 2ms
memory: 4008kb
input:
16 12 1 31 25 ............ .#.##..##... ........#.#. .#..#....... .#..#..#.... ....#..##..# ....#..#.... .#.#....#.## .#..#....#.# .........#.. .#..#...#.## .#..#....... .#..#......# ..........## .#.##...#.#. ..........#.
output:
740
result:
ok answer is '740'
Test #82:
score: 0
Accepted
time: 4ms
memory: 4140kb
input:
17 22 1 14 9 .####.#######.##.####. ####.################. .................##... ..#....#.....###..#.#. ..#..#.#.............. ....................#. ..#..#.##.####.#..#... ..#..#.#..#.####..#... ###..###.####..##.#... ....................#. ..#................##. ###.####.############. ..............
output:
657
result:
ok answer is '657'
Test #83:
score: 0
Accepted
time: 4ms
memory: 4612kb
input:
39 30 3 34 29 .............................. .........#.................... .............................. .............................. .............................. .............................. .........................#.#.. .........#..#....#.......#.#.. .........#..............##.#.. ..........
output:
997
result:
ok answer is '997'
Test #84:
score: 0
Accepted
time: 5ms
memory: 4776kb
input:
29 35 0 13 11 ...........#....................... ...........#....#.....#####........ ..............###.....##..#..#..... ......#...............##..#..#..... ......#....#..###.....##..#..#..... ....################.###########... ......#....#..#.#.....##..#..#..... ......##...#..#.#.#...##..#..#.......
output:
514
result:
ok answer is '514'
Test #85:
score: 0
Accepted
time: 3ms
memory: 4412kb
input:
14 27 2 24 21 .#########.#.####...####### ......##.###.####...#.#.### #............###....#.#.#.. ........................... ....##..................#.. ........................... ....###.####............... ....................#.#.#.. #####...................... .##.#.#.####.##.....#.#.##. .........
output:
867
result:
ok answer is '867'
Test #86:
score: 0
Accepted
time: 10ms
memory: 4860kb
input:
40 40 4 29 24 ..........#############......##.......#. ......................................#. .............................#........#. .............................#...#....#. ...#....#........................#....#. ...#....#....................#...#.#..#. .########################.####...###..#....
output:
4710
result:
ok answer is '4710'
Test #87:
score: 0
Accepted
time: 45ms
memory: 5064kb
input:
40 40 1 38 34 ..............................#......... .....#...................#.............. ................#.............###...#... .#..##...#..#.##...#....#.##.##.#.#..... .##....##.#..##.#....................... ..##..###....#.......##.###.###.#.#..... .....#..#...............#.##.##.#....#.....
output:
6674
result:
ok answer is '6674'
Test #88:
score: 0
Accepted
time: 6ms
memory: 4428kb
input:
23 40 2 22 11 ....########.#########################.. ........................................ ........................................ .#...................................... ........................................ ..##########.#.######.################## ........#........#..#..#...#..#.#..........
output:
1369
result:
ok answer is '1369'
Test #89:
score: 0
Accepted
time: 4ms
memory: 4296kb
input:
39 18 1 7 6 ##......#.###.##.. ##.#....#.###.##.. ###########.####.. ##.#.######.#.##.. ##.########.#.##.. ####.#.####.####.. ####.#.##.#.####.# ##.#.#..#.#.#.##.. ##.#.#..#.#.#.##.. ####.#.##.#.#.##.. ####.#.##.#....... ######.##.#.####.. ####.#.##.#.#.##.. ######.#..#.####.# ####.#.#..#.####.# #.....
output:
815
result:
ok answer is '815'
Test #90:
score: 0
Accepted
time: 3ms
memory: 4484kb
input:
17 28 4 33 29 ##############...###..#..... ..######...........#..#...#. .#######################..#. #########............####### #.##.....................### ..###############.#######.#. ...###########..#.#######.#. ....................#######. ....#############..########. ....#############.#######...
output:
2181
result:
ok answer is '2181'
Test #91:
score: 0
Accepted
time: 1ms
memory: 4160kb
input:
19 15 0 21 13 ....#.....#.... #..#......#.... ..#....#.#..#.. #..#........#.. ..#.#..#....... ..#.....#...#.. ..#..#..#...#.. #...##.##...#.. #...##..#..#... .#...##.#..###. #..........#... ....#.#.##...## .....#..#...... ..########..... #.#.##......#.. #....#.....###. ..#....#...#.#. ...###..##.......
output:
763
result:
ok answer is '763'
Test #92:
score: 0
Accepted
time: 2ms
memory: 4460kb
input:
31 13 0 28 23 ......##..... ......#...... .#...##...... ...#...#..... .##...#...... ...#...#.#... ...#..#..#..# ..#...#.##... ..#...#...... .......##.... .#....#.....# ..#.........# .##.#....#.## .#....###.... .#.#....##... ........#..## #.#...#.#..#. #......#....# .##..#......# #...#.##.#... #....#...
output:
1645
result:
ok answer is '1645'
Test #93:
score: 0
Accepted
time: 1ms
memory: 4016kb
input:
11 22 1 5 3 #................#.#.. ####.#######.#...#.#.# #......#####.#...#.#.# ####.#.#####.#...#.#.# ####.#####.......#.#.# #.#..#######.###.#.#.# #....#######.######### ###..#######.#######.# ....................## #....################# #####################.
output:
251
result:
ok answer is '251'
Test #94:
score: 0
Accepted
time: 6ms
memory: 4636kb
input:
36 23 3 34 13 ####################### ##...####.............. ####################### ###.##...##.####...#### .##.##..#######.####### .###.#.########.####### .##..#.####.###.##.#### .##..................## .###.#.########.##.#### .##..#.########.####### .##..#.########.####### .###.#.########.######...
output:
3350
result:
ok answer is '3350'
Test #95:
score: 0
Accepted
time: 2ms
memory: 4148kb
input:
40 12 1 38 31 .#..###.#... ..########## ..#...#.##.# ..#.#.#.##.# ..#.###.##.# #.#.###.#### #.#.###.#### ..#.###.#### ....#.###### ....#.###### ....#.###### ....#.###### ....#.###### ....#.###### ....#.###### ....#.#####. ....#.#.###. ....#.#.###. ....#.#.###. ....#.#.###. ....#.#.###. ....#.#.###. ...
output:
1045
result:
ok answer is '1045'
Test #96:
score: 0
Accepted
time: 12ms
memory: 4784kb
input:
40 40 3 32 17 ####.................................... #..#....#............................... #.#.....................###.#####.#.##.. #..#.................................... ...#................#....##.##.#........ #.####.##....#...####.##.##.####..#..... #..#..............#.#..........#...........
output:
2499
result:
ok answer is '2499'
Test #97:
score: 0
Accepted
time: 21ms
memory: 4744kb
input:
40 40 1 14 7 .###........................#.#.#.##.... .#####.######.#..##.#...#.###.#.#####... ##...######......##....###..#.#..##.#.#. .###..........................#....##... ..##.#.....##..........####...#....#.... .#.#...#....#......###....#.........#... .#.#.###.#.............................. ...
output:
2131
result:
ok answer is '2131'
Test #98:
score: 0
Accepted
time: 10ms
memory: 4616kb
input:
33 40 4 19 14 ###############################.######## ##########............................## #.##...#.#..#..#.......#..#####.######## #.##...###..#..#.#.....#....##........## #.##..#####.##.#####.##########.######## ###########.##.#####.##########.####...# ..##...###..#..#.##....#....##....##...#...
output:
5540
result:
ok answer is '5540'
Test #99:
score: 0
Accepted
time: 2ms
memory: 4136kb
input:
20 18 3 25 11 ...#..#........... ...#.#########.##. .................. ...##............. .................. ...##..#........#. .................. ...###.####..#..#. ...##..#######..#. .................. .#####.##########. ...###.##########. .#####.#####.##### ...#...#.##...###. .#................ ....
output:
873
result:
ok answer is '873'
Test #100:
score: 0
Accepted
time: 1ms
memory: 4084kb
input:
35 8 1 11 6 #####.## ####.### ####..## .###..## .###...# .###...# .###...# .###...# .###...# ........ .###...# .###...# .##....# .##....# ..##...# .###...# .###...# .###...# .###...# .###...# .###...# .###...# .###...# .###...# .###...# .###...# .###...# .###...# .#.....# .###...# .###...# .###...# ...
output:
283
result:
ok answer is '283'
Test #101:
score: 0
Accepted
time: 10ms
memory: 4400kb
input:
21 38 1 38 24 ...................................... .............####..................... .##..##.###.#...##...###..#.##.###.... .........................#............ .........#.#.......................... ...................................... ....#.###.###...####..###............. ................
output:
1707
result:
ok answer is '1707'
Test #102:
score: 0
Accepted
time: 2ms
memory: 4276kb
input:
32 19 4 34 25 #.................. #.................. #.................. ................... #.................. #................#. ##..#.............. #...#.......#...... #...#.......#...... #...#.......#...... #...#.............. #...#.............. ......#............ #...#.#............ #...#....
output:
993
result:
ok answer is '993'
Test #103:
score: 0
Accepted
time: 6ms
memory: 4752kb
input:
28 35 6 34 20 ..#.....#.....#.................#.. ..#...######################....#.. ..#.....#..#.##..################.. ..#.....#..#.##..#.............#### ..#.....#.#####################.#.. ..#.#########################...#.. ..#.#...#..#.##..#..#.....#..####.. .################################....
output:
4604
result:
ok answer is '4604'
Test #104:
score: 0
Accepted
time: 3ms
memory: 4368kb
input:
39 20 0 38 15 ....#..............# ...#...##..........# ...#..............## ...#.#######......## ...#..............## ..................## ...#....#.........## ...#...##......#..## #..#...##......#..## ####.#.............# #......##......##.## #......##......##.## #......##....#.##.## #......##.......
output:
1083
result:
ok answer is '1083'
Test #105:
score: 0
Accepted
time: 2ms
memory: 4160kb
input:
23 19 0 14 2 ################### ##..##.##..##.##.## ###.##.######.##.## ###.##.#########.## ######.#########.## ###.##.#########.## ###.##............# ###.##.######.##.## ###.##.#########.## ######.#########.## ###.##.#########.## .#####.#########.## ###.##.#########.## ######...........## #######...
output:
324
result:
ok answer is '324'
Test #106:
score: 0
Accepted
time: 12ms
memory: 5064kb
input:
40 40 0 14 10 ....#.............##.................#.# ........................................ ....#.....#......##..##...#..##........# ....#.....#.#...###...#...#..##........# #.####################.####.#.#####..#.# ....#.....#............................# ....#..####.########.######.######.#...#...
output:
1668
result:
ok answer is '1668'
Test #107:
score: 0
Accepted
time: 10ms
memory: 4820kb
input:
40 40 3 36 20 ........................................ ........................................ ........................................ ................#........#.....#........ .....#..#####..#########.####.###....... .........#......#..............#........ ...###...#......#........#.................
output:
3328
result:
ok answer is '3328'