답안 #924155

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
924155 2024-02-08T15:03:56 Z vjudge1 Maze (JOI23_ho_t3) C++17
51 / 100
2000 ms 95700 KB
#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(ll i=a,ggdem=b;i<ggdem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define imp(v) for(auto edu:v)cout<<edu<<" "; cout<<"\n"
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const ll MAXN=6e6+5;

ll a[MAXN];
ll n,m,k;
ll cv(ii x){return m*x.fst+x.snd;}
ii cv(ll x){return {x/m,x%m};}
vector<ii>dir={{0,1},{-1,0},{0,-1},{1,0}};
ii operator+(ii a, ii b){return {a.fst+b.fst,a.snd+b.snd};}
void operator+=(ii &a, ii b){a=a+b;}
bool allowed(ii p){
	auto [i,j]=p;
	if(i<0||i>=n||j<0||j>=m)return 0;
	return 1;
}
ll d[MAXN],vis[MAXN];
deque<ii>q;
void go(ii x, ii y, ll g=0){
	if(!allowed(y)||(!g&&a[cv(y)]))return;
	ll nd=d[cv(x)]+g;
	if(d[cv(y)]!=-1&&d[cv(y)]<=nd)return;
	d[cv(y)]=nd;
	if(!g)q.push_front(y);
	else q.pb(y);
}
ll reach(ii x, ii e){
	return (max(abs(x.fst-e.fst),abs(x.snd-e.snd))<=k&&
	       abs(x.fst-e.fst)+abs(x.snd-e.snd)<2*k);
}

ll bfs(ii s, ii e){
	mset(d,-1);
	d[cv(s)]=0;
	q.push_front(s);
	while(SZ(q)){
		auto x=q.front(); q.pop_front();
		if(vis[cv(x)])continue;
		vis[cv(x)]=1;
		for(auto add:dir){
			auto y=x+add;
			go(x,y);
		}
		// continue; // sb1
		auto [i,j]=x;
		if(reach(x,e))go(x,e,1);
		for(ii y={i-k,j-k+1};y.snd<j+k;y+=dir[0])go(x,y,1);
		for(ii y={i+k,j-k+1};y.snd<j+k;y+=dir[0])go(x,y,1);
		for(ii y={i-k+1,j-k};y.fst<i+k;y+=dir[3])go(x,y,1);
		for(ii y={i-k+1,j+k};y.fst<i+k;y+=dir[3])go(x,y,1);
	}
	return d[cv(e)];
}

int main(){FIN;
	cin>>n>>m>>k;
	ii s,e; cin>>s.fst>>s.snd>>e.fst>>e.snd; s.fst--,s.snd--,e.fst--,e.snd--;
	fore(i,0,n*m){
		char c; cin>>c;
		a[i]=(c=='#');
	}
	cout<<bfs(s,e)<<"\n";
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 49496 KB Output is correct
2 Correct 7 ms 49500 KB Output is correct
3 Correct 7 ms 49496 KB Output is correct
4 Correct 7 ms 49500 KB Output is correct
5 Correct 7 ms 49628 KB Output is correct
6 Correct 8 ms 49680 KB Output is correct
7 Correct 7 ms 49496 KB Output is correct
8 Correct 7 ms 49496 KB Output is correct
9 Correct 6 ms 49500 KB Output is correct
10 Correct 7 ms 49500 KB Output is correct
11 Correct 7 ms 49496 KB Output is correct
12 Correct 6 ms 49500 KB Output is correct
13 Correct 7 ms 49744 KB Output is correct
14 Correct 7 ms 49500 KB Output is correct
15 Correct 7 ms 49876 KB Output is correct
16 Correct 7 ms 49500 KB Output is correct
17 Correct 8 ms 49500 KB Output is correct
18 Correct 7 ms 49640 KB Output is correct
19 Correct 11 ms 50008 KB Output is correct
20 Correct 9 ms 50008 KB Output is correct
21 Correct 10 ms 50524 KB Output is correct
22 Correct 12 ms 50012 KB Output is correct
23 Correct 11 ms 50176 KB Output is correct
24 Correct 9 ms 50012 KB Output is correct
25 Correct 9 ms 50012 KB Output is correct
26 Correct 12 ms 50264 KB Output is correct
27 Correct 13 ms 50008 KB Output is correct
28 Correct 11 ms 50144 KB Output is correct
29 Correct 16 ms 52804 KB Output is correct
30 Correct 11 ms 50012 KB Output is correct
31 Correct 15 ms 54108 KB Output is correct
32 Correct 18 ms 52828 KB Output is correct
33 Correct 14 ms 52828 KB Output is correct
34 Correct 14 ms 52824 KB Output is correct
35 Correct 13 ms 52828 KB Output is correct
36 Correct 20 ms 52828 KB Output is correct
37 Correct 19 ms 52828 KB Output is correct
38 Correct 16 ms 52828 KB Output is correct
39 Correct 105 ms 73732 KB Output is correct
40 Correct 20 ms 53084 KB Output is correct
41 Correct 15 ms 53080 KB Output is correct
42 Correct 20 ms 53336 KB Output is correct
43 Correct 22 ms 53492 KB Output is correct
44 Correct 57 ms 61524 KB Output is correct
45 Correct 54 ms 62044 KB Output is correct
46 Correct 135 ms 86232 KB Output is correct
47 Correct 125 ms 73684 KB Output is correct
48 Correct 107 ms 73556 KB Output is correct
49 Correct 68 ms 73532 KB Output is correct
50 Correct 71 ms 73556 KB Output is correct
51 Correct 126 ms 74120 KB Output is correct
52 Correct 133 ms 74152 KB Output is correct
53 Correct 110 ms 73808 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 49500 KB Output is correct
2 Correct 8 ms 49500 KB Output is correct
3 Correct 7 ms 49496 KB Output is correct
4 Correct 7 ms 49500 KB Output is correct
5 Correct 7 ms 49500 KB Output is correct
6 Correct 7 ms 49500 KB Output is correct
7 Correct 7 ms 49708 KB Output is correct
8 Correct 7 ms 49496 KB Output is correct
9 Correct 7 ms 49500 KB Output is correct
10 Correct 7 ms 49692 KB Output is correct
11 Correct 6 ms 49500 KB Output is correct
12 Correct 8 ms 49644 KB Output is correct
13 Correct 7 ms 49500 KB Output is correct
14 Correct 7 ms 49496 KB Output is correct
15 Correct 7 ms 49500 KB Output is correct
16 Correct 8 ms 49496 KB Output is correct
17 Correct 7 ms 49500 KB Output is correct
18 Correct 7 ms 49500 KB Output is correct
19 Correct 7 ms 49684 KB Output is correct
20 Correct 7 ms 49496 KB Output is correct
21 Correct 7 ms 49500 KB Output is correct
22 Correct 7 ms 49644 KB Output is correct
23 Correct 7 ms 49500 KB Output is correct
24 Correct 7 ms 49500 KB Output is correct
25 Correct 8 ms 49704 KB Output is correct
26 Correct 7 ms 49628 KB Output is correct
27 Correct 7 ms 49500 KB Output is correct
28 Correct 7 ms 49500 KB Output is correct
29 Correct 7 ms 49500 KB Output is correct
30 Correct 7 ms 49500 KB Output is correct
31 Correct 7 ms 49500 KB Output is correct
32 Correct 7 ms 49500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 49500 KB Output is correct
2 Correct 6 ms 49500 KB Output is correct
3 Correct 6 ms 49496 KB Output is correct
4 Correct 6 ms 49496 KB Output is correct
5 Correct 7 ms 49500 KB Output is correct
6 Correct 7 ms 49500 KB Output is correct
7 Correct 6 ms 49500 KB Output is correct
8 Correct 7 ms 49640 KB Output is correct
9 Correct 8 ms 49704 KB Output is correct
10 Correct 7 ms 49500 KB Output is correct
11 Correct 7 ms 49592 KB Output is correct
12 Correct 7 ms 49496 KB Output is correct
13 Correct 7 ms 49496 KB Output is correct
14 Correct 7 ms 49500 KB Output is correct
15 Correct 7 ms 49500 KB Output is correct
16 Correct 7 ms 49500 KB Output is correct
17 Correct 7 ms 49496 KB Output is correct
18 Correct 7 ms 49500 KB Output is correct
19 Correct 7 ms 49500 KB Output is correct
20 Correct 7 ms 49672 KB Output is correct
21 Correct 7 ms 49500 KB Output is correct
22 Correct 7 ms 49656 KB Output is correct
23 Correct 7 ms 49496 KB Output is correct
24 Correct 8 ms 49752 KB Output is correct
25 Correct 13 ms 50008 KB Output is correct
26 Correct 19 ms 51288 KB Output is correct
27 Correct 11 ms 50520 KB Output is correct
28 Correct 311 ms 50768 KB Output is correct
29 Correct 8 ms 49752 KB Output is correct
30 Correct 8 ms 49752 KB Output is correct
31 Correct 104 ms 50260 KB Output is correct
32 Correct 12 ms 50264 KB Output is correct
33 Correct 12 ms 50268 KB Output is correct
34 Correct 219 ms 55144 KB Output is correct
35 Correct 16 ms 54364 KB Output is correct
36 Correct 1211 ms 54356 KB Output is correct
37 Correct 8 ms 51804 KB Output is correct
38 Correct 8 ms 51804 KB Output is correct
39 Correct 414 ms 65768 KB Output is correct
40 Execution timed out 2059 ms 95700 KB Time limit exceeded
41 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 49500 KB Output is correct
2 Correct 8 ms 49500 KB Output is correct
3 Correct 7 ms 49496 KB Output is correct
4 Correct 7 ms 49500 KB Output is correct
5 Correct 7 ms 49500 KB Output is correct
6 Correct 7 ms 49500 KB Output is correct
7 Correct 7 ms 49708 KB Output is correct
8 Correct 7 ms 49496 KB Output is correct
9 Correct 7 ms 49500 KB Output is correct
10 Correct 7 ms 49692 KB Output is correct
11 Correct 6 ms 49500 KB Output is correct
12 Correct 8 ms 49644 KB Output is correct
13 Correct 7 ms 49500 KB Output is correct
14 Correct 7 ms 49496 KB Output is correct
15 Correct 7 ms 49500 KB Output is correct
16 Correct 8 ms 49496 KB Output is correct
17 Correct 7 ms 49500 KB Output is correct
18 Correct 7 ms 49500 KB Output is correct
19 Correct 7 ms 49684 KB Output is correct
20 Correct 7 ms 49496 KB Output is correct
21 Correct 7 ms 49500 KB Output is correct
22 Correct 7 ms 49644 KB Output is correct
23 Correct 7 ms 49500 KB Output is correct
24 Correct 7 ms 49500 KB Output is correct
25 Correct 8 ms 49704 KB Output is correct
26 Correct 7 ms 49628 KB Output is correct
27 Correct 7 ms 49500 KB Output is correct
28 Correct 7 ms 49500 KB Output is correct
29 Correct 7 ms 49500 KB Output is correct
30 Correct 7 ms 49500 KB Output is correct
31 Correct 7 ms 49500 KB Output is correct
32 Correct 7 ms 49500 KB Output is correct
33 Correct 10 ms 50012 KB Output is correct
34 Correct 8 ms 49752 KB Output is correct
35 Correct 7 ms 49756 KB Output is correct
36 Correct 13 ms 49928 KB Output is correct
37 Correct 9 ms 50012 KB Output is correct
38 Correct 19 ms 51296 KB Output is correct
39 Correct 11 ms 50524 KB Output is correct
40 Correct 11 ms 50268 KB Output is correct
41 Correct 11 ms 50012 KB Output is correct
42 Correct 316 ms 51020 KB Output is correct
43 Correct 7 ms 49752 KB Output is correct
44 Correct 7 ms 49752 KB Output is correct
45 Correct 9 ms 50012 KB Output is correct
46 Correct 9 ms 50012 KB Output is correct
47 Correct 12 ms 50008 KB Output is correct
48 Correct 41 ms 50260 KB Output is correct
49 Correct 49 ms 50200 KB Output is correct
50 Correct 68 ms 50256 KB Output is correct
51 Correct 103 ms 50256 KB Output is correct
52 Correct 11 ms 50268 KB Output is correct
53 Correct 12 ms 50268 KB Output is correct
54 Correct 10 ms 50212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 49500 KB Output is correct
2 Correct 8 ms 49500 KB Output is correct
3 Correct 7 ms 49496 KB Output is correct
4 Correct 7 ms 49500 KB Output is correct
5 Correct 7 ms 49500 KB Output is correct
6 Correct 7 ms 49500 KB Output is correct
7 Correct 7 ms 49708 KB Output is correct
8 Correct 7 ms 49496 KB Output is correct
9 Correct 7 ms 49500 KB Output is correct
10 Correct 7 ms 49692 KB Output is correct
11 Correct 6 ms 49500 KB Output is correct
12 Correct 8 ms 49644 KB Output is correct
13 Correct 7 ms 49500 KB Output is correct
14 Correct 7 ms 49496 KB Output is correct
15 Correct 7 ms 49500 KB Output is correct
16 Correct 8 ms 49496 KB Output is correct
17 Correct 7 ms 49500 KB Output is correct
18 Correct 7 ms 49500 KB Output is correct
19 Correct 7 ms 49684 KB Output is correct
20 Correct 7 ms 49496 KB Output is correct
21 Correct 7 ms 49500 KB Output is correct
22 Correct 7 ms 49644 KB Output is correct
23 Correct 7 ms 49500 KB Output is correct
24 Correct 7 ms 49500 KB Output is correct
25 Correct 8 ms 49704 KB Output is correct
26 Correct 7 ms 49628 KB Output is correct
27 Correct 7 ms 49500 KB Output is correct
28 Correct 7 ms 49500 KB Output is correct
29 Correct 7 ms 49500 KB Output is correct
30 Correct 7 ms 49500 KB Output is correct
31 Correct 7 ms 49500 KB Output is correct
32 Correct 7 ms 49500 KB Output is correct
33 Correct 10 ms 50012 KB Output is correct
34 Correct 8 ms 49752 KB Output is correct
35 Correct 7 ms 49756 KB Output is correct
36 Correct 13 ms 49928 KB Output is correct
37 Correct 9 ms 50012 KB Output is correct
38 Correct 19 ms 51296 KB Output is correct
39 Correct 11 ms 50524 KB Output is correct
40 Correct 11 ms 50268 KB Output is correct
41 Correct 11 ms 50012 KB Output is correct
42 Correct 316 ms 51020 KB Output is correct
43 Correct 7 ms 49752 KB Output is correct
44 Correct 7 ms 49752 KB Output is correct
45 Correct 9 ms 50012 KB Output is correct
46 Correct 9 ms 50012 KB Output is correct
47 Correct 12 ms 50008 KB Output is correct
48 Correct 41 ms 50260 KB Output is correct
49 Correct 49 ms 50200 KB Output is correct
50 Correct 68 ms 50256 KB Output is correct
51 Correct 103 ms 50256 KB Output is correct
52 Correct 11 ms 50268 KB Output is correct
53 Correct 12 ms 50268 KB Output is correct
54 Correct 10 ms 50212 KB Output is correct
55 Correct 15 ms 53084 KB Output is correct
56 Correct 11 ms 50012 KB Output is correct
57 Correct 227 ms 55120 KB Output is correct
58 Correct 28 ms 52828 KB Output is correct
59 Correct 15 ms 54364 KB Output is correct
60 Correct 19 ms 53084 KB Output is correct
61 Correct 15 ms 53084 KB Output is correct
62 Correct 1208 ms 54556 KB Output is correct
63 Correct 8 ms 51804 KB Output is correct
64 Correct 8 ms 51804 KB Output is correct
65 Correct 13 ms 53080 KB Output is correct
66 Correct 13 ms 53080 KB Output is correct
67 Correct 20 ms 53084 KB Output is correct
68 Correct 103 ms 53056 KB Output is correct
69 Correct 149 ms 53332 KB Output is correct
70 Correct 230 ms 53212 KB Output is correct
71 Correct 322 ms 53408 KB Output is correct
72 Correct 19 ms 53084 KB Output is correct
73 Correct 18 ms 53080 KB Output is correct
74 Correct 15 ms 53084 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 49496 KB Output is correct
2 Correct 7 ms 49500 KB Output is correct
3 Correct 7 ms 49496 KB Output is correct
4 Correct 7 ms 49500 KB Output is correct
5 Correct 7 ms 49628 KB Output is correct
6 Correct 8 ms 49680 KB Output is correct
7 Correct 7 ms 49496 KB Output is correct
8 Correct 7 ms 49496 KB Output is correct
9 Correct 6 ms 49500 KB Output is correct
10 Correct 7 ms 49500 KB Output is correct
11 Correct 7 ms 49496 KB Output is correct
12 Correct 6 ms 49500 KB Output is correct
13 Correct 7 ms 49744 KB Output is correct
14 Correct 7 ms 49500 KB Output is correct
15 Correct 7 ms 49876 KB Output is correct
16 Correct 7 ms 49500 KB Output is correct
17 Correct 8 ms 49500 KB Output is correct
18 Correct 7 ms 49640 KB Output is correct
19 Correct 11 ms 50008 KB Output is correct
20 Correct 9 ms 50008 KB Output is correct
21 Correct 10 ms 50524 KB Output is correct
22 Correct 12 ms 50012 KB Output is correct
23 Correct 11 ms 50176 KB Output is correct
24 Correct 9 ms 50012 KB Output is correct
25 Correct 9 ms 50012 KB Output is correct
26 Correct 12 ms 50264 KB Output is correct
27 Correct 13 ms 50008 KB Output is correct
28 Correct 11 ms 50144 KB Output is correct
29 Correct 16 ms 52804 KB Output is correct
30 Correct 11 ms 50012 KB Output is correct
31 Correct 15 ms 54108 KB Output is correct
32 Correct 18 ms 52828 KB Output is correct
33 Correct 14 ms 52828 KB Output is correct
34 Correct 14 ms 52824 KB Output is correct
35 Correct 13 ms 52828 KB Output is correct
36 Correct 20 ms 52828 KB Output is correct
37 Correct 19 ms 52828 KB Output is correct
38 Correct 16 ms 52828 KB Output is correct
39 Correct 105 ms 73732 KB Output is correct
40 Correct 20 ms 53084 KB Output is correct
41 Correct 15 ms 53080 KB Output is correct
42 Correct 20 ms 53336 KB Output is correct
43 Correct 22 ms 53492 KB Output is correct
44 Correct 57 ms 61524 KB Output is correct
45 Correct 54 ms 62044 KB Output is correct
46 Correct 135 ms 86232 KB Output is correct
47 Correct 125 ms 73684 KB Output is correct
48 Correct 107 ms 73556 KB Output is correct
49 Correct 68 ms 73532 KB Output is correct
50 Correct 71 ms 73556 KB Output is correct
51 Correct 126 ms 74120 KB Output is correct
52 Correct 133 ms 74152 KB Output is correct
53 Correct 110 ms 73808 KB Output is correct
54 Correct 6 ms 49500 KB Output is correct
55 Correct 8 ms 49500 KB Output is correct
56 Correct 7 ms 49496 KB Output is correct
57 Correct 7 ms 49500 KB Output is correct
58 Correct 7 ms 49500 KB Output is correct
59 Correct 7 ms 49500 KB Output is correct
60 Correct 7 ms 49708 KB Output is correct
61 Correct 7 ms 49496 KB Output is correct
62 Correct 7 ms 49500 KB Output is correct
63 Correct 7 ms 49692 KB Output is correct
64 Correct 6 ms 49500 KB Output is correct
65 Correct 8 ms 49644 KB Output is correct
66 Correct 7 ms 49500 KB Output is correct
67 Correct 7 ms 49496 KB Output is correct
68 Correct 7 ms 49500 KB Output is correct
69 Correct 8 ms 49496 KB Output is correct
70 Correct 7 ms 49500 KB Output is correct
71 Correct 7 ms 49500 KB Output is correct
72 Correct 7 ms 49684 KB Output is correct
73 Correct 7 ms 49496 KB Output is correct
74 Correct 7 ms 49500 KB Output is correct
75 Correct 7 ms 49644 KB Output is correct
76 Correct 7 ms 49500 KB Output is correct
77 Correct 7 ms 49500 KB Output is correct
78 Correct 8 ms 49704 KB Output is correct
79 Correct 7 ms 49628 KB Output is correct
80 Correct 7 ms 49500 KB Output is correct
81 Correct 7 ms 49500 KB Output is correct
82 Correct 7 ms 49500 KB Output is correct
83 Correct 7 ms 49500 KB Output is correct
84 Correct 7 ms 49500 KB Output is correct
85 Correct 7 ms 49500 KB Output is correct
86 Correct 7 ms 49500 KB Output is correct
87 Correct 6 ms 49500 KB Output is correct
88 Correct 6 ms 49496 KB Output is correct
89 Correct 6 ms 49496 KB Output is correct
90 Correct 7 ms 49500 KB Output is correct
91 Correct 7 ms 49500 KB Output is correct
92 Correct 6 ms 49500 KB Output is correct
93 Correct 7 ms 49640 KB Output is correct
94 Correct 8 ms 49704 KB Output is correct
95 Correct 7 ms 49500 KB Output is correct
96 Correct 7 ms 49592 KB Output is correct
97 Correct 7 ms 49496 KB Output is correct
98 Correct 7 ms 49496 KB Output is correct
99 Correct 7 ms 49500 KB Output is correct
100 Correct 7 ms 49500 KB Output is correct
101 Correct 7 ms 49500 KB Output is correct
102 Correct 7 ms 49496 KB Output is correct
103 Correct 7 ms 49500 KB Output is correct
104 Correct 7 ms 49500 KB Output is correct
105 Correct 7 ms 49672 KB Output is correct
106 Correct 7 ms 49500 KB Output is correct
107 Correct 7 ms 49656 KB Output is correct
108 Correct 7 ms 49496 KB Output is correct
109 Correct 8 ms 49752 KB Output is correct
110 Correct 13 ms 50008 KB Output is correct
111 Correct 19 ms 51288 KB Output is correct
112 Correct 11 ms 50520 KB Output is correct
113 Correct 311 ms 50768 KB Output is correct
114 Correct 8 ms 49752 KB Output is correct
115 Correct 8 ms 49752 KB Output is correct
116 Correct 104 ms 50260 KB Output is correct
117 Correct 12 ms 50264 KB Output is correct
118 Correct 12 ms 50268 KB Output is correct
119 Correct 219 ms 55144 KB Output is correct
120 Correct 16 ms 54364 KB Output is correct
121 Correct 1211 ms 54356 KB Output is correct
122 Correct 8 ms 51804 KB Output is correct
123 Correct 8 ms 51804 KB Output is correct
124 Correct 414 ms 65768 KB Output is correct
125 Execution timed out 2059 ms 95700 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 49496 KB Output is correct
2 Correct 7 ms 49500 KB Output is correct
3 Correct 7 ms 49496 KB Output is correct
4 Correct 7 ms 49500 KB Output is correct
5 Correct 7 ms 49628 KB Output is correct
6 Correct 8 ms 49680 KB Output is correct
7 Correct 7 ms 49496 KB Output is correct
8 Correct 7 ms 49496 KB Output is correct
9 Correct 6 ms 49500 KB Output is correct
10 Correct 7 ms 49500 KB Output is correct
11 Correct 7 ms 49496 KB Output is correct
12 Correct 6 ms 49500 KB Output is correct
13 Correct 7 ms 49744 KB Output is correct
14 Correct 7 ms 49500 KB Output is correct
15 Correct 7 ms 49876 KB Output is correct
16 Correct 7 ms 49500 KB Output is correct
17 Correct 8 ms 49500 KB Output is correct
18 Correct 7 ms 49640 KB Output is correct
19 Correct 11 ms 50008 KB Output is correct
20 Correct 9 ms 50008 KB Output is correct
21 Correct 10 ms 50524 KB Output is correct
22 Correct 12 ms 50012 KB Output is correct
23 Correct 11 ms 50176 KB Output is correct
24 Correct 9 ms 50012 KB Output is correct
25 Correct 9 ms 50012 KB Output is correct
26 Correct 12 ms 50264 KB Output is correct
27 Correct 13 ms 50008 KB Output is correct
28 Correct 11 ms 50144 KB Output is correct
29 Correct 16 ms 52804 KB Output is correct
30 Correct 11 ms 50012 KB Output is correct
31 Correct 15 ms 54108 KB Output is correct
32 Correct 18 ms 52828 KB Output is correct
33 Correct 14 ms 52828 KB Output is correct
34 Correct 14 ms 52824 KB Output is correct
35 Correct 13 ms 52828 KB Output is correct
36 Correct 20 ms 52828 KB Output is correct
37 Correct 19 ms 52828 KB Output is correct
38 Correct 16 ms 52828 KB Output is correct
39 Correct 105 ms 73732 KB Output is correct
40 Correct 20 ms 53084 KB Output is correct
41 Correct 15 ms 53080 KB Output is correct
42 Correct 20 ms 53336 KB Output is correct
43 Correct 22 ms 53492 KB Output is correct
44 Correct 57 ms 61524 KB Output is correct
45 Correct 54 ms 62044 KB Output is correct
46 Correct 135 ms 86232 KB Output is correct
47 Correct 125 ms 73684 KB Output is correct
48 Correct 107 ms 73556 KB Output is correct
49 Correct 68 ms 73532 KB Output is correct
50 Correct 71 ms 73556 KB Output is correct
51 Correct 126 ms 74120 KB Output is correct
52 Correct 133 ms 74152 KB Output is correct
53 Correct 110 ms 73808 KB Output is correct
54 Correct 6 ms 49500 KB Output is correct
55 Correct 8 ms 49500 KB Output is correct
56 Correct 7 ms 49496 KB Output is correct
57 Correct 7 ms 49500 KB Output is correct
58 Correct 7 ms 49500 KB Output is correct
59 Correct 7 ms 49500 KB Output is correct
60 Correct 7 ms 49708 KB Output is correct
61 Correct 7 ms 49496 KB Output is correct
62 Correct 7 ms 49500 KB Output is correct
63 Correct 7 ms 49692 KB Output is correct
64 Correct 6 ms 49500 KB Output is correct
65 Correct 8 ms 49644 KB Output is correct
66 Correct 7 ms 49500 KB Output is correct
67 Correct 7 ms 49496 KB Output is correct
68 Correct 7 ms 49500 KB Output is correct
69 Correct 8 ms 49496 KB Output is correct
70 Correct 7 ms 49500 KB Output is correct
71 Correct 7 ms 49500 KB Output is correct
72 Correct 7 ms 49684 KB Output is correct
73 Correct 7 ms 49496 KB Output is correct
74 Correct 7 ms 49500 KB Output is correct
75 Correct 7 ms 49644 KB Output is correct
76 Correct 7 ms 49500 KB Output is correct
77 Correct 7 ms 49500 KB Output is correct
78 Correct 8 ms 49704 KB Output is correct
79 Correct 7 ms 49628 KB Output is correct
80 Correct 7 ms 49500 KB Output is correct
81 Correct 7 ms 49500 KB Output is correct
82 Correct 7 ms 49500 KB Output is correct
83 Correct 7 ms 49500 KB Output is correct
84 Correct 7 ms 49500 KB Output is correct
85 Correct 7 ms 49500 KB Output is correct
86 Correct 7 ms 49500 KB Output is correct
87 Correct 6 ms 49500 KB Output is correct
88 Correct 6 ms 49496 KB Output is correct
89 Correct 6 ms 49496 KB Output is correct
90 Correct 7 ms 49500 KB Output is correct
91 Correct 7 ms 49500 KB Output is correct
92 Correct 6 ms 49500 KB Output is correct
93 Correct 7 ms 49640 KB Output is correct
94 Correct 8 ms 49704 KB Output is correct
95 Correct 7 ms 49500 KB Output is correct
96 Correct 7 ms 49592 KB Output is correct
97 Correct 7 ms 49496 KB Output is correct
98 Correct 7 ms 49496 KB Output is correct
99 Correct 7 ms 49500 KB Output is correct
100 Correct 7 ms 49500 KB Output is correct
101 Correct 7 ms 49500 KB Output is correct
102 Correct 7 ms 49496 KB Output is correct
103 Correct 7 ms 49500 KB Output is correct
104 Correct 7 ms 49500 KB Output is correct
105 Correct 7 ms 49672 KB Output is correct
106 Correct 7 ms 49500 KB Output is correct
107 Correct 7 ms 49656 KB Output is correct
108 Correct 7 ms 49496 KB Output is correct
109 Correct 8 ms 49752 KB Output is correct
110 Correct 13 ms 50008 KB Output is correct
111 Correct 19 ms 51288 KB Output is correct
112 Correct 11 ms 50520 KB Output is correct
113 Correct 311 ms 50768 KB Output is correct
114 Correct 8 ms 49752 KB Output is correct
115 Correct 8 ms 49752 KB Output is correct
116 Correct 104 ms 50260 KB Output is correct
117 Correct 12 ms 50264 KB Output is correct
118 Correct 12 ms 50268 KB Output is correct
119 Correct 219 ms 55144 KB Output is correct
120 Correct 16 ms 54364 KB Output is correct
121 Correct 1211 ms 54356 KB Output is correct
122 Correct 8 ms 51804 KB Output is correct
123 Correct 8 ms 51804 KB Output is correct
124 Correct 414 ms 65768 KB Output is correct
125 Execution timed out 2059 ms 95700 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 49496 KB Output is correct
2 Correct 7 ms 49500 KB Output is correct
3 Correct 7 ms 49496 KB Output is correct
4 Correct 7 ms 49500 KB Output is correct
5 Correct 7 ms 49628 KB Output is correct
6 Correct 8 ms 49680 KB Output is correct
7 Correct 7 ms 49496 KB Output is correct
8 Correct 7 ms 49496 KB Output is correct
9 Correct 6 ms 49500 KB Output is correct
10 Correct 7 ms 49500 KB Output is correct
11 Correct 7 ms 49496 KB Output is correct
12 Correct 6 ms 49500 KB Output is correct
13 Correct 7 ms 49744 KB Output is correct
14 Correct 7 ms 49500 KB Output is correct
15 Correct 7 ms 49876 KB Output is correct
16 Correct 7 ms 49500 KB Output is correct
17 Correct 8 ms 49500 KB Output is correct
18 Correct 7 ms 49640 KB Output is correct
19 Correct 11 ms 50008 KB Output is correct
20 Correct 9 ms 50008 KB Output is correct
21 Correct 10 ms 50524 KB Output is correct
22 Correct 12 ms 50012 KB Output is correct
23 Correct 11 ms 50176 KB Output is correct
24 Correct 9 ms 50012 KB Output is correct
25 Correct 9 ms 50012 KB Output is correct
26 Correct 12 ms 50264 KB Output is correct
27 Correct 13 ms 50008 KB Output is correct
28 Correct 11 ms 50144 KB Output is correct
29 Correct 16 ms 52804 KB Output is correct
30 Correct 11 ms 50012 KB Output is correct
31 Correct 15 ms 54108 KB Output is correct
32 Correct 18 ms 52828 KB Output is correct
33 Correct 14 ms 52828 KB Output is correct
34 Correct 14 ms 52824 KB Output is correct
35 Correct 13 ms 52828 KB Output is correct
36 Correct 20 ms 52828 KB Output is correct
37 Correct 19 ms 52828 KB Output is correct
38 Correct 16 ms 52828 KB Output is correct
39 Correct 105 ms 73732 KB Output is correct
40 Correct 20 ms 53084 KB Output is correct
41 Correct 15 ms 53080 KB Output is correct
42 Correct 20 ms 53336 KB Output is correct
43 Correct 22 ms 53492 KB Output is correct
44 Correct 57 ms 61524 KB Output is correct
45 Correct 54 ms 62044 KB Output is correct
46 Correct 135 ms 86232 KB Output is correct
47 Correct 125 ms 73684 KB Output is correct
48 Correct 107 ms 73556 KB Output is correct
49 Correct 68 ms 73532 KB Output is correct
50 Correct 71 ms 73556 KB Output is correct
51 Correct 126 ms 74120 KB Output is correct
52 Correct 133 ms 74152 KB Output is correct
53 Correct 110 ms 73808 KB Output is correct
54 Correct 6 ms 49500 KB Output is correct
55 Correct 8 ms 49500 KB Output is correct
56 Correct 7 ms 49496 KB Output is correct
57 Correct 7 ms 49500 KB Output is correct
58 Correct 7 ms 49500 KB Output is correct
59 Correct 7 ms 49500 KB Output is correct
60 Correct 7 ms 49708 KB Output is correct
61 Correct 7 ms 49496 KB Output is correct
62 Correct 7 ms 49500 KB Output is correct
63 Correct 7 ms 49692 KB Output is correct
64 Correct 6 ms 49500 KB Output is correct
65 Correct 8 ms 49644 KB Output is correct
66 Correct 7 ms 49500 KB Output is correct
67 Correct 7 ms 49496 KB Output is correct
68 Correct 7 ms 49500 KB Output is correct
69 Correct 8 ms 49496 KB Output is correct
70 Correct 7 ms 49500 KB Output is correct
71 Correct 7 ms 49500 KB Output is correct
72 Correct 7 ms 49684 KB Output is correct
73 Correct 7 ms 49496 KB Output is correct
74 Correct 7 ms 49500 KB Output is correct
75 Correct 7 ms 49644 KB Output is correct
76 Correct 7 ms 49500 KB Output is correct
77 Correct 7 ms 49500 KB Output is correct
78 Correct 8 ms 49704 KB Output is correct
79 Correct 7 ms 49628 KB Output is correct
80 Correct 7 ms 49500 KB Output is correct
81 Correct 7 ms 49500 KB Output is correct
82 Correct 7 ms 49500 KB Output is correct
83 Correct 7 ms 49500 KB Output is correct
84 Correct 7 ms 49500 KB Output is correct
85 Correct 7 ms 49500 KB Output is correct
86 Correct 7 ms 49500 KB Output is correct
87 Correct 6 ms 49500 KB Output is correct
88 Correct 6 ms 49496 KB Output is correct
89 Correct 6 ms 49496 KB Output is correct
90 Correct 7 ms 49500 KB Output is correct
91 Correct 7 ms 49500 KB Output is correct
92 Correct 6 ms 49500 KB Output is correct
93 Correct 7 ms 49640 KB Output is correct
94 Correct 8 ms 49704 KB Output is correct
95 Correct 7 ms 49500 KB Output is correct
96 Correct 7 ms 49592 KB Output is correct
97 Correct 7 ms 49496 KB Output is correct
98 Correct 7 ms 49496 KB Output is correct
99 Correct 7 ms 49500 KB Output is correct
100 Correct 7 ms 49500 KB Output is correct
101 Correct 7 ms 49500 KB Output is correct
102 Correct 7 ms 49496 KB Output is correct
103 Correct 7 ms 49500 KB Output is correct
104 Correct 7 ms 49500 KB Output is correct
105 Correct 7 ms 49672 KB Output is correct
106 Correct 7 ms 49500 KB Output is correct
107 Correct 7 ms 49656 KB Output is correct
108 Correct 7 ms 49496 KB Output is correct
109 Correct 8 ms 49752 KB Output is correct
110 Correct 13 ms 50008 KB Output is correct
111 Correct 19 ms 51288 KB Output is correct
112 Correct 11 ms 50520 KB Output is correct
113 Correct 311 ms 50768 KB Output is correct
114 Correct 8 ms 49752 KB Output is correct
115 Correct 8 ms 49752 KB Output is correct
116 Correct 104 ms 50260 KB Output is correct
117 Correct 12 ms 50264 KB Output is correct
118 Correct 12 ms 50268 KB Output is correct
119 Correct 219 ms 55144 KB Output is correct
120 Correct 16 ms 54364 KB Output is correct
121 Correct 1211 ms 54356 KB Output is correct
122 Correct 8 ms 51804 KB Output is correct
123 Correct 8 ms 51804 KB Output is correct
124 Correct 414 ms 65768 KB Output is correct
125 Execution timed out 2059 ms 95700 KB Time limit exceeded
126 Halted 0 ms 0 KB -