Submission #1113790

# Submission time Handle Problem Language Result Execution time Memory
1113790 2024-11-17T13:03:25 Z salmon Island Hopping (JOI24_island) C++17
0 / 100
1 ms 336 KB
#include "island.h"
#include <bits/stdc++.h>
using namespace std;

void solve(int N, int L) {
    bool done[400];

    for(int i = 0; i <= N; i++){
        done[i] = false;
    }

    vector<int> v;
    int inv[400];

    inv[1] = -1;
    for(int i = 0; i < N; i++){
        v.push_back(query(1,i));
        inv[v[i]] = i;
    }

    for(int i = 0; i < N; i++){
        if(done[v[i]]) continue;

        int cont = 0;
        while(true){
            int num = query(v[i],cont);

            if(inv[num] < i){
                answer(num,v[i]);
                break;
            }
            else{
                answer(num,v[i]);
                done[inv[num]] = true;
            }

            cont++;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -