11 2021 档案
摘要:#include<iostream> #include<queue> #include<cstring> using namespace std; #define maxn 105 int a,b,c; bool visit[maxn][maxn]; struct node{ int a,b,cnt
阅读全文
摘要:#include<iostream> #include<queue> #include<cstring> using namespace std; #define mn 35 int l,r,c,result; const int da[] = {1,-1,0,0,0,0},db[] = {0,0,
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; int main(){ int s,t,r,n,k,tmp,tmp2; scanf("%d%d",&n,&k); while(k--){ scanf("%d%d%d",&s,&t,&r);
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ int n,s; char data[20][20]; scanf("%d%d",&n,&s); memset(data,' ',sizeof data); f
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; int main(){ int b,n,result,i,minj,minx,tmp; while(scanf("%d%d",&b,&n)==2&&b){ minx = 1000005;
阅读全文
摘要:#include<iostream> using namespace std; int main(){ char a[100]; while(gets(a)){ printf("%s\n",a); } return 0; }
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; #define PI 3.14159265 int main(){ double D,d,s; int n,result; scanf("%d",&n); while(n--){ scan
阅读全文
摘要:#include<iostream> using namespace std; int main(){ long long n,m,result; int i,cnt,cnt_sum; scanf("%d",&cnt_sum); for(int cnt=1;cnt<=cnt_sum;cnt++){
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ int n,cnt,result; char a[100],b[100]; int dataA[26],dataB[26]; scanf("%d\n",&n);
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int l,m,result,start,end; while(scanf("%d%d",&l,&m)==2&&l){ result = l+1; while(m--){ scanf("%d%d"
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; int main(){ long long n,a,b,c,n1,result; scanf("%lld",&n); while(n--){ scanf("%lld%lld",&a,&b)
阅读全文
摘要:#include<iostream> using namespace std; int main(){ double a,b,c,f0,f1,f2,f3,f4,f5; while(scanf("%lf%lf%lf",&f0,&f1,&f2)==3){ c = f0; a = (f2-2*f1+f0)
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int a[3],h = 168; bool flag = false; for(int i=0;i<3;i++) scanf("%d",&a[i]); for(int i=0;i<3;i++){
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int n,m,p,c; while(scanf("%d%d%d%d",&n,&m,&p,&c)==4&&n){ printf("%d\n",n+c-(m+c-p)); } return 0; }
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ int n,len,sum,dis[] = {9,3,7},p,q,val; char data[10]; scanf("%d",&n); for(int cn
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; #define PI 3.14159265 int main(){ double V,d,D; while(scanf("%lf%lf",&D,&V)==2&&D){ d = pow(D*
阅读全文
摘要:#include<iostream> #include<climits> using namespace std; int main(){ int n,m,c,i,j,result; while(scanf("%d%d%d",&n,&m,&c)==3&&n){ i = n; result = 0;
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; int main(){ int r,m,y; scanf("%d%d%d",&r,&m,&y); double a = pow((100.0+r)/100,y)*m; printf("%.
阅读全文
摘要:#include<iostream> #include<cstring> #include<vector> using namespace std; #define FLOOR 11 #define ROOM 11 #define AGENT 26 #define TIMELEN 9 #define
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; #define maxn 16000005 bool has[maxn]; char a[maxn]; int s[150]; int main(){ int n,nc,len,zz,
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; #define maxn 16000005 bool has[maxn]; int num[300]; char a[maxn]; int main(){ int n,nc; scan
阅读全文
摘要:#include<iostream> using namespace std; int n,m,c; int main(){ while(scanf("%d%d%d",&n,&m,&c)==3&&n){ int result = 0; int i = n; while(i>=8){ int j =
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int n,m,r,c,data[105][105],result; bool d[105][105]; bool test(){ for(int i=0;i<n;i++){ for(
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ int n; char data[70][20]; bool flag[70]; int w,s,num,start; memset(flag,false,si
阅读全文
摘要:#include<iostream> #include<queue> #include<cstring> using namespace std; char data[25][25]; bool visit[25][25]; int r,c,a,b,result; struct Node{ int
阅读全文
摘要:#include<iostream> using namespace std; #include<algorithm> #include<cstring> int main(){ char data[55]; while(scanf("%s",data)==1&&strcmp(data,"#")!=
阅读全文
摘要:#include<iostream> #include<cstring> #include<queue> using namespace std; struct Node{ int x,y; Node(){ x = 0; y = 0; } Node(int a,int b){ x = a; y =
阅读全文
摘要:/* 100 7 1 101 1 2 1 2 2 2 3 2 3 3 1 1 3 2 3 1 1 5 5 */ #include<iostream> using namespace std; #define maxn 50005 struct node{ int parent; int relati
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int n,d,x,y,num = 0; struct node{ int parent; int relation; }point[50005]; int find_par(int
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; #define maxn 5005 int r,c,n; typedef struct node{ int x,y; }Point; Point point[maxn]; int
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; typedef struct node{ int x,y; }Point; Point point[5005]; int r,c,n; int qcmp(const void*a,
阅读全文
摘要:#include<iostream> #include<algorithm> #include<cstring> using namespace std; #define maxn 5005 typedef struct node{ int x,y; }Point; //int cmp(Point
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; #define maxn 105 int t,w,h,wall_num; typedef struct node{ int x1,y1,x2,y2; }Wall; Wall wall[
阅读全文
摘要:#include<iostream> using namespace std; int n,k,data[10005]; bool check(int len){ int sum = 0; for(int i=0;i<n;i++){ sum += data[i]/len; } if(sum>=k)r
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; #define maxn 105 const int dx[] = {0,1,0,-1},dy[] = {1,0,-1,0}; int data[maxn][maxn],len[max
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; int n,k; int data[10005]; bool check(int len){ int sum = 0; for(int i=0;i<n;i++){ sum += data[
阅读全文
摘要:#include<iostream> #include<cstring> #include<cmath> using namespace std; #define maxn 105 int r,c; int data[maxn][maxn],len[maxn][maxn]; const int dx
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; #define maxn 105 int m,n,w_num,path_num; typedef struct node{ int x1,y1,x2,y2; }Wall; Wall w
阅读全文
摘要:#include<iostream> using namespace std; long long pow(long long m,int n){ long long ans = 1; while(n--){ ans *= m; } return ans; } int main(){ int i,j
阅读全文
摘要:#include<iostream> //https://www.cnblogs.com/shihuajie/archive/2013/03/25/2980709.html using namespace std; long long pow(long long x,int y){ long lon
阅读全文
摘要:#include<iostream> #include<queue> //https://blog.csdn.net/lyy289065406/article/details/6647917 using namespace std; int m[530000]; int main(){ int i,
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; int main(){ int i,n,data[10005]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&data[i]); }
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int t,k,i; long long n; char a[100],out[100]; scanf("%d",&t); while(t--){ scanf("%d%s%lld",&k,a,&n
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ long long n; char s[100],out[100]; int t,i,j,k,len; scanf("%d",&t); while(t--){
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int c,n,i,j,t; int data[1005]; double sum; scanf("%d",&c); while(c--){ scanf("%d",&n); sum = 0; fo
阅读全文
摘要:#include<iostream> #include<cstring> #include<cmath> using namespace std; int main(){ char a[][10] = {"too low","right on","too high"}; int i,low[12],
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int a,b,n,c,d; scanf("%d",&n); while(n--){ scanf("%d%d",&a,&b); if((a+b)%2==1||a<b){ printf("impos
阅读全文
摘要:#include<iostream> using namespace std; int main(){ long long n,k,i,j,ans; while(scanf("%lld%lld",&n,&k)==2&&n){ if(n-k<k){ k = n-k; } ans = 1; for(i=
阅读全文
摘要:#include<iostream> #include<cmath> #define PI 3.141592653589793 using namespace std; int main(){ double x[3],y[3]; double k[2][2],b[2][2],x0,y0,r; whi
阅读全文
摘要:#include<iostream> using namespace std; bool spec(int n){ int i,j,s[3],tmp; bool flag = false; tmp = n; s[0] = 0; while(tmp>0){ s[0] += tmp%10; tmp /=
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char a[15]; scanf("%s",a); int i,t = -1,len = strlen(a),sum = 0; for(i=0;i<len;i
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char a[30],data[100]; scanf("%s",a); getchar(); gets(data); int i,len = strlen(d
阅读全文
摘要:#include<iostream> using namespace std; int main(){ char a[][15] = {"Wide Receiver","Lineman","Quarterback"}; float speed[] = {4.5,6.0,5.0}; int weigh
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int a,b,n; scanf("%d",&n); while(n--){ scanf("%d%d",&a,&b); if(a<b)printf("NO BRAINS\n"); else pri
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int i,sum,n,data[15][2]; while(scanf("%d",&n)==1&&n!=-1){ sum = 0; scanf("%d%d",&data[0][0],&data[
阅读全文
摘要:#include<iostream> using namespace std; int main(){ char a[20][30]; int i,j,n,cnt; cnt = 0; while(scanf("%d",&n)==1&&n){ for(i=0;i<n;i++){ scanf("%s",
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int i,j,k,s,n; while(scanf("%d",&n)==1&&n){ s = 0; k = 0; for(i=1;;i++){ for(j=1;j<=i;j++){ s += i
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int data[150],len; void multiply(int tmp){ int i,j; for(i=0;i<len;i++){ data[i] *= tmp; } fo
阅读全文
摘要:/* Sample Input 1 2 3 0 ; three different stamp types 7 4 0 ; two customers 1 1 0 ; a new set of stamps (two of the same type) 6 2 3 0 ; three custome
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int n,i,j,p,q,t; while(scanf("%d",&n)==1){ for(i=1;;i++){ if(i*(i+1)/2>=n){ break; } } t = i*(i+1)
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char a[100005],b[100005]; int i,j,len_a,len_b; while(scanf("%s%s",a,b)==2){ len_
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int i,s = 0,n; scanf("%d",&n); for(i=1;;i++){ s += i; if(s==n)break; if(s-n>0&&(s-n)%2==0)break; }
阅读全文
摘要:#include<iostream> using namespace std; #define PI 3.1415927 int main(){ double ans_d,ans_mph,d,t; int r,cnt = 0; while(scanf("%lf%d%lf",&d,&r,&t)==3&
阅读全文
摘要:#include<iostream> using namespace std; int f(int M,int N){ if(M==0||N==1){ return 1; } if(M<N){ return f(M,M); } return f(M,N-1)+f(M-N,N); } int main
阅读全文
摘要:#include<iostream> #include<cmath> using namespace std; #define PI 3.14159265 int main(){ double t,R,r,s; int n,cnt; scanf("%d",&n); for(cnt=1;cnt<=n;
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ int i,j,len; char data[1005]; while(gets(data)){ len = strlen(data); for(i=0;i<l
阅读全文
摘要:#include<iostream> #include<algorithm> #include<cstring> using namespace std; int data[100],cnt,customer,total,now[5],end_item[5]; int now_type,end_ty
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int n,a,b; scanf("%d",&n); while(n--){ scanf("%d%d",&a,&b); if(a==b){ if(a%2==0){ printf("%d\n",a*
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int cnt,i,data[105]; double ans[105]; cnt = 0; while(scanf("%d",&data[cnt])==1){ ans[cnt] = 0; for
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int i,j,data[105],cnt = 0,t,ans[105]; while(scanf("%d",&data[cnt])==1&&data[cnt]!=0){ t = 0; for(i
阅读全文
摘要:#include<iostream> #include<cmath> #include<cstring> using namespace std; int main(){ int sum,mile; char a[2][20],icon[2]; while(true){ sum = 0; while
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int n,ip[4],i,j,base; char a[35]; scanf("%d",&n); while(n--){ scanf("%s",a); for(j=0;j<4;j++){ ip[
阅读全文
摘要:#include<iostream> #include<algorithm> using namespace std; int main(){ long long n,data[20005],sum,tmp,t; scanf("%lld",&n); int i,j; for(i=0;i<n;i++)
阅读全文
摘要:#include<iostream> #include<cstring> #include<cctype> using namespace std; int main(){ char a[80]; int data[30]; int out[400][60]; int i,j,l_max; mems
阅读全文
摘要:#include<iostream> #include<algorithm> #include<cmath> using namespace std; int cmp(int a,int b){ return abs(a)<abs(b); } int main(){ int i,t,n,data[5
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char a[2][5];//不可以是a[2][4] int n,x,y,i,data[2][11]; scanf("%d",&n); while(n--){
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char irr[25][2][25],tgt[25],vowel[]={'a','e','i','o','u'},tail[]={'o','s','x'},t
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char dict[10005][20],tar[20],tmp[20]; int count,i,j,diff_num; bool flag; count =
阅读全文
摘要:#include<iostream> #include<cctype> #include<cstring> #include<string> using namespace std; int main(){ char a[][5] = {".-","-...","-.-.","-..",".",".
阅读全文
摘要:#include<iostream> #include<cstring> #include<cmath> #include<algorithm> using namespace std; #define maxn 1005 int inPair[maxn][2],width,total,cup; t
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int n; int x,y,z,data[10]; char name[10][10]; int maxv,minv,maxi,mini; while(scanf("%d",&n)==1&&n!
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int n,x,y; scanf("%d",&n); while(n--){ scanf("%d%d",&x,&y); if(x<y)printf("NO BRAINS\n"); else pri
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char month[][10] = {"pop","no","zip","zotz","tzec", "xul","yoxkin","mol","chen",
阅读全文
摘要:#include<iostream> #include<cstring> #include<string> #include<algorithm> using namespace std; string data[105]; int data_num[105]; int nixushu(string
阅读全文
摘要:#include<iostream> /* 23,28,33 28*33=924 23*33=759 23*28=644 924*a%23=1,a=6,924*a=5544 759*a%28=1,a=19,759*a=14421 644*a%33=1,a=2,644*2=1288 */ using
阅读全文
摘要:#include<iostream> #include<cmath> #define PI 3.14159265 using namespace std; int main(){ int n; double s,x,y,r; int count = 0; scanf("%d",&n); while(
阅读全文
摘要:#include<iostream> using namespace std; int main(){ double s,m; for(int i=0;i<12;i++){ scanf("%lf",&m); s += m; } printf("$%.2lf",s/12); return 0; }
阅读全文
摘要:#include<iostream> using namespace std; int main(){ double s,n; int i; while(scanf("%lf",&n)==1&&n!=0.00){ s = 0; i = 1; while(s<n){ s+= 1.0/(i+1); i+
阅读全文
摘要:#include<iostream> #include<cstring> #include<algorithm> #include<cctype> using namespace std; int data[100005]; int main(){ memset(data,0,sizeof(data
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d\n",a+b); return 0; }
阅读全文
摘要:#include<iostream> #include<cmath> #include<cstring> using namespace std; int a[200],na,xiaoshu; void multiply(int b){ int i; for(i=0;i<na;i++){ a[i]
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; char a[6][6]; int main(){ int i,j,p,q; for(i=0;i<5;i++){ scanf("%s",a[i]); a[i][5] = '\0'; }
阅读全文
摘要:#include<iostream> #include<cstring> using namespace std; int main(){ char s[100]; scanf("%s",s); int i,j,k,l,len = strlen(s); for(i=1;i<len;i++){ boo
阅读全文
摘要:#include<iostream> #include<cstring> #include<cmath> using namespace std; int c[10005][10],data[10],tmp_data[10]; int main(){ memset(c,0,sizeof(c)); f
阅读全文
摘要:#include<iostream> #include<string.h> #include<ctype.h> using namespace std; int main(){ double score = 0,data[] = {12.01,1.008,16.00,14.01}; char dat
阅读全文
摘要:#include<iostream> #include<string.h> using namespace std; int main(){ char s[85]; scanf("%s",s); int i,j=0,score=0,len = strlen(s); for(i=0;i<len;i++
阅读全文
摘要:#include<iostream> #include<string.h> using namespace std; #define maxn 105 int main(){ char s[maxn][maxn]; while(scanf("%s",s[0])==1){ int len = strl
阅读全文
摘要:#include<iostream> using namespace std; int data[100005]; int main(){ int j,a[5],temp; for(int i=1;i<=100000;i++){ j = i; temp = i; while(j>0){ temp +
阅读全文
摘要:#include<iostream> #include<algorithm> #include<string.h> using namespace std; int data[50],target[50]; int number_data[15],number_target[15]; int mai
阅读全文
摘要:#include<iostream> #include<string.h> #include<ctype.h> using namespace std; const char* rev = "A 3 HIL JM O 2TUVWXY51SE Z 8 "; const char*msg[] = {"n
阅读全文
摘要:#include<iostream> using namespace std; int main(){ int i,c; char a[] = {"`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./'"}; while(c=getchar()){ for
阅读全文
摘要:#include<iostream> #include<string.h> using namespace std; int main(){ bool odd = true; char c; while(c = getchar()){ if(c=='"'){printf("%s",odd?"“":"
阅读全文
摘要:#include<iostream> #include<string.h> using namespace std; int main(){ char s[8],buf[20]; int abc,de,x,y,z,count = 0; bool ok; scanf("%s",s); for(abc=
阅读全文
摘要:#include<iostream> #define maxn 20 int a[maxn][maxn]; #include<string.h> using namespace std; int main(){ int x,y,tot = 0,n; scanf("%d",&n); tot = a[x
阅读全文
摘要:#include<iostream> #include<string.h> #define maxn 1005 using namespace std; int a[maxn]; int main(){ int n,k,first = 1; memset(a,0,sizeof(a)); scanf(
阅读全文