摘要:
#include <cstdio>#include <iostream>const int MAX = 1000005; using namespace std; int num[MAX], pre_max[MAX]; inline int max(int a, int b){ return a > 阅读全文
摘要:
#include <stdio.h>#include <string.h>#define BASE 10000#define PFMT "%04d"#define MAX 105 void print_bn(int*a, int l){ int i; for(i=l-1;i>0;i--)if(a[i 阅读全文
摘要:
#include <stdio.h>#include <string.h> int main(void){ int n,i,j,k,l; char o1[10],o2[10],s[10],h[20]; while(scanf("%d %s %s", &n, o1, o2)!=EOF) { memse 阅读全文
摘要:
#include <stdio.h> int fib(int m){ int n_2=1,n_1=2,n,i; if(m==0)return 1; if(m==1)return 2; for(i=2;i<=m;i++) { n=(n_2+n_1)%3; n_2=n_1; n_1=n; } retur 阅读全文
摘要:
#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; while(txt[i] 阅读全文
摘要:
#include <stdio.h> int gcd(int a, int b){ int t; while(t=a%b) { a=b; b=t; } return b;} int main(void){ int t,m,n,i,g,lcm; scanf("%d",&t); while(t--) { 阅读全文
摘要:
#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++) sum+ 阅读全文
摘要:
#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 <string.h> int prime[38]={0,0,1,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1};int visit[21]={0,0,0 阅读全文
摘要:
#include <stdio.h>#include <string.h>#include <stdlib.h> int cmp(void* a, void* b){ return *((char*)a)-*((char*)b);} void solve(int t, char* dic){ int 阅读全文
摘要:
#include <stdio.h> int gcd(int a, int b){ int t; while(t=a%b) { a=b; b=t; } return b;} int main(void){ int s,m,i; while(scanf("%d %d", &s, &m)!=EOF) { 阅读全文
摘要:
#include<stdio.h> #include<string.h> int main() { char num[1000]; int len,sum,i; while(scanf("%s",&num)!=EOF) { len=strlen(num); if(len==1 && num[0]== 阅读全文
摘要:
#include<iostream>#include<stdio.h> using namespace std; int jiechen(int n){ int i; int ans=1; for(i=1;i<=n;i++) ans*=i; return ans;} int main(){ int 阅读全文