Search found 22 matches
- Fri Dec 17, 2004 5:48 pm
- Forum: Volume 4 (400-499)
- Topic: 489 - Hangman Judge
- Replies: 52
- Views: 23812
confuse 489 with online judge
#include <stdio.h>
#include <string.h>
int main()
{
int n,i,j,count;
char target[256],source[256];
while (scanf("%d\n",&n)==1){
if (n<0)break;
gets(target);
gets(source);
for (j=0;source[j];j++){
if(source[j]==' '){
for (count=j+1;source[count];count++){
source[count-1]=source[count ...
- Fri Dec 17, 2004 5:25 pm
- Forum: Volume 4 (400-499)
- Topic: 450 - Little Black Book
- Replies: 57
- Views: 12331
- Thu Dec 16, 2004 5:23 pm
- Forum: Volume 4 (400-499)
- Topic: 450 - Little Black Book
- Replies: 57
- Views: 12331
450 Grazy
I almost get grazy about this easy problem
[c]
#include <stdio.h>
#include <string.h>
typedef struct{
char name[80];
char country[80];
char department[80];
char homephone[80];
char workphone[80];
char campusbox[80];
}DataStruct;
void Swap(DataStruct *a, DataStruct *b)
{
DataStruct temp ...
[c]
#include <stdio.h>
#include <string.h>
typedef struct{
char name[80];
char country[80];
char department[80];
char homephone[80];
char workphone[80];
char campusbox[80];
}DataStruct;
void Swap(DataStruct *a, DataStruct *b)
{
DataStruct temp ...
- Thu Dec 16, 2004 5:21 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10370 - Above Average
- Replies: 62
- Views: 29245
Thx
hiks ... thx bro. It's experience ... find it about monthlittle joey wrote:There can be as many as 1000 students in a class, but you only reserve memory for 500.
Change it and you'll get AC.
- Wed Dec 15, 2004 3:38 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10370 - Above Average
- Replies: 62
- Views: 29245
10370 WA Why ???
I got this wrong but i already seek it for month didnt found what is the bug :
[c]
#include <stdio.h>
int main()
{
long n,jlhMurid,i,jk,ehm[500],average,nilai;
scanf("%ld",&n);
for (i=0;i<n;i++){
scanf("%ld",&jlhMurid);
nilai=0;average=0;
for (jk=0;jk<jlhMurid;jk++){
scanf("%ld",&ehm[jk ...
[c]
#include <stdio.h>
int main()
{
long n,jlhMurid,i,jk,ehm[500],average,nilai;
scanf("%ld",&n);
for (i=0;i<n;i++){
scanf("%ld",&jlhMurid);
nilai=0;average=0;
for (jk=0;jk<jlhMurid;jk++){
scanf("%ld",&ehm[jk ...
- Mon Nov 22, 2004 6:25 pm
- Forum: Volume 6 (600-699)
- Topic: 694 - The Collatz Sequence
- Replies: 46
- Views: 21935
- Fri Nov 19, 2004 5:21 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10220 - I Love Big Numbers !
- Replies: 18
- Views: 11174
Re: TLE 10220.
using array only 10000 , save the result into the array. that's linear timeZhao Le wrote:Can any one tell me the way how can speed up the #10220?
I got TLE.
- Fri Nov 19, 2004 5:20 pm
- Forum: Volume 102 (10200-10299)
- Topic: 10200 - Prime Time
- Replies: 202
- Views: 96691
- Fri Nov 12, 2004 6:40 pm
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 51118
Re: OH CRAP!
your method is too slow .............and "TIMELIMITEXCEEDED" is happened :x :x :x
OH! CRAP~~~~~~
I'm using ... method
typedef struct{
int low,high;
int Number,Sequence;
} Data;
Data Buff[1000];
I save all in buff and the counting it. It's more fast.
Another trick : 3*n+1 -> but the limit ...
OH! CRAP~~~~~~
I'm using ... method
typedef struct{
int low,high;
int Number,Sequence;
} Data;
Data Buff[1000];
I save all in buff and the counting it. It's more fast.
Another trick : 3*n+1 -> but the limit ...
- Fri Nov 12, 2004 8:48 am
- Forum: Volume 2 (200-299)
- Topic: 294 - Divisors
- Replies: 91
- Views: 39225
Re: Cul de sac.
Today i try to using sqrt() like find the prime number
100 = 10 * 10
it's impossible divide the number large than 10 in this case. So you can add the range below than sqrt().
and then do this :
if (number%divisor==0){
Counter++;
if (number/divisor!=divisor)Counter++;
}
that so solve like 2 ...
100 = 10 * 10
it's impossible divide the number large than 10 in this case. So you can add the range below than sqrt().
and then do this :
if (number%divisor==0){
Counter++;
if (number/divisor!=divisor)Counter++;
}
that so solve like 2 ...
- Fri Nov 12, 2004 5:22 am
- Forum: Volume 2 (200-299)
- Topic: 294 - Divisors
- Replies: 91
- Views: 39225
Re: Cul de sac.
Today i try to using sqrt() like find the prime number
100 = 10 * 10
it's impossible divide the number large than 10 in this case. So you can add the range below than sqrt().
and then do this :
if (number%divisor==0){
Counter++;
if (number/divisor!=divisor)Counter++;
}
that so solve like 2*50 ...
100 = 10 * 10
it's impossible divide the number large than 10 in this case. So you can add the range below than sqrt().
and then do this :
if (number%divisor==0){
Counter++;
if (number/divisor!=divisor)Counter++;
}
that so solve like 2*50 ...
- Fri Oct 15, 2004 5:21 pm
- Forum: Volume 4 (400-499)
- Topic: 443 - Humble Numbers
- Replies: 82
- Views: 18045
- Tue Oct 05, 2004 5:32 pm
- Forum: Volume 2 (200-299)
- Topic: 294 - Divisors
- Replies: 91
- Views: 39225
294 WA
Please give me some input ... Dunno why is error
[c]
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
int main()
{
unsigned long atas,bawah,bilangan;
int n,i,j,hasil,max,jlh;
scanf("%d",&n);
for (jlh=0;jlh<n;jlh++){
scanf("%ld %ld",&bawah,&atas);
max=0;bilangan=0;
for (i=bawah;i ...
[c]
#include <stdio.h>
#include <io.h>
#include <fcntl.h>
int main()
{
unsigned long atas,bawah,bilangan;
int n,i,j,hasil,max,jlh;
scanf("%d",&n);
for (jlh=0;jlh<n;jlh++){
scanf("%ld %ld",&bawah,&atas);
max=0;bilangan=0;
for (i=bawah;i ...
- Tue Oct 05, 2004 5:29 pm
- Forum: Volume 4 (400-499)
- Topic: 443 - Humble Numbers
- Replies: 82
- Views: 18045
Cry for 443
Can Any body tell what is my wrong ?
[c]
#include <stdio.h>
unsigned long Min(long Hasil2, long Hasil3, long Hasil5, long Hasil7)
{
long Temp[4],max;
int i;
Temp[0]= Hasil2; Temp[1]=Hasil3; Temp[2]=Hasil5; Temp[3]=Hasil7;
max=Temp[0];
for (i=1;i<4;i++){
if (Temp <max){
max=Temp ...
[c]
#include <stdio.h>
unsigned long Min(long Hasil2, long Hasil3, long Hasil5, long Hasil7)
{
long Temp[4],max;
int i;
Temp[0]= Hasil2; Temp[1]=Hasil3; Temp[2]=Hasil5; Temp[3]=Hasil7;
max=Temp[0];
for (i=1;i<4;i++){
if (Temp <max){
max=Temp ...
- Sun Oct 03, 2004 10:29 am
- Forum: Volume 100 (10000-10099)
- Topic: 10035 - Primary Arithmetic
- Replies: 328
- Views: 101751
Re: 10035 Error?
give space at your all output :
cout << count << " carry operations." << endl;
to
cout << count << " carry operations.<space>" << endl;
but it AC(P.E) my program is P.E too i don't know why ?
But i'm not change your program and accepted maybe cause of your email. please try at //@END_OF ...
cout << count << " carry operations." << endl;
to
cout << count << " carry operations.<space>" << endl;
but it AC(P.E) my program is P.E too i don't know why ?
But i'm not change your program and accepted maybe cause of your email. please try at //@END_OF ...