結果

問題 No.723 2つの数の和
ユーザー _matumo__matumo_
提出日時 2018-09-13 17:24:15
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 576 bytes
コンパイル時間 2,075 ms
コンパイル使用メモリ 103,196 KB
実行使用メモリ 31,540 KB
最終ジャッジ日時 2023-09-13 19:55:08
合計ジャッジ時間 5,310 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
24,100 KB
testcase_01 AC 61 ms
22,020 KB
testcase_02 AC 61 ms
24,024 KB
testcase_03 AC 89 ms
27,752 KB
testcase_04 AC 97 ms
28,752 KB
testcase_05 AC 93 ms
28,268 KB
testcase_06 AC 95 ms
28,416 KB
testcase_07 AC 80 ms
26,132 KB
testcase_08 AC 81 ms
26,248 KB
testcase_09 AC 97 ms
30,716 KB
testcase_10 AC 80 ms
24,244 KB
testcase_11 AC 71 ms
22,576 KB
testcase_12 AC 84 ms
24,668 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 61 ms
24,024 KB
testcase_21 AC 60 ms
24,056 KB
testcase_22 AC 60 ms
22,136 KB
testcase_23 AC 98 ms
30,752 KB
testcase_24 AC 77 ms
21,404 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

namespace YukiCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var va = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var vb = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = va[0];
            int M = va[1];
            int[] xa = new int[200000 + 1];
            var xSum = 0;
            foreach (var n in vb) if (M - n >= 0) xa[M - n]++;
            foreach (var n in vb)   xSum += xa[n];
            Console.WriteLine(xSum);
        }
    }
}
0