Submission #1260684

#TimeUsernameProblemLanguageResultExecution timeMemory
1260684riddlesWorld Map (IOI25_worldmap)C++20
Compilation error
0 ms0 KiB
#include "worldmap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef map<ll, ll> mp; typedef pair<ll, ll> pll; typedef queue<ll> qi; typedef vector<ll> vi; typedef vector <vi> vvi; typedef vector <pll> vpl; typedef vector <string> vs; #define YES cout<<"YES\n" #define Yes cout<<"Yes\n" #define NO cout<<"NO\n" #define No cout<<"No\n" #define f first #define s second #define pb push_back #define all(x) begin(x), end(x) int n, m; vector<int> a, b; vector<vector<int>> create_map(int N, int M, vector<int> A, vector<int> B) { n=N; m=M; a=A; b=B; //vector<vector<int>> ans((n-1), vector<int>((n-1), 1)); if(n>=3){ vector<vector<int>> ans((n-1), vector<int>((n-1), 1)); for(ll i=0; i<n-1; i++){ for(ll j=0; j<n-1; j++){ if(i%2==0) ans[i][j]=j+1; else ans[i][j]=j+2; } }} else{ vector<vector<int>> ans((n), vector<int>((n), 1)); if(n==1) ans[0][0]=1; else{ ans[0][0]=1; ans[0][1]=2; ans[1][0]=2; ans[1][1]=1; } } return ans; }

Compilation message (stderr)

worldmap.cpp: In function 'std::vector<std::vector<int> > create_map(int, int, std::vector<int>, std::vector<int>)':
worldmap.cpp:48:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |   return ans;
      |          ^~~
      |          abs