1 solutions
-
0
Pascal :
var n,i,j,ans:longint; a:array[0..1001]of longint; vis:array[0..20001]of boolean; begin readln(n); for i:=1 to n do begin read(a[i]); vis[a[i]]:=true; end; for i:=1 to n do for j:=1 to i-1 do if vis[a[i]+a[j]] then begin inc(ans); vis[a[i]+a[j]]:=false; end; write(ans); end.
- 1
Information
- ID
- 18667
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By