結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
21,788 KB
testcase_01 AC 61 ms
21,820 KB
testcase_02 AC 60 ms
21,912 KB
testcase_03 AC 90 ms
27,412 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 95 ms
30,056 KB
testcase_07 AC 79 ms
23,880 KB
testcase_08 AC 81 ms
23,912 KB
testcase_09 AC 98 ms
26,376 KB
testcase_10 RE -
testcase_11 AC 70 ms
22,548 KB
testcase_12 AC 83 ms
24,376 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 62 ms
23,812 KB
testcase_21 AC 60 ms
21,856 KB
testcase_22 AC 60 ms
21,804 KB
testcase_23 AC 99 ms
28,368 KB
testcase_24 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[100000 + 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