随笔分类 - hdu 水题
摘要:1 #include<stdio.h> 2 int main() 3 { 4 int a,b,k,x,y; 5 int flag,i; 6 while(scanf("%d%d%d",&a,&b,&k)!=EOF) 7 { 8 if(a==0&&b==0) 9 break;10 flag=1;11 x=a,y=b;12 for(i=1;i<=k;i++)13 {14 if(a%10==b%10)15 a/...
阅读全文
摘要:1 #include<stdio.h> 2 #include<algorithm> 3 using namespace std; 4 #define maxn 1000001 5 __int64 a[maxn]; 6 void init() 7 { 8 __int64 i,temp; 9 __int64 count;10 for(i=1;i<maxn;i++)11 {12 count=1;13 temp=i;14 while(temp!=1)15 {16 if(temp%2...
阅读全文
摘要:1 //二分查找 2 #include<stdio.h> 3 #include<math.h> 4 #define eps 1e-7 5 double fun(double x) 6 { 7 return 8*pow(x,4)+7*pow(x,3)+2*pow(x,2)+3*x+6; 8 } 9 double bin_search(double Y)10 {11 double low=0.0,high=100.0,mid;12 while(high-low>eps)13 {14 mid=(low+high)/2.0;15 if(...
阅读全文
摘要:1 #include<stdio.h> 2 int main() 3 { 4 __int64 a,b,ans; 5 while(scanf("%I64X%I64X",&a,&b)!=EOF) 6 { 7 ans=a+b; 8 if(ans<0) 9 {10 printf("-");11 ans=-ans;12 }13 printf("%I64X\n",ans);14 }15 return 0;16 }
阅读全文
摘要://我想说的是这题描述有点问题,不清楚,水题就没什么好说的了#include<stdio.h>#define min(x,y)(x)>(y)?(y):(x)int main(){ int t; int n,m,ans,c,i; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); ans=10000000; for(i=1;i<=n;i++) { scanf("%d",&c); ans=min(ans,c); ...
阅读全文
浙公网安备 33010602011771号