제출 #693731

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6937312023-02-03 07:31:39KongggwpMecho (IOI09_mecho)C++14
100 / 100
246 ms11252 KiB
#include<bits/stdc++.h>
using namespace std;
int dx[] = {0,1,0,-1} , dy[] = {1,0,-1,0} ,x ,y , st ,N , si , sj , fi , fj;
const int n=801;
char s[n][n];
vector<vector<int>>timebee(n , vector<int>(n,INT_MAX));
vector<vector<int>>timebear(n , vector<int>(n,INT_MAX));
vector<vector<int>>visbee(n , vector<int>(n,0));
queue<pair<pair<int,int>,int>>qbear,qbee;
int check(int m)
{
//cout << m << endl;
if(m>=timebee[si][sj])return 0;
while(!qbear.empty())qbear.pop();
for(int i=0 ; i<N ; i++)for(int j=0 ; j<N ; j++)timebear[i][j]=INT_MAX;
vector<vector<int>>visbear(N , vector<int>(N,0));
qbear.push({{si,sj},0});
timebear[si][sj] = m;
visbear[si][sj] = 1;
while(!qbear.empty())
{
int r = qbear.front().first.first , c = qbear.front().first.second , time = qbear.front().second;
//cout << r << " " << c << " " << time << endl;
qbear.pop();
for(int i=0 ; i<4 ; i++)
{
int nr = r+dx[i];
int nc = c+dy[i];
if(nr<0 or nr>=N or nc<0 or nc>=N or s[nr][nc]=='T' or visbear[nr][nc]==1)continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...