Submission #767206

# Submission time Handle Problem Language Result Execution time Memory
767206 2023-06-26T13:54:16 Z Ahmed57 Game (APIO22_game) C++17
0 / 100
1 ms 1436 KB
#include <bits/stdc++.h>

using namespace std;
bool arr[1001][50001];
int mi[1001];
int N,K;
vector<int> adj[50001];
void dfs(int i,int boss){
    arr[boss][i] = 1;
    mi[boss] = min(mi[boss],i);
    for(auto j:adj[i]){
        if(!arr[boss][j])dfs(j,boss);
    }
}
void init(int n, int k){
    N = n , K = k;
    for(int i = 0;i<k;i++){
        mi[i] = 1e9;
        arr[i][i] = 1;
    }
}
int add_teleporter(int u, int v){
    adj[u].push_back(v);
    bool ss = 0;
    for(int i = 0;i<K;i++){
        if(arr[i][u]&&(!arr[i][v])){
            dfs(v,i);
        }
        if(mi[i]<=i){
            ss = 1;
        }
    }
    return ss;
}/*
int main(){
    init(6,3);
    cout<<add_teleporter(3, 4)<<endl;
    cout<<add_teleporter(5, 0)<<endl;
    cout<<add_teleporter(4, 5)<<endl;
    cout<<add_teleporter(5, 3)<<endl;
    cout<<add_teleporter(1, 4)<<endl;
}
*/
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1436 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1436 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1436 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1436 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1436 KB Wrong Answer[1]
2 Halted 0 ms 0 KB -