ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#211423 | #3803. 激光 | shiruiheng | 3 | 3333ms | 45696kb | C++11 | 1.8kb | 2024-08-11 11:49:06 | 2024-08-11 13:13:02 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
//using LL = __int128
#define pi pair<ll, ll>
#define pl pair<int, pi>
#define fi first
#define se second
#define N 222222
ll n, m, k, pos = 1, mp[1111], sz, cnt, dis[4][1111][1111], dir[][2] = {
{-1, 0}, {1, 0}, {0, -1}, {0, 1}
};
pi v[N], t;
pl st[N];
char s[1111][1111];
void debug(int u){
for(int i = 1 ; i <= n ; i++)
for(int j = 1 ; j <= m ; j++)
printf("%lld%c", ((s[i][j] == '.') ? dis[u][i][j] : -1ll), " \n"[j == m]);
}
void add(pi &t){
v[++pos] = t;
}
void pop(){
if(sz <= 0)
return;
sz--;
}
void push(pl &t){
st[++sz] = t;
}
void dfs(int d, int x, int y){
if(dis[d][x][y] || (s[x][y] == '#'))
return;
for(int r = 0 ; r < 4 ; r++){
;
}
}
int main(){
scanf("%lld%lld", &n, &m);
for(int i = 1 ; i <= n ; i++){
scanf("%s", s[i] + 1);
for(int j = 1 ; j <= m ; j++)
k += (s[i][j] == 'X'), cnt += ((s[i][j] != '\\') && (s[i][j] != '/') && (s[i][j] != 'X'));
}
if(k == 0){
for(int i = 1 ; i <= n ; i++){
for(int j = 1 ; j <= m ; j++)
if(s[i][j] != '#'){
dis[3][i][j] = dis[3][i][j - 1] + 1;
dis[2][i][j] = dis[2][i - 1][j] + 1;
}
for(int j = m ; j >= 1 ; j--)
if(s[i][j] != '#')
dis[0][i][j] = dis[0][i][j + 1] + 1;
}
for(int i = n ; i >= 1 ; i--)
for(int j = 1 ; j <= m ; j++)
dis[1][i][j] = dis[1][i + 1][j] + 1;
debug(2);
debug(1);
debug(3);
debug(0);
return 0;
}
for(int i = 1 ; i <= k ; i++){
scanf("%lld", &t.fi, &t.se);
add(t);
}
if(n <= 60 && m <= 60){
for(int u = 0 ; u < 4 ; u++)
for(int i = 1 ; i <= n ; i++)
for(int j = 1 ; j <= m ; j++)
if(!dis[u][i][j] && s[i][j] != 'X'){
dfs(u, i, j);
}
return 0;
}
return 0;
}
/*
4 4
#..#
.#..
#..#
..#.
*/
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 5ms
memory: 10804kb
input:
50 50 .......................#.........#................ ..............................................
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
wrong answer 2501st words differ - expected: '5', found: '50'
Test #2:
score: 0
Wrong Answer
time: 95ms
memory: 26216kb
input:
500 500 ...............................................................................................
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
wrong answer 250002nd words differ - expected: '141', found: '500'
Test #3:
score: 0
Wrong Answer
time: 375ms
memory: 45696kb
input:
1000 1000 #.....#..#...............#..#.##......#......#...........#....#....#.#.......#..........##...
output:
-1 1 1 1 1 1 -1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 1 1 1 1 1 1 -1 1 1 1 1 1 1 -1...
result:
wrong answer 1000002nd words differ - expected: '2', found: '1000'
Test #4:
score: 0
Wrong Answer
time: 306ms
memory: 45332kb
input:
990 831 ...............................................................................................
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
wrong answer 822691st words differ - expected: '65', found: '990'
Test #5:
score: 3
Accepted
time: 376ms
memory: 45696kb
input:
1000 1000 .............................................................................................
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 4000000 tokens
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 9852kb
input:
3 3 /X\ X.X .X/ 1 2 2 3 2 1 3 2
output:
result:
wrong answer Unexpected EOF in the participants output
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 9856kb
input:
7 7 /X.X.X\ X\.\./X ....... X\././X ....... X\./.\X \X.X.X/ 1 2 7 2 1 4 7 4 1 6 7 6 2 1 2 7 4 1 4 7 ...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 9864kb
input:
9 10 #./....\.. ..../.X..# /.X..../.. ./.\./.... ..X../..#. \/.\...\.. ..X...\/.. .X....X..\ ....X.....
output:
result:
wrong answer Unexpected EOF in the participants output
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 9908kb
input:
50 50 .././.\.\\.\\.\/\\.//..\\..//\./////..\//..//\\... \.....\..../\\/..\/././\.//.\\\.\\/\\\..\//...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #10:
score: 0
Wrong Answer
time: 3ms
memory: 9916kb
input:
60 60 X..XXX.../...XXX././X..\..X....XX.X.X./X....XXX....\XXX.X.X. XX..XX.//..XX\.X...X.X...X.....X....
output:
result:
wrong answer Unexpected EOF in the participants output
Test #11:
score: 0
Wrong Answer
time: 5ms
memory: 9920kb
input:
60 60 X..XXXX..X...XXX.X.XX..X..XXXXXXX.X.X.XXX.X.XXXX.X.XXXX.XXX. XX..XX.XX..XXX.X...X.X.XXX..X..X....
output:
result:
wrong answer Unexpected EOF in the participants output
Test #12:
score: 0
Wrong Answer
time: 3ms
memory: 11012kb
input:
60 60 /..........................................................\ ./..................................
output:
-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
wrong answer 61st words differ - expected: '3542', found: '2'
Test #13:
score: 0
Wrong Answer
time: 3ms
memory: 9916kb
input:
60 55 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. X\.........XX....X.X...XX../\../...X.....
output:
result:
wrong answer Unexpected EOF in the participants output
Test #14:
score: 0
Wrong Answer
time: 2ms
memory: 9920kb
input:
60 60 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. X...\\XXX//../X/////...\..\.\/X.X...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #15:
score: 0
Wrong Answer
time: 0ms
memory: 9916kb
input:
60 60 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. X/..\\/..//.././////...\..\.\/......
output:
result:
wrong answer Unexpected EOF in the participants output
Test #16:
score: 0
Wrong Answer
time: 15ms
memory: 10940kb
input:
1000 899 ........X...X..X...X.X.....X.....X...............X.XX.X.X............X..X.X.X..X..............
output:
result:
wrong answer Unexpected EOF in the participants output
Test #17:
score: 0
Wrong Answer
time: 25ms
memory: 11628kb
input:
1000 1000 X.....XXXX.X...X.........X..X.XX...X.XX......X........X..X....X....X.X.......X.......X..XX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #18:
score: 0
Wrong Answer
time: 67ms
memory: 20276kb
input:
1000 1000 XXX...XXXXXXXXXXXXXX.XXXXXXXXXXXXXXX.XXX.X.XXXXXX.XX..X.XXXXXXXXXXXXXXXXXXXXXX.XXXXX.XXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #19:
score: 0
Wrong Answer
time: 5ms
memory: 10936kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #20:
score: 0
Wrong Answer
time: 5ms
memory: 10936kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #21:
score: 0
Wrong Answer
time: 369ms
memory: 45692kb
input:
1000 1000 ...../\..../.\......//././/./\\./../..\/.......\\.\.....\\\\//.\.../.\....\...\../././../\...
output:
1 1 1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 1 1 1 1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 1 1 ...
result:
wrong answer 1006th words differ - expected: '9', found: '2'
Test #22:
score: 0
Wrong Answer
time: 356ms
memory: 45692kb
input:
1000 1000 ......\...................../................................................................
output:
1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
wrong answer 1007th words differ - expected: '8', found: '2'
Test #23:
score: 0
Wrong Answer
time: 436ms
memory: 45696kb
input:
1000 1000 /............................................................................................
output:
-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
wrong answer 1001st words differ - expected: '999002', found: '2'
Test #24:
score: 0
Wrong Answer
time: 256ms
memory: 34960kb
input:
700 1000 /.............................................................................................
output:
-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
wrong answer 1001st words differ - expected: '489302', found: '2'
Test #25:
score: 0
Wrong Answer
time: 385ms
memory: 45692kb
input:
1000 1000 #.....#\/................\..#\#\\/...../.....#..\........#.\..#\...\.\........\/../../...\...
output:
-1 1 1 1 1 1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 1 1 1 1 ...
result:
wrong answer 1009th words differ - expected: '25', found: '2'
Test #26:
score: 0
Wrong Answer
time: 3ms
memory: 10940kb
input:
1000 1000 .........X.\........\.......#..X............/#....\........./.............X.......X..........
output:
result:
wrong answer Unexpected EOF in the participants output
Test #27:
score: 0
Wrong Answer
time: 14ms
memory: 10936kb
input:
1000 1000 ...../\\./.X.......X/..../../\.../.X..\X..........\...\..\.X/XX..../.X.....\...X...../XX.....
output:
result:
wrong answer Unexpected EOF in the participants output
Test #28:
score: 0
Wrong Answer
time: 7ms
memory: 10940kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #29:
score: 0
Wrong Answer
time: 4ms
memory: 10940kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #30:
score: 0
Wrong Answer
time: 8ms
memory: 10940kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #31:
score: 0
Wrong Answer
time: 17ms
memory: 10940kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #32:
score: 0
Wrong Answer
time: 3ms
memory: 10936kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output
Test #33:
score: 0
Wrong Answer
time: 57ms
memory: 17952kb
input:
1000 1000 \.XXX/\X..X\XXXX.XXXXX.X.X.X/X.\XX.XX.\XXX.XXXXX\X\.XX.XX\XX/X.X.XXXXXXXXXXX.X\XXXXXXXXX/....
output:
result:
wrong answer Unexpected EOF in the participants output
Test #34:
score: 0
Wrong Answer
time: 59ms
memory: 19276kb
input:
1000 1000 X..XXXXX.XXXXXXX.XXXXX.X.X.XXXXXXX.XX.XXXX.XXX.XXXXX.X.XXXXXXX.X.XXXXXXX..XX.XXXXXXXXXXX.....
output:
result:
wrong answer Unexpected EOF in the participants output
Test #35:
score: 0
Wrong Answer
time: 69ms
memory: 19632kb
input:
1000 1000 .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
result:
wrong answer Unexpected EOF in the participants output