結果

問題 No.648  お や す み 
ユーザー arbtarbt
提出日時 2018-02-09 22:46:21
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,435 bytes
コンパイル時間 2,222 ms
コンパイル使用メモリ 104,960 KB
実行使用メモリ 23,296 KB
最終ジャッジ日時 2024-04-17 05:24:15
合計ジャッジ時間 6,897 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
23,296 KB
testcase_01 AC 24 ms
17,664 KB
testcase_02 AC 24 ms
17,664 KB
testcase_03 AC 23 ms
17,792 KB
testcase_04 AC 24 ms
17,792 KB
testcase_05 AC 23 ms
17,792 KB
testcase_06 AC 23 ms
17,664 KB
testcase_07 AC 23 ms
17,792 KB
testcase_08 AC 23 ms
17,536 KB
testcase_09 AC 23 ms
17,792 KB
testcase_10 AC 23 ms
17,792 KB
testcase_11 AC 23 ms
17,792 KB
testcase_12 AC 23 ms
17,792 KB
testcase_13 AC 24 ms
17,792 KB
testcase_14 AC 24 ms
17,664 KB
testcase_15 AC 23 ms
17,920 KB
testcase_16 AC 23 ms
17,664 KB
testcase_17 AC 24 ms
17,664 KB
testcase_18 AC 24 ms
17,792 KB
testcase_19 AC 24 ms
17,920 KB
testcase_20 AC 24 ms
17,920 KB
testcase_21 AC 23 ms
17,920 KB
testcase_22 AC 24 ms
17,792 KB
testcase_23 AC 24 ms
17,792 KB
testcase_24 AC 24 ms
17,664 KB
testcase_25 AC 24 ms
17,792 KB
testcase_26 AC 24 ms
17,664 KB
testcase_27 AC 24 ms
17,792 KB
testcase_28 AC 24 ms
17,792 KB
testcase_29 AC 24 ms
17,280 KB
testcase_30 AC 25 ms
17,664 KB
testcase_31 AC 24 ms
17,792 KB
testcase_32 AC 24 ms
17,792 KB
testcase_33 AC 24 ms
17,664 KB
testcase_34 AC 24 ms
17,792 KB
testcase_35 AC 23 ms
17,920 KB
testcase_36 AC 24 ms
17,792 KB
testcase_37 AC 25 ms
17,664 KB
testcase_38 AC 24 ms
17,408 KB
testcase_39 AC 24 ms
18,048 KB
testcase_40 AC 24 ms
17,664 KB
testcase_41 AC 23 ms
17,536 KB
testcase_42 AC 23 ms
17,792 KB
testcase_43 AC 23 ms
17,536 KB
testcase_44 AC 23 ms
17,792 KB
testcase_45 AC 24 ms
17,920 KB
testcase_46 AC 23 ms
17,664 KB
testcase_47 AC 24 ms
17,792 KB
testcase_48 AC 23 ms
17,792 KB
testcase_49 AC 23 ms
17,792 KB
testcase_50 AC 36 ms
17,920 KB
testcase_51 AC 32 ms
17,792 KB
testcase_52 AC 36 ms
17,792 KB
testcase_53 AC 41 ms
17,664 KB
testcase_54 AC 48 ms
17,920 KB
testcase_55 AC 36 ms
17,792 KB
testcase_56 AC 40 ms
17,792 KB
testcase_57 AC 41 ms
17,792 KB
testcase_58 AC 40 ms
17,792 KB
testcase_59 AC 27 ms
17,792 KB
testcase_60 TLE -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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;
  }
}
0