結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 19 ms
10,532 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 22 ms
10,988 KB
testcase_07 AC 10 ms
6,948 KB
testcase_08 AC 13 ms
8,204 KB
testcase_09 AC 23 ms
11,352 KB
testcase_10 RE -
testcase_11 AC 4 ms
4,380 KB
testcase_12 AC 14 ms
8,680 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 20 ms
12,976 KB
testcase_19 AC 29 ms
14,504 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 24 ms
12,948 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[x-v]
echo tot

0