結果
| 問題 |
No.723 2つの数の和
|
| コンテスト | |
| ユーザー |
clocklr
|
| 提出日時 | 2018-09-28 16:56:56 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 728 bytes |
| コンパイル時間 | 778 ms |
| コンパイル使用メモリ | 107,692 KB |
| 実行使用メモリ | 26,496 KB |
| 最終ジャッジ日時 | 2024-10-12 04:54:21 |
| 合計ジャッジ時間 | 2,744 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 13 WA * 2 RE * 7 |
コンパイルメッセージ
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 kazu = int.Parse(input[0]);
int total = int.Parse(input[1]);
string[] number = ReadLine().Split(' ');
int[] num = new int[110000];
int max = 0;
for(int i=0;i<kazu;i++){
int a = int.Parse(number[i]);
num[a]++;
max = Max(max,a);
}
int count = 0;
for(int i=0;i<=max;i++){
int j = total-i;
if(j<=100000 && i<=100000){
count += num[i] * num[j];
}
}
WriteLine(count);
}
}
clocklr