제출 #636660

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6366602022-08-29 21:32:25LKR__enjoyerTracks in the Snow (BOI13_tracks)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
#define f first
#define s second
int n,m;
char grid[4000][4000];
int odl[4000][4000];
pair<int,int> ruchy[4]={{1,0},{-1,0},{0,1},{0,-1}};
void bfs(int i,int j)
{
deque<pair<int,int>> w;
w.push_front({i,j});
while(w.empty()==0)
{
pair<int,int> akt=w.front();
w.pop_front();
for(int z=0;z<4;z++)
{
int u1=akt.f+ruchy[z].f;
int u2=akt.s+ruchy[z].s;
if(u1<0||u1>=n||u2<0||u2>=m||grid[u1][u2]=='.')continue;
int waga=0;
if(grid[akt.f][akt.s]!=grid[u1][u2])waga=1;
if(odl[u1][u2]>odl[akt.f][akt.s]+waga)
{
odl[u1][u2]=odl[akt.f][akt.s]+waga;
if(waga==1)w.push_back({u1,u2});
else w.push_front({u1,u2});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

tracks.cpp:51:4: error: expected constructor, destructor, or type conversion before '(' token
   51 | bfs(0,0);
      |    ^
tracks.cpp:53:1: error: expected unqualified-id before 'for'
   53 | for(int i=0;i<n;i++)
      | ^~~
tracks.cpp:53:13: error: 'i' does not name a type
   53 | for(int i=0;i<n;i++)
      |             ^
tracks.cpp:53:17: error: 'i' does not name a type
   53 | for(int i=0;i<n;i++)
      |                 ^
tracks.cpp:54:13: error: 'j' does not name a type
   54 | for(int j=0;j<m;j++)
      |             ^
tracks.cpp:54:17: error: 'j' does not name a type
   54 | for(int j=0;j<m;j++)
      |                 ^
tracks.cpp:56:1: error: 'cout' does not name a type
   56 | cout<<wynik+1;
      | ^~~~
tracks.cpp:57:5: error: expected unqualified-id before 'return'
   57 |     return 0;
      |     ^~~~~~
tracks.cpp:58:1: error: expected declaration before '}' token
   58 | }
      | ^