HDU 6343.Problem L. Graph Theory Homework-数学 (2018 Multi-University Training Contest 4 1012)

时间:2024-07-23 19:04:50

6343.Problem L. Graph Theory Homework

官方题解:

HDU 6343.Problem L. Graph Theory Homework-数学 (2018 Multi-University Training Contest 4 1012)

一篇写的很好的博客:

HDU 6343 - Problem L. Graph Theory Homework - [(伪装成图论题的)简单数学题]

代码:

 //1012-6343-数学
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<deque>
#include<iomanip>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
using namespace std;
typedef long long ll; const double PI=acos(-1.0);
const double eps=1e-;
const ll mod=1e9+;
const int inf=0x3f3f3f3f;
const int maxn=1e5+;
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); int a[maxn]; int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
for(int i=;i<=n;i++)
cin>>a[i];
int ans=floor(sqrt(abs(a[]-a[n])));
cout<<ans<<endl;
}
}

滚了。。。