結果
| 問題 |
No.723 2つの数の和
|
| コンテスト | |
| ユーザー |
s_shohei
|
| 提出日時 | 2020-04-16 22:51:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| コード長 | 248 bytes |
| コンパイル時間 | 188 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 82,048 KB |
| 最終ジャッジ日時 | 2024-10-02 14:30:07 |
| 合計ジャッジ時間 | 2,238 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
n,x = map(int, input().split())
a = list(map(int, input().split()))
mxa=max(a)
cnts=[0]*(mxa+1)
for i in range(n):
cnts[a[i]]+=1
ans=0
for i in range(mxa+1):
nokori = x-i
if 0<=nokori<=mxa:
ans+=cnts[i]*cnts[nokori]
print(ans)
s_shohei