Submission #1113512

# Submission time Handle Problem Language Result Execution time Memory
1113512 2024-11-16T17:13:42 Z imarn Island Hopping (JOI24_island) C++17
100 / 100
18 ms 764 KB
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define plx pair<ll,int>
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(),x.end()
#define szz(r) (ll)r.size()
#define vi vector<int>
#define vvi vector<vi>
#define pp pair<ll,int>
#define ub(x,i) upper_bound(all(x),i)-x.begin()
using namespace std;
#include "island.h"

void solve(int N, int L) {int n=N;
    vector<int>vec;
    for(int i=1;i<=n-1;i++)vec.pb(query(1,i));
    int pr[N+1]={0};pr[1]=1;
    for(int i=2;i<=n;i++){
        int u=vec[i-2];
        if(pr[u])continue;
        for(int j=1;j<=n-1;j++){
            int v=query(u,j);
            if(!pr[v]){pr[v]=u;}
            else {pr[u]=v;break;}
        }
    }
    for(int i=2;i<=n;i++)answer(pr[i],i);
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 14 ms 336 KB Output is correct
6 Correct 15 ms 336 KB Output is correct
7 Correct 15 ms 336 KB Output is correct
8 Correct 14 ms 336 KB Output is correct
9 Correct 11 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 336 KB Output is correct
2 Correct 11 ms 336 KB Output is correct
3 Correct 15 ms 440 KB Output is correct
4 Correct 13 ms 336 KB Output is correct
5 Correct 12 ms 336 KB Output is correct
6 Correct 14 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 14 ms 336 KB Output is correct
3 Correct 13 ms 336 KB Output is correct
4 Correct 11 ms 592 KB Output is correct
5 Correct 14 ms 336 KB Output is correct
6 Correct 15 ms 336 KB Output is correct
7 Correct 11 ms 336 KB Output is correct
8 Correct 14 ms 336 KB Output is correct
9 Correct 12 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 336 KB Output is correct
2 Correct 13 ms 336 KB Output is correct
3 Correct 12 ms 336 KB Output is correct
4 Correct 18 ms 440 KB Output is correct
5 Correct 10 ms 336 KB Output is correct
6 Correct 14 ms 336 KB Output is correct
7 Correct 11 ms 592 KB Output is correct
8 Correct 13 ms 336 KB Output is correct
9 Correct 14 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
5 Correct 14 ms 336 KB Output is correct
6 Correct 15 ms 336 KB Output is correct
7 Correct 15 ms 336 KB Output is correct
8 Correct 14 ms 336 KB Output is correct
9 Correct 11 ms 336 KB Output is correct
10 Correct 1 ms 336 KB Output is correct
11 Correct 14 ms 336 KB Output is correct
12 Correct 13 ms 336 KB Output is correct
13 Correct 11 ms 592 KB Output is correct
14 Correct 14 ms 336 KB Output is correct
15 Correct 15 ms 336 KB Output is correct
16 Correct 11 ms 336 KB Output is correct
17 Correct 14 ms 336 KB Output is correct
18 Correct 12 ms 336 KB Output is correct
19 Correct 14 ms 336 KB Output is correct
20 Correct 15 ms 504 KB Output is correct
21 Correct 10 ms 336 KB Output is correct
22 Correct 15 ms 336 KB Output is correct
23 Correct 13 ms 336 KB Output is correct
24 Correct 11 ms 336 KB Output is correct
25 Correct 11 ms 336 KB Output is correct
26 Correct 13 ms 336 KB Output is correct
27 Correct 11 ms 336 KB Output is correct
28 Correct 17 ms 336 KB Output is correct
29 Correct 13 ms 336 KB Output is correct
30 Correct 11 ms 336 KB Output is correct
31 Correct 13 ms 336 KB Output is correct
32 Correct 11 ms 336 KB Output is correct
33 Correct 13 ms 440 KB Output is correct
34 Correct 16 ms 336 KB Output is correct
35 Correct 13 ms 508 KB Output is correct
36 Correct 15 ms 336 KB Output is correct
37 Correct 14 ms 336 KB Output is correct
38 Correct 14 ms 336 KB Output is correct
39 Correct 13 ms 336 KB Output is correct
40 Correct 13 ms 336 KB Output is correct
41 Correct 14 ms 336 KB Output is correct
42 Correct 15 ms 432 KB Output is correct
43 Correct 14 ms 444 KB Output is correct
44 Correct 12 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 15 ms 336 KB Output is correct
5 Correct 13 ms 336 KB Output is correct
6 Correct 12 ms 336 KB Output is correct
7 Correct 18 ms 440 KB Output is correct
8 Correct 10 ms 336 KB Output is correct
9 Correct 14 ms 336 KB Output is correct
10 Correct 11 ms 592 KB Output is correct
11 Correct 13 ms 336 KB Output is correct
12 Correct 14 ms 336 KB Output is correct
13 Correct 15 ms 336 KB Output is correct
14 Correct 14 ms 504 KB Output is correct
15 Correct 14 ms 336 KB Output is correct
16 Correct 13 ms 764 KB Output is correct
17 Correct 14 ms 336 KB Output is correct
18 Correct 12 ms 336 KB Output is correct
19 Correct 13 ms 336 KB Output is correct
20 Correct 14 ms 336 KB Output is correct
21 Correct 11 ms 336 KB Output is correct
22 Correct 17 ms 336 KB Output is correct
23 Correct 10 ms 336 KB Output is correct
24 Correct 11 ms 336 KB Output is correct
25 Correct 15 ms 584 KB Output is correct
26 Correct 16 ms 504 KB Output is correct
27 Correct 15 ms 336 KB Output is correct
28 Correct 15 ms 436 KB Output is correct
29 Correct 13 ms 336 KB Output is correct
30 Correct 12 ms 592 KB Output is correct
31 Correct 15 ms 336 KB Output is correct
32 Correct 14 ms 584 KB Output is correct
33 Correct 14 ms 336 KB Output is correct
34 Correct 13 ms 336 KB Output is correct
35 Correct 15 ms 440 KB Output is correct
36 Correct 14 ms 336 KB Output is correct
37 Correct 15 ms 336 KB Output is correct
38 Correct 15 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 336 KB Output is correct
2 Correct 11 ms 336 KB Output is correct
3 Correct 15 ms 440 KB Output is correct
4 Correct 13 ms 336 KB Output is correct
5 Correct 12 ms 336 KB Output is correct
6 Correct 14 ms 336 KB Output is correct
7 Correct 15 ms 336 KB Output is correct
8 Correct 14 ms 428 KB Output is correct
9 Correct 11 ms 336 KB Output is correct
10 Correct 16 ms 336 KB Output is correct
11 Correct 12 ms 336 KB Output is correct
12 Correct 16 ms 440 KB Output is correct
13 Correct 14 ms 336 KB Output is correct
14 Correct 14 ms 336 KB Output is correct
15 Correct 12 ms 336 KB Output is correct
16 Correct 14 ms 336 KB Output is correct
17 Correct 13 ms 336 KB Output is correct
18 Correct 15 ms 336 KB Output is correct
19 Correct 17 ms 336 KB Output is correct
20 Correct 13 ms 336 KB Output is correct
21 Correct 16 ms 436 KB Output is correct
22 Correct 14 ms 336 KB Output is correct
23 Correct 17 ms 336 KB Output is correct
24 Correct 15 ms 336 KB Output is correct
25 Correct 10 ms 336 KB Output is correct
26 Correct 9 ms 608 KB Output is correct
27 Correct 13 ms 336 KB Output is correct
28 Correct 16 ms 336 KB Output is correct
29 Correct 14 ms 348 KB Output is correct
30 Correct 14 ms 336 KB Output is correct
31 Correct 15 ms 336 KB Output is correct
32 Correct 15 ms 436 KB Output is correct
33 Correct 15 ms 336 KB Output is correct
34 Correct 15 ms 444 KB Output is correct
35 Correct 14 ms 336 KB Output is correct
36 Correct 16 ms 336 KB Output is correct
37 Correct 17 ms 336 KB Output is correct
38 Correct 13 ms 336 KB Output is correct
39 Correct 15 ms 592 KB Output is correct
40 Correct 10 ms 504 KB Output is correct