結果
| 問題 | 
                            No.723 2つの数の和
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-10-17 23:41:59 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 963 bytes | 
| コンパイル時間 | 855 ms | 
| コンパイル使用メモリ | 106,240 KB | 
| 実行使用メモリ | 24,576 KB | 
| 最終ジャッジ日時 | 2024-10-12 18:57:06 | 
| 合計ジャッジ時間 | 4,486 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | TLE * 1 -- * 21 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
    public class Program
    {
        static void Main(string[] args)
        {
            new Program().Main2(Console.In, Console.Out);
        }
        public void Main2(TextReader reader, TextWriter writer)
        {
            var sum = int.Parse(reader.ReadLine().Split()[1]);
            var progression = reader.ReadLine().Split().Select(x => int.Parse(x)).ToList();
            var combinationNum = 0;
            foreach(var num in progression)
            {
                if (num >= sum) continue;
                var another = Math.Abs(sum - num);
                var anotherList = progression.FindAll(n => n == another);
                combinationNum += anotherList.Count;
            }
            writer.WriteLine(combinationNum);
        }
    }
}