博文
pku(1936)(2005-08-18 16:36:00)
摘要:#include <string.h>
#include <iostream.h>
int main()
{
char a[1000000],b[1000000];
while(cin>>a>>b)
{
int flag=0;
long pos1=strlen(a)-1;
long pos2=strlen(b)-1;
while(1)
{
if(a[pos1]==b[pos2])
{
pos1--;
pos2--;
......
jnu(all in all)(2005-08-18 16:22:00)
摘要:#include <iostream.h>
#include <string.h>
#include <fstream.h>
ifstream f("all.in");
#define cin f
int main()
{
char a[10000],b[10000];
while(cin>>a>>b)
{
int flag=0;
int pos1=strlen(a)-1;
int pos2=strlen(b)-1;
while(1)
{
if(a[pos1]==b[pos2])
{
pos1--;
 ......
jnu(FatMouse' Trade)(2005-08-18 16:05:00)
摘要:#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <fstream.h>
ifstream f("mouse.in");
#define cin f
int comp(const void *m,const void *n)
{
return ((int *)n)[0]/((int *)n)[1]-((int *)m)[0]/((int *)m)[1];
}
int main()
{
int m,n;
int a[1000][2];
int i,j;
while(cin>>m>>n)
{
if (m==-1 && n==-1)
return 0;
for(i=0;i<n;i++)
cin>>a[i][0]>>a[i][1];
qsort(a,n,2*sizeof(int),comp);
float k=......
jnu(FatMouse' Trade)(2005-08-18 16:03:00)
摘要:#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <fstream.h>
ifstream f("mouse.in");
#define cin f
int comp(const void *m,const void *n)
{
return ((int *)n)[0]/((int *)n)[1]-((int *)m)[0]/((int *)m)[1];
}
int main()
{
int m,n;
int a[1000][2];
int i,j;
while(cin>>m>>n)
{
if (m==-1 && n==-1)
return 0;
for(i=0;i<n;i++)
cin>>a[i][0]>>a[i][1];
qsort(a,n,2*sizeof(int),comp);
float k=......
jnu(A Equation)(2005-08-18 16:02:00)
摘要:#include <iostream.h>
#include <stdio.h>
#include <fstream.h>
ifstream f("equa.in");
#define cin f
int main()
{
int c;
int i;
float x;
int max;
while(cin>>c)
{
max=(5000>(int)(100000/c)) ? (int)(100000/c) : 5000;
for(i=0;i<=max;i++)
{
float j=(float)i/1000;
if(j*j*j+j*c==100 )
break;
}
 ......
jnu(Ugly numbers)(2005-08-18 15:59:00)
摘要:#include <iostream.h>
int main()
{
long n=1;
int sum=0;
while(sum<1500)
{
long m=n;
while(m%2==0)
{
m/=2;
}
while(m%3==0)
{
m/=3;
}
while(m%5==0)
{
m/=5;
 ......
jnu(pi)(2005-08-18 15:59:00)
摘要:#include <iostream.h>
#include <stdio.h>
#include <fstream.h>
#include <math.h>
ifstream f("pi.in");
#define cin f
int fun(int m,int n)
{
int q;
q=m%n;
while(q!=0)
{
m=n;
n=q;
q=m%n;
}
return n;
}
int main()
{
int n,i,j;
int a[51];
while(cin>>n)
{
int sum=0;
if (n==0) return 0;
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
{
&nbs......
pku(2371)(2005-08-18 00:56:00)
摘要:#include <iostream.h>
#include <stdlib.h>
int comp(const void *a,const void *b)
{
int *x=(int *)a;
int *y=(int *)b;
return *y-*x;
}
int main()
{
int a[100000];
int n,k,i,op;
long j;
char s[4];
cin>>n;
for (j=0;j<n;j++)
cin>>a[j];
cin>>s;
cin>>k;
qsort(a,n,sizeof(int),comp);
for (i=0;i<k;i++)
{
cin>>op;
cout<<a[op-1]<<endl;
}
}......
JNU(1)(2005-08-18 18:32:00)
摘要:ACM /ICPC暑期集训练习赛(1)
Problem ID Problem Name Input File Name
1001 Maximum sum max.in
1002 Binary Tree bin.in
1003 Tight words tight.in
1004 Hamming Problem ham.in
1005 Ones ones.in
1006 Heritage her.in
1007 Crossed ladders
ACM/ICPC暑期集训(2)
Problem ID Problem Name Input File Name
A All in All all.in
B A goat in a kitchen garden goat.in
C Ugly numbers ugly.in
D FatMouse' Trade mouse.in
E QS Network qs.in
F Pi pi.in
G A Equation equa.in
ACM/ICPC暑期集训(4)
Problem ID Problem Name Input File Name
A Parencodings A.in
B Image Perimeters B.in
C Round and Round We Go C.in
D Inversion D.in
E Easier Done Than Said? E.in
F Common Subsequence F.in
G sticks G.in
H Primary Arithmetic
H.in
Start Time : 2005-08-21 12:30:00 (GMT+8)
Length : 5:00:00
ACM/ICPC暑......
pku(2538)(2005-08-16 23:10:00)
摘要:#include<stdio.h>
#include<string.h>
char a[4][13]={
{'`','1','2','3','4','5','6','7','8','9','0','-','='},
{'Q','W','E','R','T','Y','U','I','O','P','[',']','\\'},
{'A','S','D','F','G','H','J','K','L',';','\'','0','0'},
{'Z','X','C','V','B','N','M',',','.','/','0','0','0'}
};
char fun(char b)
{
int i,j;
for (i=0;i<4;i++)
for (j=0;j<13;j++)
if (b==a[i][j])
return a[i][j-1];
}
int main()
{
int i,j;
char s[100];
/*for (i=0;i<4;i++)
{
for (j=0;j<13;j++)
printf("%c ",a[i][j]) ;
printf("\n");
}
getch();
*/
while(gets(s)!=NULL)
{
for (i=0;i<strlen(s);i++)
if (s[i]!=' ')
s[i]=fun(s[i]);
printf("%s\n",s);
}
}
......