結果
問題 |
No.648 お や す み
|
ユーザー |
![]() |
提出日時 | 2018-02-09 22:46:21 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,435 bytes |
コンパイル時間 | 1,023 ms |
コンパイル使用メモリ | 111,428 KB |
実行使用メモリ | 30,800 KB |
最終ジャッジ日時 | 2024-10-08 16:48:52 |
合計ジャッジ時間 | 7,644 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 60 TLE * 1 -- * 23 |
コンパイルメッセージ
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 System.Text; using System.Diagnostics; using System.IO; using System.Numerics; // 参照 class _Class { void _Do() { var N = Split.longs()[0]; long sum = 0; for (long jump=1;;jump++) { sum += jump; if (N == sum) { Console.WriteLine("YES"); Console.WriteLine(jump); return; } else if (N<sum) { Console.WriteLine("NO"); return; } } } static void Main(string[] args) { new _Class()._Do(); } } // static class Split { // 1 public static string[] strings() { return Console.ReadLine().Split(); } // [2.1] -2,147,483,648 ~ +2,147,483,647 public static int[] ints() { var _s = Console.ReadLine().Split(); var x = new int[_s.Length]; for (var i = 0; i < _s.Length; i++) x[i] = int.Parse(_s[i]); return x; } // [2.2] // -9,223,372,036,854,775,808 ~ // +9,223,372,036,854,775,807 public static long[] longs() { var _s = Console.ReadLine().Split(); var x = new long[_s.Length]; for (var i = 0; i < _s.Length; i++) x[i] = long.Parse(_s[i]); return x; } public static BigInteger[] bigs() { var _s = Console.ReadLine().Split(); var x = new BigInteger[_s.Length]; for (var i = 0; i < _s.Length; i++) x[i] = BigInteger.Parse(_s[i]); return x; } }