Submission #1355921


Source Code Expand

//#pragma warning disable
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System;
using System.Numerics;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;
class E { static void Main() => new K(); }
class K
{
	int F() => int.Parse(ReadLine());
	long FL() => int.Parse(ReadLine());
	int[] G() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
	long[] GL() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
	public const int MOD = 1000000007;
	public K()
	{
		//SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		//Out.Flush();
	}
	int N;
	readonly List<Surface> all = new List<Surface>();
	readonly HashSet<Surface> empty = new HashSet<Surface>();
	readonly Dictionary<int, Dictionary<int, Dictionary<int, Dictionary<int, HashSet<Surface>>>>> dict = new Dictionary<int, Dictionary<int, Dictionary<int, Dictionary<int, HashSet<Surface>>>>>();
	void Solve()
	{
		var R = G();
		WriteLine(1 / (1.0 / R[0] + 1.0 / R[1]));
		/*N = F();
		var surf = new int[N][];
		for (var i = 0; i < N; i++)
		{
			surf[i] = G();
			for (var j = 0; j < 4; j++) all.Add(new Surface(i, surf[i], j));
		}
		foreach (var x in all) Add(x);
		// ans = e / 24
		var e = 0L;
		foreach (var x in all)
			foreach (var y in all)
			{
				if (x.Number == y.Number) continue;
				var s = new[] {
					Get(y[3], y[2], x[3], x[2]),
					Get(y[2], y[1], x[0], x[3]),
					Get(y[1], y[0], x[1], x[0]),
					Get(y[0], y[3], x[2], x[1])
				};
				var rx = new bool[4];
				var ry = new bool[4];
				for (var i = 0; i < 4; i++) ;
			}*/
	}
	void Add(Surface s)
	{
		int i = s[0], j = s[1], k = s[2], l = s[3];
		if (!dict.ContainsKey(i)) dict[i] = new Dictionary<int, Dictionary<int, Dictionary<int, HashSet<Surface>>>>();
		if (!dict[i].ContainsKey(j)) dict[i][j] = new Dictionary<int, Dictionary<int, HashSet<Surface>>>();
		if (!dict[i][j].ContainsKey(k)) dict[i][j][k] = new Dictionary<int, HashSet<Surface>>();
		if (!dict[i][j][k].ContainsKey(l)) dict[i][j][k][l] = new HashSet<Surface>();
		dict[i][j][k][l].Add(s);
	}
	HashSet<Surface> Get(int i, int j, int k, int l)
	{
		if (!dict.ContainsKey(i) || !dict[i].ContainsKey(j) || !dict[i][j].ContainsKey(k) || !dict[i][j][k].ContainsKey(l)) return empty;
		return dict[i][j][k][l];
	}
}
class Surface
{
	// 0 <= Number < N
	// 0 <= Rotate < 4 (mod 4)
	public int Number, Rotate;
	public int[] Color;
	public int this[int i]
	{
		get {
			return Color[(i + Rotate) % 4];
		}
	}
	public Surface(int n, int[] c, int r = 0)
	{
		Number = n;
		Color = c;
		Rotate = r;
	}
}

Submission Info

Submission Time
Task A - Equivalent Resistance
User selpo
Language C# (Mono 4.6.2.0)
Score 100
Code Size 2845 Byte
Status AC
Exec Time 27 ms
Memory 13408 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 23
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All sample_01.txt, sample_02.txt, sample_01.txt, sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt
Case Name Status Exec Time Memory
sample_01.txt AC 27 ms 11612 KB
sample_02.txt AC 26 ms 11476 KB
subtask1_01.txt AC 26 ms 11360 KB
subtask1_02.txt AC 26 ms 13396 KB
subtask1_03.txt AC 26 ms 11360 KB
subtask1_04.txt AC 26 ms 11360 KB
subtask1_05.txt AC 26 ms 13408 KB
subtask1_06.txt AC 26 ms 11360 KB
subtask1_07.txt AC 25 ms 9428 KB
subtask1_08.txt AC 26 ms 11360 KB
subtask1_09.txt AC 25 ms 11360 KB
subtask1_10.txt AC 25 ms 11360 KB
subtask1_11.txt AC 25 ms 11360 KB
subtask1_12.txt AC 25 ms 9428 KB
subtask1_13.txt AC 26 ms 11360 KB
subtask1_14.txt AC 26 ms 11360 KB
subtask1_15.txt AC 26 ms 11360 KB
subtask1_16.txt AC 25 ms 9428 KB
subtask1_17.txt AC 25 ms 9312 KB
subtask1_18.txt AC 26 ms 11360 KB
subtask1_19.txt AC 25 ms 11360 KB