10676 - Grid Points

All about problems in Volume 106. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
shuniu
New poster
Posts: 34
Joined: Thu Oct 16, 2003 6:15 pm

10676 - Grid Points

Post by shuniu »

Can somebody clarify the phrase:
The only allowed (so it "looks nice") spacings of the grid points are 1, 2, 2.5 or 5 - or any multiple/divisible by 10 of these values.
I interpret it as the allowed values being

1 $ a1 $ a2 $ a3 $ a4 $ a5 $ a6 $ a7 $ a8 $ a9 $ a10

where $ is either * or /, and a1 to a10 can each take on the values 1, 2, 2.5, 5.

But I dont think this is the correct interpretation as my program generates different values than sample IO.

Yarin
Problemsetter
Posts: 112
Joined: Tue Sep 10, 2002 5:06 am
Location: Ume
Contact:

Post by Yarin »

Nope, the allowed values are

... -4a -3a -2a -a 0 a 2a 3a 4a ...

where a is either 10^x, 2*10^x, 2.5*10^x or 5*10^x for any integer x

kosmos
New poster
Posts: 3
Joined: Fri Nov 26, 2004 6:34 pm
Location: Krakow, Poland
Contact:

10676 WA

Post by kosmos »

Can anyone tell me what is so tricky in 10676 [Grid Points] that I'm getting WA all the time?
Maybe someone can put some example IO here? It would be great!

Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

What is the AC output for the following input?

Code: Select all

33
21 7
-0.15903 0.27995 -0.30407 -0.59675 0.52756 0.66975
-0.28772 0.24153 0.46053 -0.74294 0.47836 -0.32451
-0.88954 0.17464 -0.09636 0.10828 -0.66846 -0.44442
0.12607 0.56241 -0.26516 
11 8
0.27799 0.03381 -0.68445 -0.29513 0.30065 0.93676
-0.90201 0.77357 -0.57804 0.32704 -0.27934 
27 2
-0.30809 -0.67237 -0.03874 -0.28444 -0.09629
0.93269 -0.44355 0.06645 -0.48075 -0.90633 -0.14376
0.50310 0.40881 0.39080 0.45039 0.18334 -0.48603
-0.51064 -0.46472 -0.61750 -0.83555 -0.78904 -0.25503
-0.83860 -0.74853 0.86567 -0.37278 
10 10
0.51898 0.25370 0.84789 0.98422 0.93875 0.40116
0.38525 0.13185 0.78318 0.80050 
29 7
0.91600 -0.41145 0.71108 -0.59363 0.99873 0.21527
0.96176 -0.70123 0.43650 0.32893 -0.68997 0.99370
0.79720 0.20582 0.39557 -0.96975 -0.14939 -0.41731
-0.48652 -0.58547 -0.90948 0.98479 -0.95834 -0.08012
0.62946 -0.64142 -0.11019 0.38353 0.26955 
5 6
-0.64823 -0.96667 0.88481 0.58664 -0.08329 
12 10
0.91994 -0.23747 0.52023 0.61112 -0.29995 0.46101
-0.14066 -0.02961 -0.46293 0.94853 0.22149 -0.23000 
6 5
0.14201 -0.60607 0.66583 0.52665 0.95507 -0.00137 
17 4
0.88673 0.30338 0.51942 0.84271 0.86870 0.81208
0.74333 0.14519 0.51868 0.76864 0.22362 0.34373
0.06359 0.40071 0.47343 0.29132 0.29963 
6 9
-0.75309 0.29401 0.19990 0.74842 -0.58833 0.60960 
8 6
-0.69982 0.46892 -0.47326 0.53754 0.10450 0.59924
-0.91331 0.18918 
22 7
0.00602 0.59983 0.16232 0.10866 -0.76430 0.19858
-0.38610 -0.26136 -0.06271 -0.08358 -0.17460 -0.59928
0.05036 -0.88109 -0.38785 0.99693 0.34177 0.01735
0.57448 -0.78125 -0.21714 0.54606 
17 3
0.38902 0.21354 0.17685 -0.27412 0.64024 -0.58950
-0.42524 0.84814 0.89710 -0.52116 0.93682 -0.84521
-0.22851 -0.99236 -0.56250 -0.59346 -0.80943 
20 4
-0.67688 -0.17568 0.06701 -0.19683 -0.29485 0.76985
0.31508 -0.31600 0.15493 -0.89583 0.36958 -0.30884
-0.18088 -0.80371 0.85293 0.08534 -0.07261 0.96520
0.76150 0.80939 
22 15
-0.73154 0.10296 0.05498 0.58429 -0.19589 0.83356
0.99305 0.06939 -0.07561 -0.41105 -0.25365 0.90210
0.38751 -0.45054 0.99464 -0.79086 -0.02348 -0.36287
-0.18419 0.57029 -0.71922 0.07036 
9 8
-0.65040 0.43576 -0.24156 0.23574 0.83697 0.81613
0.62015 -0.70130 -0.49112 
15 3
0.40126 0.52332 0.55197 0.02383 0.31229 0.75929
0.75552 0.46044 0.46546 0.80068 0.30431 0.88746
0.20808 0.82257 0.08642 
11 7
0.90563 -0.67902 0.64096 0.86910 -0.08234 -0.45397
0.25130 -0.68033 -0.40389 0.79451 0.13759 
6 9
-0.22440 0.36424 0.91501 0.34999 0.82777 -0.64481 
13 2
0.89437 0.56059 -0.17729 -0.57972 -0.98259 -0.20148
-0.83266 -0.87141 0.07024 0.32427 0.16533 0.29512 -0.09953 
16 8
-0.45086 -0.18515 -0.50499 0.68158 -0.30077 -0.81974
-0.16505 -0.20342 0.16989 -0.67087 -0.90511 0.51050
-0.92157 0.03606 -0.06989 0.90210 
29 8
0.19411 0.59020 0.24669 0.13277 0.46367 0.44589
0.62561 0.55365 0.45867 0.84787 0.12745 0.99883
0.02767 0.90805 0.26325 0.02231 0.34694 0.37303
0.67969 0.78854 0.42134 0.23178 0.14057 0.91805
0.07550 0.30112 0.89857 0.67551 0.38479 
4 7
0.26441 -0.38255 0.37764 0.38746 
6 3
-0.08124 -0.75240 0.32617 0.64686 0.36362 0.91620 
4 7
0.81637 -0.58251 -0.42228 0.12229 
27 9
-0.04583 -0.48293 0.72854 0.26734 -0.80543 -0.14376
-0.11702 -0.88383 0.86597 -0.04288 -0.75598 0.84682
0.15776 -0.60679 0.96096 -0.96793 0.14452 0.23170
0.96077 -0.35560 0.12925 -0.15895 -0.23427 0.05085
0.98038 -0.86391 0.54498 
15 2
-0.80718 -0.66626 -0.89129 -0.65013 0.50053 -0.19746
0.76413 0.65908 0.98887 -0.96329 0.57888 0.89351
0.91719 0.94816 0.25525 
4 2
-0.99953 -0.36440 -0.10173 -0.67450 
6 4
0.00696 -0.00187 -0.00965 -0.00267 0.00147 -0.00321
22 5
0.34714 0.90498 0.82683 -0.19835 -0.92909 -0.37237
-0.88166 -0.78477 -0.88895 0.73304 0.33715 0.29810
0.54254 -0.64086 0.69830 0.73977 0.46367 -0.03328
0.42538 0.43864 0.73027 -0.76044 
2 2
200 999.99999
2 20
200 1000.00001
2 2
-200 1000 
My code returns

Code: Select all

-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75
-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
-1 0 1
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
-1.0 -0.5 0.0 0.5 1.0
-0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0
-1.0 -0.5 0.0 0.5 1.0
0.00 0.25 0.50 0.75 1.00
-0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8
-1.0 -0.5 0.0 0.5 1.0
-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
-1 0 1
-1.0 -0.5 0.0 0.5 1.0
-0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
-0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
0.0 0.5 1.0
-0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
-0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0
-1 0 1
-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
0.0 0.2 0.4 0.6 0.8 1.0
-0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4
-1 0 1
-0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
-1.00 -0.75 -0.50 -0.25 0.00 0.25 0.50 0.75 1.00
-1 0 1
-1 0
-0.010 -0.005 0.000 0.005 0.010
-1.0 -0.5 0.0 0.5 1.0
0 1000
0 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 1050
-1000 0 1000 

jjtse
Learning poster
Posts: 80
Joined: Mon Aug 22, 2005 7:32 pm
Location: Nevada, US
Contact:

Post by jjtse »

Hi,

I declare my variables with 'long double' to hold the real numbers, because that's the most accurate method to represent them. However, even with 'long double' sometimes I'll get a number that is 1.238382e-30. Which is ridiculously close to zero. It should've just printed out zero, Do you know how to fix this problem?


jjtse

Post Reply

Return to “Volume 106 (10600-10699)”