#include<stdio.h>int main(){ int n,u,d; while(scanf("%d%d%d",&n,&u,&d),n) { int t=(n-u)/(u-d); if(t*(u-d)<(n-u)) t++; t*=2...
#include<iostream> #include<algorithm> using namespace std; bool cmp(int a,int b) { return a>b; //从大到小排序 } int a[30],m; char s[100...
#include<stdio.h>const int MAXN=1000;int a[MAXN];int main(){ int n; int i; while(scanf("%d",&n),n) { for(i=0;i<n;i++) scanf("%d",&a[...
#include<stdio.h>#include<string.h>int step,n,m;int a[1010][1010];char map[11][11];void DFS(int x,int y){ while(x>=0&&y>=0&&x<n&&y<m&&map[x][y]!='O')......
#include<stdio.h>#include<string.h>const int MAXN=130;int dp[MAXN][MAXN];//dp[i][j]表示 i 表示成最大的数不超过 j 的方法数int calc(int n,int m){ if(dp[n][m]!=-1) ret...
#include<stdio.h>#include<math.h>void find(int n,int &l,int &r,int &level){ int i; level=1; for(i=1;;i+=2) { if(n-i<=0) { ...
#include <iostream> using namespace std; int main() { int a,b,t,i,max; while(cin >> a >> b) { cout << a << " " << b << " "; ......
#include <stdio.h>int judge(int a, int b, int m){return (a*a+b*b+m)%(a*b)==0;}int count(int m, int n){int i,j,c;c=0;for(i=1;i<n;i++){for(j=i+1...
#include <stdio.h>#include <math.h>int main(void){int t,n,i;double sum;scanf("%d", &t);while(t--){scanf("%d",&n);sum=0;for(i=2;i<=n;i++)...
#include <stdio.h>int main(void){int n,i,c;char txt[10001];scanf("%d", &n);while(n--){scanf("%s",txt);i=0;while(txt[i++]){c=1;wh...