結果
| 問題 | No.299 蟻本が読めない |
| コンテスト | |
| ユーザー |
astatine0x55
|
| 提出日時 | 2016-11-24 18:29:07 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 19 ms / 1,000 ms |
| コード長 | 2,081 bytes |
| コンパイル時間 | 1,268 ms |
| コンパイル使用メモリ | 108,672 KB |
| 実行使用メモリ | 17,536 KB |
| 最終ジャッジ日時 | 2024-11-27 10:36:35 |
| 合計ジャッジ時間 | 1,727 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
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.Generic;
using System.Linq;
using static System.Console;
using static System.Math;
using static ConsoleApplication.Utils;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
var n = ReadLong();
WriteLine((n-1) * 52 + 316);
}
}
public static class Utils
{
#region Extensions for IO
public static long ReadLong()
=> ReadLine().ToLong();
public static int ReadInt()
=> ReadLine().ToInt();
public static IEnumerable<int> ReadInts()
=> ReadStrings().Select(int.Parse);
public static IEnumerable<string> ReadStrings()
=> ReadLine().Split(' ');
public static IEnumerable<string> ReadLines(int n)
{
foreach (var i in Enumerable.Range(0, n))
{
yield return ReadLine();
}
}
#endregion
#region Extensions of int
public static bool IsOdd(this int n)
=> !n.IsEven();
public static bool IsEven(this int n)
=> n % 2 == 0;
public static bool CanDivideWith(this int n, int divisor)
=> n % divisor == 0;
#endregion
#region Extensions of string
public static int ToInt(this string str)
=> int.Parse(str);
public static long ToLong(this string str)
=> long.Parse(str);
public static bool IsNullOrEmpty(this string str)
=> string.IsNullOrEmpty(str);
#endregion
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
{
foreach (var item in source)
{
action(item);
}
}
public static IEnumerable<T> Peek<T>(this IEnumerable<T> source, Action<T> action)
{
foreach (var item in source)
{
action(item);
}
return source;
}
}
}
astatine0x55