This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Q002 | |
{ | |
static void Main() | |
{ | |
var n = int.Parse(Console.ReadLine()); | |
for (int x = 0; x < 1 << n; x++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
class Q014 | |
{ | |
static long[] ReadL() => Array.ConvertAll(Console.ReadLine().Split(), long.Parse); | |
static void Main() | |
{ | |
var n = int.Parse(Console.ReadLine()); | |
var a = ReadL(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
class Q020 | |
{ | |
static void Main() => Console.WriteLine(Solve() ? "Yes" : "No"); | |
static bool Solve() | |
{ | |
var a = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); | |
return a[0] < Enumerable.Repeat(a[2], (int)a[1]).Aggregate((x, y) => x * y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Q004 | |
{ | |
static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse); | |
static (int, int) Read2() { var a = Read(); return (a[0], a[1]); } | |
static void Main() | |
{ | |
var (h, w) = Read2(); | |
var a = Array.ConvertAll(new bool[h], _ => Read()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
class Q022 | |
{ | |
static void Main() | |
{ | |
var a = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); | |
var g = a.Aggregate(Gcd); | |
Console.WriteLine(a.Sum(x => x / g - 1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class Q008 | |
{ | |
const string AtCoder = "atcoder"; | |
const long M = 1000000007; | |
static void Main() | |
{ | |
var n = int.Parse(Console.ReadLine()); | |
var s = Console.ReadLine(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
class Q027 | |
{ | |
static void Main() | |
{ | |
var n = int.Parse(Console.ReadLine()); | |
var set = new HashSet<string>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void KeyValuePair_Deconstruct() | |
{ | |
var d = Enumerable.Range(1, 100).ToDictionary(i => i, i => i / 2.0); | |
foreach (var (i, value) in d) | |
Console.WriteLine($"{i} {value}"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
namespace OperatorsLib.Classes | |
{ | |
public abstract class EquatableObject | |
{ | |
// ValueType と同様に、すべてのフィールドで等価性を評価します。 | |
public override bool Equals(object obj) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace OperatorsLib.Structs | |
{ | |
public struct Vector2 | |
{ | |
public double X { get; } | |
public double Y { get; } | |
public Vector2(double x, double y) => (X, Y) = (x, y); | |
public void Deconstruct(out double x, out double y) => (x, y) = (X, Y); |