Problem
給定 n 之值,請你計算等式:x + 2y + 2z = n 共有幾組解,其中x, y, z, n為非負整數。
The Input
最多有1500組測試資料,每組資料一列有一個整數 n (n < 1000001)。
The Output
請輸出每組測試資料的解。
Sample Input
2 3
Sample Output
3 3
原文出處
2 3
3 3
3 2 10 3 341 2 341 3 1105 2 1105 3 0 0
no no yes no yes yes
3 100 101 102 103 488 100 200 300 101 102 103 102 101 488 100 3 200 202 204 206 208 123 234 345 456 321 100 200 300 400 444 0
2 3
Sample Input | Sample Output |
2 6 1 2 4 8 16 32 6 1 3 6 8 15 20 | 6 4 |
20 10 2300 4 0 0 | 21 2394 |
3 10 2 100 2 1000 2 | 6 67 666 |
給定一個稱為Fred的數列,共有 n 項,且每一項的數值分別介於 1~n 之間,任一對相鄰的項其值必不相同,本題要求從Fred數列中找出稱為Mary的最長子序列滿足下列性質:Mary[0] > Mary[1] < Mary[2] > Mary[3] < ...
4 5 1 2 3 4 5 5 5 4 3 2 1 5 5 1 4 2 3 5 2 4 1 3 5
1 2 5 3
UBQTS TXT tthumb LIVESPACE BLOGJAM philton aeinstein YOUBOOK j97lee sswxyzy j97lee aeinstein SKINUX 1 0
YOUBOOK 2 LIVESPACE BLOGJAM 1 UBQTS TXT 1 SKINUX 0
0.50 1.00 2.50 16.00 1.25 1.60 1.75 1.84 1.25 1.40 1.86 2.00 ...
原文出處
10 3 -1 -1 1 1 1 1 3 10 10 10 2 3 1 10 5 10 0
1 4 3
3 5 0.00 0.00 0.00 0.00 1.00 1.00 1.00 0.00 0.00 1.00 2 0.00 0.00 0.00 0.00 6 0.00 2.00 0.00 0.00 1.00 1.00 1.00 0.00 0.00 1.00 0.00 -2.00
Data set #1 contains 4 gnus, out of which a maximum of 2 are aligned. Data set #2 contains a single gnu. Data set #3 contains 6 gnus, out of which a maximum of 4 are aligned.
2 2 10 11 20
Case #1: 3 Case #2: 4
3 1 2 3 1 4 5 6 2 7 8 9 3 4 1 2 3 1 1 4 5 2 1 6 7 3 1 8 9 4 0
Case 1: 6 Case 2: -1
4 10 6 1 2 3 4 5 6 7 8 9 10 4 5 6 7 8 9 10 1 2 3 6 7 8 9 10 1 2 3 4 5 7 8 9 10 1 2 3 4 5 6 9 10 1 2 3 4 5 6 7 8 9 10 3 4 5 6 7 8 1 2 12 4 3 4 5 6 7 8 9 10 1 2 11 12 7 8 9 10 1 2 6 11 12 3 4 5 4 5 6 7 8 9 10 12 1 2 3 11 12 5 6 7 8 9 10 1 2 3 4 11 6 4 2 3 1 4 5 6 2 3 1 4 5 6 6 1 2 3 4 5 5 1 2 3 4 6 2 1 1 2
1 2 4 1


3 6 9 15 10 7 13
15 40 28
原文出處
8 8 0 8 8 1 9 9 1 40000 39999 0 0 0 0
0 1 2 799700028
| s | a | t | o | r |
| a | r | e | p | o |
| t | e | n | e | t |
| o | p | e | r | a |
| r | o | t | a | s |
3 sator arepo tenet opera rotas this sentence is, quite clearly, not a magic square palindrome! but then again, you never know... muse sun, eve.s e(y)es even use sum.
Case #1: 5 Case #2: No magic :( Case #3: 5
4 3 1 2 3 4 4 5 6 7 5 8 9 10 11 12 2 1 5 2 2 3 3 2 3 1 6 400 401 402 403 404 405 2 101 100 7 400 401 402 403 404 405 406 1 1 1 2 1 3
Case #1: 3 5 8 9 10 11 12 Case #2: 1 1 5 Case #3: 2 2 100 101 Case #4: 1 1 1 2 1 2 3 1 3
2 Hey good lawyer as I previously previewed yam does a soup First I give money to Teresa after I inform dad of your horrible soup
Case #1: How are you Case #2: Fine and you