# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1118916 | 2024-11-26 11:29:12 | ALTAKEXE | Robots (APIO13_robots) | C++17 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<algorithm>
#include<vector>
#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<queue>
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define REP(i,m) for(int i=0;i<(int)m;++i)
#define REPN(i,m,in) for(int i=in;i<(int)m;++i)
#define ALL(t) (t).begin(),(t).end()
#define dump(x) cerr<<#x<<" = "<<x<<endl
#define prl cerr<<"LINE "<<__LINE__<<" is called"<<endl
using namespace std;
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' '; cerr<<endl ; }
typedef pair<int,int> pi;
typedef long long int lint;
const int INF=510000000;
char buf[505][505];
int dp[50][505][505];
pi g[505][505][4];
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Compilation message (stderr)
robots.cpp: In function 'void prep(int, int, int)': robots.cpp:56:12: error: reference to 'hash' is ambiguous 56 | dp[hash[id][id+1]][sy][sx]=0; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:67:31: error: reference to 'hash' is ambiguous 67 | if(dp[hash[id][id+1]][to.fr][to.sc]!=-1) continue; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:69:28: error: reference to 'hash' is ambiguous 69 | dp[hash[id][id+1]][to.fr][to.sc]=dp[hash[id][id+1]][cur.fr][cur.sc]+1; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:69:61: error: reference to 'hash' is ambiguous 69 | dp[hash[id][id+1]][to.fr][to.sc]=dp[hash[id][id+1]][cur.fr][cur.sc]+1; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:75:33: error: reference to 'hash' is ambiguous 75 | REP(i,h) REP(j,w) if(dp[hash[id][id+1]][i][j]==-1) dp[hash[id][id+1]][i][j]=INF; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:75:63: error: reference to 'hash' is ambiguous 75 | REP(i,h) REP(j,w) if(dp[hash[id][id+1]][i][j]==-1) dp[hash[id][id+1]][i][j]=INF; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp: In function 'int main()': robots.cpp:83:33: error: reference to 'hash' is ambiguous 83 | REP(i,9) REPN(j,10,i+1) hash[i][j]=cntt++; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:109:28: error: reference to 'hash' is ambiguous 109 | dp[hash[i][j]][y][x]=INF; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:112:36: error: reference to 'hash' is ambiguous 112 | dp[hash[i][j]][y][x]=min(dp[hash[i][j]][y][x],dp[hash[i][div]][y][x]+dp[hash[div][j]][y][x]); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:112:61: error: reference to 'hash' is ambiguous 112 | dp[hash[i][j]][y][x]=min(dp[hash[i][j]][y][x],dp[hash[i][div]][y][x]+dp[hash[div][j]][y][x]); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:112:82: error: reference to 'hash' is ambiguous 112 | dp[hash[i][j]][y][x]=min(dp[hash[i][j]][y][x],dp[hash[i][div]][y][x]+dp[hash[div][j]][y][x]); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:112:105: error: reference to 'hash' is ambiguous 112 | dp[hash[i][j]][y][x]=min(dp[hash[i][j]][y][x],dp[hash[i][div]][y][x]+dp[hash[div][j]][y][x]); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:114:31: error: reference to 'hash' is ambiguous 114 | if(dp[hash[i][j]][y][x]!=INF){ | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:115:44: error: reference to 'hash' is ambiguous 115 | used.pb(dp[hash[i][j]][y][x]); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:116:46: error: reference to 'hash' is ambiguous 116 | posByCost[dp[hash[i][j]][y][x]].pb(mp(y,x)); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:117:53: error: reference to 'hash' is ambiguous 117 | mini=min(mini,mp(dp[hash[i][j]][y][x],mp(y,x))); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:128:34: error: reference to 'hash' is ambiguous 128 | int c=dp[hash[i][j]][p.fr][p.sc]; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:132:47: error: reference to 'hash' is ambiguous 132 | if(dp[hash[i][j]][p2.fr][p2.sc]<c+1) continue; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:139:53: error: reference to 'hash' is ambiguous 139 | if(nxt.fr==-2 || dp[hash[i][j]][nxt.fr][nxt.sc]<=c+1) continue; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:140:36: error: reference to 'hash' is ambiguous 140 | dp[hash[i][j]][nxt.fr][nxt.sc]=c+1; | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:153:42: error: reference to 'hash' is ambiguous 153 | REP(i,h) REP(j,w) res=min(res,dp[hash[0][n]][i][j]); | ^~~~ In file included from /usr/include/c++/10/functional:56, from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13, from /usr/include/c++/10/algorithm:74, from robots.cpp:1: /usr/include/c++/10/bits/functional_hash.h:58:12: note: candidates are: 'template<class _Tp> struct std::hash' 58 | struct hash; | ^~~~ robots.cpp:52:5: note: 'int hash [10][10]' 52 | int hash[10][10]; | ^~~~ robots.cpp:84:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result] 84 | scanf("%d%d%d",&n,&w,&h); | ~~~~~^~~~~~~~~~~~~~~~~~~ robots.cpp:86:23: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result] 86 | REP(i,h) scanf("%s",buf[i]); | ~~~~~^~~~~~~~~~~~~