結果
| 問題 |
No.545 ママの大事な二人の子供
|
| コンテスト | |
| ユーザー |
mban
|
| 提出日時 | 2017-07-14 23:53:02 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,232 bytes |
| コンパイル時間 | 1,105 ms |
| コンパイル使用メモリ | 104,960 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-10-08 00:08:19 |
| 合計ジャッジ時間 | 2,684 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 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 System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;
class Program
{
static void Main()
{
new Magatro().Solve();
}
}
class Magatro
{
private int N;
private int[] A, B;
private List<long> a = new List<long>();
private List<long> b = new List<long>();
private long ans = long.MaxValue;
private void Scan()
{
N = int.Parse(Console.ReadLine());
A = new int[N];
B = new int[N];
for (int i = 0; i < N; i++)
{
var line = Console.ReadLine().Split(' ');
A[i] = int.Parse(line[0]);
B[i] = int.Parse(line[1]);
}
}
private void DFS(long aa, long bb, int left, int right, List<long> t)
{
if (left == right)
{
t.Add(aa - bb);
return;
}
DFS(aa + A[left], bb, left + 1, right, t);
DFS(aa, bb + B[left], left + 1, right, t);
}
public void Solve()
{
Scan();
//DFS(0, 0, 0, N / 2, a);
//DFS(0, 0, N / 2, N, b);
//b.Sort();
//long ans = long.MaxValue;
//foreach (long l in a)
//{
// int left = 0, right = b.Count;
// while (right - left > 1)
// {
// int mid = (left + right) / 2;
// if (l + b[mid] <= 0)
// {
// left = mid;
// }
// else
// {
// right = mid;
// }
// }
// ans = Math.Min(Math.Abs(l + b[left]), ans);
// left = -1;
// right = b.Count - 1;
// while (right - left > 1)
// {
// int mid = (left + right) / 2;
// if (l + b[mid] >= 0)
// {
// right = mid;
// }
// else
// {
// left = mid;
// }
// }
// ans = Math.Min(Math.Abs(l + b[right]), ans);
//}
//Console.WriteLine(ans);
}
}
mban