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

 

6343.Problem L. Graph Theory Homework

 

官方题解:

一篇写的很好的博客:

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

 

代码:

 1 //1012-6343-数学
 2 #include<iostream>
 3 #include<cstdio>
 4 #include<cstring>
 5 #include<algorithm>
 6 #include<bitset>
 7 #include<cassert>
 8 #include<cctype>
 9 #include<cmath>
10 #include<cstdlib>
11 #include<ctime>
12 #include<deque>
13 #include<iomanip>
14 #include<list>
15 #include<map>
16 #include<queue>
17 #include<set>
18 #include<stack>
19 #include<vector>
20 using namespace std;
21 typedef long long ll;
22 
23 const double PI=acos(-1.0);
24 const double eps=1e-6;
25 const ll mod=1e9+7;
26 const int inf=0x3f3f3f3f;
27 const int maxn=1e5+10;
28 #define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
29 
30 int a[maxn];
31 
32 int main()
33 {
34     int t;
35     cin>>t;
36     while(t--){
37         int n;
38         cin>>n;
39         for(int i=1;i<=n;i++)
40             cin>>a[i];
41         int ans=floor(sqrt(abs(a[1]-a[n])));
42         cout<<ans<<endl;
43     }
44 }

 

 

 

 

滚了。。。

 

转载于:https://www.cnblogs.com/ZERO-/p/9469324.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值