結果

問題 No.723 2つの数の和
ユーザー ikdikd
提出日時 2018-08-03 23:19:57
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 275 bytes
コンパイル時間 2,947 ms
コンパイル使用メモリ 68,720 KB
実行使用メモリ 14,636 KB
最終ジャッジ日時 2023-09-13 19:00:48
合計ジャッジ時間 4,695 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,376 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 30 ms
14,396 KB
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils

var
  args=stdin.readLine.split.map(parseInt)
  (n, x)=(args[0], args[1])
  a=stdin.readLine.split.map(parseInt)

var freq=newSeq[int64](100000+1)
for v in a: freq[v]+=1
var tot:int64=0
for v in a:
  if x-v>=0:
    tot+=freq[v]*freq[x-v]
echo tot

0