結果
問題 | No.333 門松列を数え上げ |
ユーザー |
![]() |
提出日時 | 2016-01-15 23:39:03 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 124 ms / 2,000 ms |
コード長 | 772 bytes |
コンパイル時間 | 2,272 ms |
コンパイル使用メモリ | 75,128 KB |
実行使用メモリ | 54,188 KB |
最終ジャッジ日時 | 2024-09-19 19:33:43 |
合計ジャッジ時間 | 3,930 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
53,896 KB |
testcase_01 | AC | 120 ms
53,864 KB |
testcase_02 | AC | 124 ms
54,188 KB |
testcase_03 | AC | 123 ms
53,736 KB |
testcase_04 | AC | 118 ms
53,888 KB |
testcase_05 | AC | 123 ms
53,828 KB |
testcase_06 | AC | 109 ms
52,996 KB |
testcase_07 | AC | 124 ms
53,812 KB |
testcase_08 | AC | 124 ms
53,636 KB |
ソースコード
import java.awt.Frame; import java.net.NetworkInterface; import java.util.*; public class Main { static long gcd(long a,long b){ return b == 0 ? a : gcd(b, a%b); } static long lcm(long a, long b){ return a*b/gcd(a, b); } static int[] dx = {0,1,0,-1};//→↓←↑ static int[] dy = {1,0,-1,0}; static class Pair{ long weight,value; public Pair(long weight,long value) { // TODO Auto-generated constructor stub this.weight = weight; this.value = value; } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); if(a==b){ System.out.println(0); return; } if(a<b){ System.out.println(b-1-1); }else{ System.out.println(2000000000-b-1); } } }