QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#647255#5440. P-P-PalindromeCure_BeautyWA 0ms3900kbC++14962b2024-10-17 13:02:442024-10-17 13:02:48

Judging History

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

  • [2024-10-17 13:02:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3900kb
  • [2024-10-17 13:02:44]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<iomanip>
using std::cin;using std::cout;
constexpr int N=33;
int n,m,k;
std::vector<int>g[N];
namespace sub1_2{
	int x,ans=1e9;
	bool vis[N];
	inline void dfs(int u,int dis){
		if(u==x){ans=std::min(ans,dis);return ;}
		for(int i:g[u])
			if(!vis[i]){
				vis[i]=1;
				dfs(i,dis+1);
				vis[i]=0;
			}
	}
	signed main(){
		cin>>x;
		vis[1]=1;dfs(1,0);vis[1]=0;
		cout<<std::fixed<<std::setprecision(9)<<(ans==2*m?0:1.0*(n-ans+1)/n);
		return 0;
	}
}
signed main(){
//	freopen("random.in","r",stdin);
//	freopen("random.out","w",stdout);
	std::ios::sync_with_stdio(false);
	cin.tie(nullptr);cout.tie(nullptr);
	cin>>n>>m>>k;for(int i=1,u,v;i<=m;++i){cin>>u>>v;g[u].push_back(v);g[v].push_back(u);}
	if(k==1) return sub1_2::main();
	return sub1_2::main();cout<<"犬饲小麦";
}//第一百五回 锦衣军查抄宁国府 骢马使弹劾平安州

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3900kb

input:

2
aaaa
aaa

output:

-499999998.500000000

result:

wrong output format Expected integer, but "-499999998.500000000" found