QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#647255 | #5440. P-P-Palindrome | Cure_Beauty | WA | 0ms | 3900kb | C++14 | 962b | 2024-10-17 13:02:44 | 2024-10-17 13:02:48 |
Judging History
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<<"犬饲小麦";
}//第一百五回 锦衣军查抄宁国府 骢马使弹劾平安州
Details
Tip: Click on the bar to expand more detailed information
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