[BOJ/C#] 3009 네 번째 점
Algorithm 2023. 1. 28. 23:24반응형
https://www.acmicpc.net/problem/3009
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Pipes;
using System.Linq;
using System.Numerics;
using System.Text;
namespace BOJ
{
class Program
{
static void Main(string[] args)
{
StreamReader sr = new StreamReader(new BufferedStream(Console.OpenStandardInput()));
StreamWriter sw = new StreamWriter(new BufferedStream(Console.OpenStandardOutput()));
Dictionary<int, int> dic1 = new Dictionary<int, int>();
Dictionary<int, int> dic2 = new Dictionary<int, int>();
for (int i = 0; i < 3; i++)
{
int[] xy = Array.ConvertAll(sr.ReadLine().Split(), int.Parse);
//sw.WriteLine("{0} {1}", xy[0], xy[1]);
if(dic1.ContainsKey(xy[0])) dic1[xy[0]]++;
else dic1.Add(xy[0], 1);
if(dic2.ContainsKey(xy[1])) dic2[xy[1]]++;
else dic2.Add(xy[1], 1);
}
var a = dic1.Where(x => x.Value != 2).First();
var b = dic2.Where(x => x.Value != 2).First();
sw.WriteLine("{0} {1}", a.Key, b.Key);
sr.Close();
sw.Close();
}
}
}
반응형
'Algorithm' 카테고리의 다른 글
[프로그래머스] 비밀지도 (0) | 2023.01.29 |
---|---|
[BOJ/C#] 2163 초콜릿 자르기 (0) | 2023.01.29 |
[BOJ/C#] 2579 계단오르기 (0) | 2023.01.28 |
[BOJ/C#] 15829 Hashing (0) | 2023.01.27 |
[BOJ/C#] 4949 균형잡힌 세상 (0) | 2023.01.26 |