QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#798348#408. Dungeon 2yinheeCompile Error//C++142.1kb2024-12-04 12:37:412024-12-04 12:37:41

Judging History

你现在查看的是最新测评结果

  • [2024-12-04 12:37:41]
  • 评测
  • [2024-12-04 12:37:41]
  • 提交

answer

#include<bits/stdc++.h>
#include "graph.h"
using namespace std;
namespace my_std{
#define mems(x,y) memset(x,y,sizeof x)
#define Mp make_pair
#define eb emplace_back
#define gc getchar
#define pc putchar
#define fi first
#define se second
#define il inline
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define drep(i,a,b) for(int i=(a);i>=(b);i--)
#define go(i,u) for(int i=head[u];i;i=e[i].nxt)
	typedef long long ll;
	typedef pair<int,int> pii;
	template<typename T>
	il void read(T &x){
		int f=1;x=0;char c=gc();
		while(c<'0'||c>'9'){
			if(c=='-'){
				f=-1;
			}
			c=gc();
		}
		while(c>='0'&&c<='9'){
			x=x*10+c-48,c=gc();
		}
		x*=f;
	}
	template<typename T,typename ...Args>
	void read(T &x,Args &...args){
		read(x),read(args...);
	}
	template<typename T>
	il void write(T x){
		char buf[43];int len=0;
		if(x<0){
			pc('-'),x=-x;
		}
		do{
			buf[++len]=x%10,x/=10;
		}while(x);
		while(len){
			pc(buf[len--]+'0');
		}
	}
}
using namespace my_std;
const int N=207,M=-1,inf=0x3f3f3f3f,mod=0;
const ll INF=1ll*inf*inf;
int n,m,pw,cur,deg[N],f[N][N],g[N][N],dis[N][N],ans[N];
bool pd[N][N];
void dfs1(int u){
	n++;
	deg[u]=NumberOfRoads();
	rep(i,1,deg[u]){
		Move(i,2);
		if(Color()==2){
			Move(LastRoad(),2);
			continue;
		}
		if(Color()==3){
			Move(LastRoad(),3);
			pd[u][i]=1;
			continue;
		}
		int v=f[u][i]=g[u][i]=++cur;
		int frm=LastRoad();
		dfs1(v);
		Move(frm,3);
	}
}
void dfs2(int u){
	rep(i,1,deg[u]){
		if(f[u][i]){
			Move(i,u/pw%3+1);
			int v=f[u][i],frm=LastRoad();
			dfs2(v);
			Move(frm,v/pw%3+1);
		}else if(pd[u][i]){
			Move(i,u/pw%3+1);
			g[u][i]+=(Color()-1)*pw;
			Move(LastRoad(),Color());
		}
	}
}
void Inspect(int R){
	pw=cur=1,dfs1(1);
	rep(i,0,4){
		dfs2(1);
		pw*=3;
	}
	mems(dis,0x3f);
	rep(i,1,n){
		rep(j,1,deg[i]){
			int u=g[i][j];
			if(u){
				dis[i][u]=dis[u][i]=1;
			}
		}
	}
	rep(k,1,n){
		rep(i,1,n){
			rep(j,1,n){
				dis[i][j]=min(dis[i][j],dis[i][k]+dis[k][j]);
			}
		}
	}
	rep(i,1,n){
		rep(j,i+1,n){
			ans[dis[i][j]]++;
		}
	}
	rep(i,1,R){
		Answer(i,ans[i]);
	}
}

Details

implementer.cpp: In function ‘int main()’:
implementer.cpp:94:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   94 |                 scanf("%d", &(n_roads[i]));
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~
implementer.cpp:98:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   98 |                         scanf("%d", &(road[i][j]));
      |                         ~~~~~^~~~~~~~~~~~~~~~~~~~~
implementer.cpp:105:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  105 |                 scanf("%d", &(expected_answer[i]));
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:2:10: fatal error: graph.h: No such file or directory
    2 | #include "graph.h"
      |          ^~~~~~~~~
compilation terminated.