标签:des style blog color java os io strong for
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1101 Accepted Submission(s): 658
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<queue> #include<stack> #include<set> #include<algorithm> #include<cstring> #include<stdlib.h> #include<math.h> #include<map> using namespace std; #define ll long long int main(){ int n,m; while(cin>>n>>m,n+m){ if(n>m) swap(n,m); int k=m-n; if(int(k*1.0*(1+sqrt(5))/2)==n&&m==n+k){ cout<<0<<endl; continue; } cout<<1<<endl; int a,b; for(int i=1;i<=n;i++) if(n-i==int(k*1.0*(1+sqrt(5))/2)&&m-i==n-i+k) cout<<n-i<<" "<<m-i<<endl; for(int j=m;j>=0;j--){ a=n,b=j; if(a>b) swap(a,b); k=b-a; if(a==int(k*1.0*(1+sqrt(5))/2)&&b==a+k) cout<<a<<" "<<b<<endl; } } }
标签:des style blog color java os io strong for
原文地址:http://www.cnblogs.com/ainixu1314/p/3931916.html