当前位置:首页 >> 计算机软件及应用 >>

浙江2016 NOI省选


2016

06

-

8 %

3

rng rng rng.in rng.out 3 256MB 5 20

tourist tourist tourist.in tourist.out 2 512MB 10 10

star star star.in star.out 1 512MB 10 10

C++ C Pascal

rng.cpp rng.c rng.pas

tourist.cpp tourist.c tourist.pas

star.cpp star.c star.pas

C++ C Pascal

-O2 -lm -O2 -lm -O2

-O2 -lm -O2 -lm -O2

-O2 -lm -O2 -lm -O2

2016

Y !"! Y !+! 2 ≤ + ≤ " ! !+! 2 ≤ + ≤ " ! !5, 6! !%. ! !%. ! !%/ ! !1! !%/ ! !"! !5, 6! !"! !4! !1!

(random number generator)

Y

!"! !"! !0!

!%& , %( , … , %* !0! !1! !?+/2? ! 5, 6 ! !+ ? 1! +?1 !%& , %( , … , %*

!(5, 6)! ! 1,2 , 1,3 ! Y !" = 1000 ! 1,2 , 2,3 ! !"! Y !1000

rng.in !=! !" ? 1! !5! 1 rng.out =! 1 rng/rng.in !1! !6!

1 !=! 2!

< !5, 6

!<!

!4!

rng/rng.ans

2

7

2016

4

= 1 2 3 4 5 = 2000 = 3000 = 3000 = 4000 = 4000 !1000! 2 !10! !B ≤ >D !1! !4! rng/scores !B > >& !>&? , >@ , >A , … , >& !B,! !2C! !0! !0! !1, 2! !1, 2, 3! !1, 3, 4!

!C! !=!

3

7

2016

Y !"! !"!×!=! !=! ! +, 0 ! 1 ≤ + ≤ ", 1 ≤ 0 ≤ = ! ! +, 0 ! !I.,/ !H.,/ Y !J! ! B& , K& ! ! B( , K( ! ! +, 0 + 1 ! !H.,/ ! +, 0 ! ! +, 0 + 1 ! ! + + 1, 0 ! ! +, 0 !

tourist.in !"! !H.,/ ! !" ? 1! !I.,/ ! !1! !J! 1 tourist.out !J! !4! !=! != ? 1!

!2!

!", =! !+! !+! Y !B& , K& , B( , K( !0! !0!

!J!

1 2 2 3 6 2 1 1 2

4 1 2 2 2 2 1
4 7

2016

11 6 7 2 2 3 558 102 461 2 2 1 1 2 163 2000 1732 561 2 3 2 2 12 1743 1121 13 tourist/tourist.in 4 !10L ! H.,/ , I.,/ ≤ 10L ! !1 ≤ tourist/tourist.ans

"?= 1 2 3 4 5 6 7 8 9 10 ≤ 2!×!10L ≤ 10N

q ≤ 10N

min!(", =) ≤ 4

≤ 10O

5

7

2016

:

Y !=! !" ? 1! !"! Y

!"!

Y

star.in !=! !2!

!2!

!", =! !5, 6! !1! !5 ≠ 6! !5, 6! !5! !5! !6!

!" ? 1! !6! 1 star.out !1! !0! 1 4 1 1 1 4 4 4 3 2 3 4 1 2 3

!2!

6

7

2016

11 6 1 !4! !2, 3, 4! 12 star/star.in star/star.ans !1! !6! !1, 2, 3!

4

" 1 2 3 4 5 6 7 8 9 10 = 10

m

= 17 "(" ? 1) 2 10O

= 14



= 16

= 17

7

7


相关文章:
更多相关标签: