Submission #1341664

#TimeUsernameProblemLanguageResultExecution timeMemory
1341664antarbanikWorld Map (IOI25_worldmap)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define pb push_back
#define ppb pop_back
#define ff first
#define ss second



// vector<int>G[42];



void f(vector<vector<int>> &ans, int cur){
    if(cur == 0) return;
    int x = cur - 1;
    for(int i = 0;i<=x;++i) ans[i][x] = cur;
    for(int i = 0;i<=x-1;++i) ans[x][i] = cur;
    f(ans, cur - 1);
}



vector<vector<int>> create_map(int N, int M, vector<int> A, vector<int> B){

    // for(int i = 0;i<m;++i){
    //     G[A[i]].pb(B[i]);
    //     G[B[i]].pb(A[i]);
    // }


    vector<vector<int>> ans(N, vector<int> (N, 0));

    f(ans, n);
    // for(int i = 0;i<N;++i){
    //     for(int j = 0;j<N;++j){
    //         cout<<ans[i][j]<<" ";
    //     }
    //     cout<<endl;
    // }
    return ans;
}



// int main(){
//     vector<vector<int>> ans = create_map(5, 4, {1, 2}, {2, 3});

//     for(int i = 0;i<ans.size();++i){
//         for(int j = 0;j<ans.size();++j){
//             cout<<ans[i][j]<<" ";
//         }
//         cout<<endl;
//     }

// }

Compilation message (stderr)

worldmap.cpp: In function 'std::vector<std::vector<int> > create_map(int, int, std::vector<int>, std::vector<int>)':
worldmap.cpp:36:12: error: 'n' was not declared in this scope
   36 |     f(ans, n);
      |            ^