結果
| 問題 | 
                            No.723 2つの数の和
                             | 
                    
| コンテスト | |
| ユーザー | 
                             clocklr
                         | 
                    
| 提出日時 | 2018-09-28 17:13:34 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 718 bytes | 
| コンパイル時間 | 4,598 ms | 
| コンパイル使用メモリ | 110,048 KB | 
| 実行使用メモリ | 32,056 KB | 
| 最終ジャッジ日時 | 2024-10-12 05:24:22 | 
| 合計ジャッジ時間 | 2,699 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 WA * 2 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using static System.Console;
using static System.Math;
public class Hello{
    public static void Main(){
        string[] input = ReadLine().Split(' ');
        int n = int.Parse(input[0]);
        int x = int.Parse(input[1]);
        if(x>200000){
            WriteLine("0");
        }else{
            string[] num = ReadLine().Split(' ');
            int[] count = new int[300000];
            for(int i=0;i<n;i++){
                int temp = int.Parse(num[i]);
                count[temp]++;
            }
            int ans = 0;
            for(int i=0;i<=x;i++){
                int j = x-i;
                ans += count[i] * count[j];
            }
            WriteLine(ans);
        }
    }
}
            
            
            
        
            
clocklr