TopCoder

FHVirus
想像不出自己 AC 的題目是實作不出來的!

User's AC Ratio

97.1% (67/69)

Submission's AC Ratio

47.0% (125/266)

Tags

Description

從前有個叫做畢達哥拉斯,他想到一個問題:給n條整數邊,問說可以組出幾種直角三角形。

對了,他說他的邊不會有重複的。

Input Format

第一個數字n代表接著有幾條邊。( 1≤ n ≤2000)

邊的長度都在 230之內。包含多組測試資料。

Output Format

輸出一個貌似答案的整數。

Sample Input 1

5
3 4 5 12 13
8
3 4 5 12 13 7 24 25

Sample Output 1

2
3

Hints

2008/05/15 Output的敘述修正:正整數→整數。感謝shik

Problem Source

原TIOJ1289 / 雄中公假社'08 入退社考。Idea:newmoon, Problem Setter:ggm。

Subtasks

No. Testdata Range Score
1 0 25
2 1 25
3 2 25
4 3 25

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 10000 65536 262144 1
1 10000 65536 262144 2
2 10000 65536 262144 3
3 10000 65536 262144 4