結果

問題 No.481 1から10
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2020-12-29 23:44:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 3,652 ms
コンパイル使用メモリ 75,156 KB
実行使用メモリ 54,044 KB
最終ジャッジ日時 2024-04-16 00:35:41
合計ジャッジ時間 5,200 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
39,932 KB
testcase_01 AC 121 ms
41,416 KB
testcase_02 AC 109 ms
40,392 KB
testcase_03 AC 122 ms
41,028 KB
testcase_04 AC 126 ms
41,076 KB
testcase_05 AC 124 ms
41,196 KB
testcase_06 AC 124 ms
41,028 KB
testcase_07 AC 122 ms
41,108 KB
testcase_08 AC 109 ms
39,888 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

// https://yukicoder.me/problems/no/481
public class OneToTen481 {
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);
    // String 1つ分を読み込む
    int result = 0;
    int n = 0;
    while (n < 9) {
      int s1 = Integer.parseInt(sc.next());
      n += 1;
      if (s1 - n > 0 && result == 0) {
        // 標準出力に書き出す。
        result = n;
      }
    }
    if (n == 0)
      result = 10;
    System.out.println(result);
  }
}
0