106 - Fermat vs. Pythagoras
Moderator: Board moderators
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
I ran all the test cases in this thread, and they come out fine, but I'm still getting WA. Can someone help?
This is in C. If you have trouble compiling, try gcc -lm -o 106 106.c
Thanks
Code: Select all
Resolved
Thanks
Last edited by ubernewb on Thu Aug 09, 2007 7:38 pm, edited 1 time in total.
>>ubernewb
try this case
Hope this helps.
try this case
Code: Select all
Input
1000000
My AC Output
159139 133926
Tried that case, result came back OK. Here are the inputs I tried:
Input:
Output:
[/code]
Input:
Code: Select all
10
11
12
15
20
22
50
55
80
100
500
600
700
800
900
1000
10000
100000
1000000
33221
33222
33333
33337
33339
33344
33354
33355
33356
33357
99960
99961
99962
99963
99964
99965
99966
99967
99968
99969
99970
99980
99990
99995
99999
100000
999991
999992
999993
999994
999995
999996
999997
999998
999999
Code: Select all
1 4
1 5
1 6
2 5
3 7
3 9
7 15
8 14
12 22
16 27
80 107
95 127
112 142
128 162
140 180
158 205
1593 1669
15919 14844
159139 133926
5287 5187
5287 5187
5303 5204
5307 5205
5307 5206
5307 5206
5309 5208
5309 5207
5309 5207
5309 5208
15909 14841
15910 14841
15910 14842
15910 14842
15910 14842
15912 14842
15912 14842
15912 14842
15912 14843
15912 14843
15912 14841
15916 14841
15919 14844
15919 14844
15919 14844
15919 14844
159137 133923
159137 133924
159137 133925
159137 133926
159137 133924
159137 133925
159139 133925
159139 133926
159139 133926
-
- A great helper
- Posts: 383
- Joined: Mon Oct 18, 2004 8:25 am
- Location: Bangladesh
- Contact:
That's really weird. I ran it with 1000000 as input, and got 159139 133926. But you're saying that when you run it, it comes out with a different answer.
There must be something wrong in my code that makes it have different output on different compilers/machines, but I can't figure out what that is.
There must be something wrong in my code that makes it have different output on different compilers/machines, but I can't figure out what that is.
-
- New poster
- Posts: 4
- Joined: Mon Aug 13, 2007 3:12 pm
106 Time Limit Exceeded (Fermat vs Pythagorean)
wat is wrong with compiler.
when i m submitin a wrong answer code wich eval. max. no. 1000000 in less then 3 sec in my computer. It Gives Time limit exceeded instead of WA..
also gives Time Limit Exceeded for the correct sol. when i submits it.
this eval. a max of around 9 sec for 1000000.
i hav used while(cin>>max) in my code
is this wrong...
also
wat is mean by 'Input is terminated by end-of-file' statement given in probl.
If any One asks for my code i can giv him....
when i m submitin a wrong answer code wich eval. max. no. 1000000 in less then 3 sec in my computer. It Gives Time limit exceeded instead of WA..
also gives Time Limit Exceeded for the correct sol. when i submits it.
this eval. a max of around 9 sec for 1000000.
i hav used while(cin>>max) in my code
is this wrong...
also
wat is mean by 'Input is terminated by end-of-file' statement given in probl.
If any One asks for my code i can giv him....
You are going on wrong way. Time Limit Exceed is not for a single input. It's for total input cases in judge's input file. In your code, you are measuring for a single maximum input.
Check your code with given input cases in
http://acm.uva.es/board/viewtopic.php?t ... 2296d9d630
You should change your algorithm...
With Best Regards
Surendra Meena
Check your code with given input cases in
http://acm.uva.es/board/viewtopic.php?t ... 2296d9d630
You should change your algorithm...
With Best Regards
Surendra Meena
-
- New poster
- Posts: 3
- Joined: Sun Aug 27, 2006 5:40 pm
- Location: Dhaka
- Contact:
why compilation error? plz help!
Code: Select all
/* compile error, Help plz */
Deleted after AC
Last edited by riyad_csedu on Mon Dec 03, 2007 8:09 pm, edited 1 time in total.