結果

問題 No.141 魔法少女コバ
ユーザー tsunabittsunabit
提出日時 2020-03-05 17:38:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 445 bytes
コンパイル時間 3,500 ms
コンパイル使用メモリ 74,156 KB
実行使用メモリ 54,972 KB
最終ジャッジ日時 2024-04-22 02:39:53
合計ジャッジ時間 15,720 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
53,932 KB
testcase_01 AC 100 ms
52,736 KB
testcase_02 AC 111 ms
53,948 KB
testcase_03 AC 101 ms
52,888 KB
testcase_04 AC 112 ms
53,940 KB
testcase_05 AC 115 ms
53,916 KB
testcase_06 AC 119 ms
54,152 KB
testcase_07 AC 102 ms
53,112 KB
testcase_08 AC 102 ms
52,948 KB
testcase_09 AC 117 ms
54,016 KB
testcase_10 AC 115 ms
53,928 KB
testcase_11 AC 104 ms
52,724 KB
testcase_12 AC 104 ms
52,996 KB
testcase_13 AC 111 ms
52,944 KB
testcase_14 AC 119 ms
54,112 KB
testcase_15 AC 122 ms
53,888 KB
testcase_16 AC 119 ms
54,084 KB
testcase_17 AC 113 ms
53,960 KB
testcase_18 AC 115 ms
54,016 KB
testcase_19 AC 113 ms
54,048 KB
testcase_20 AC 108 ms
52,892 KB
testcase_21 AC 120 ms
54,308 KB
testcase_22 AC 104 ms
54,540 KB
testcase_23 AC 111 ms
54,192 KB
testcase_24 AC 106 ms
53,788 KB
testcase_25 AC 117 ms
54,184 KB
testcase_26 AC 116 ms
53,868 KB
testcase_27 AC 103 ms
52,948 KB
testcase_28 AC 119 ms
53,896 KB
testcase_29 AC 119 ms
53,976 KB
testcase_30 AC 119 ms
54,292 KB
testcase_31 AC 117 ms
54,072 KB
testcase_32 AC 125 ms
54,004 KB
testcase_33 AC 110 ms
54,972 KB
testcase_34 AC 122 ms
54,080 KB
testcase_35 AC 123 ms
53,932 KB
testcase_36 AC 122 ms
54,144 KB
testcase_37 AC 122 ms
54,024 KB
testcase_38 AC 123 ms
54,304 KB
testcase_39 AC 123 ms
54,092 KB
testcase_40 AC 108 ms
54,092 KB
testcase_41 AC 123 ms
54,304 KB
testcase_42 AC 124 ms
53,800 KB
testcase_43 AC 123 ms
53,772 KB
testcase_44 AC 122 ms
54,112 KB
testcase_45 AC 121 ms
53,936 KB
testcase_46 AC 119 ms
53,680 KB
testcase_47 AC 125 ms
53,764 KB
testcase_48 AC 117 ms
53,880 KB
testcase_49 AC 118 ms
54,132 KB
testcase_50 AC 118 ms
53,808 KB
testcase_51 AC 110 ms
52,948 KB
testcase_52 AC 121 ms
53,872 KB
testcase_53 AC 119 ms
54,128 KB
testcase_54 AC 122 ms
53,908 KB
testcase_55 AC 122 ms
54,260 KB
testcase_56 AC 119 ms
54,048 KB
testcase_57 AC 124 ms
53,848 KB
testcase_58 AC 136 ms
53,728 KB
testcase_59 AC 123 ms
54,088 KB
testcase_60 AC 118 ms
53,868 KB
testcase_61 AC 119 ms
53,936 KB
testcase_62 AC 118 ms
53,840 KB
testcase_63 AC 100 ms
52,880 KB
testcase_64 AC 101 ms
52,964 KB
testcase_65 AC 111 ms
54,144 KB
testcase_66 AC 112 ms
53,824 KB
testcase_67 AC 102 ms
53,020 KB
testcase_68 AC 101 ms
52,992 KB
testcase_69 AC 105 ms
53,028 KB
testcase_70 AC 123 ms
53,860 KB
testcase_71 AC 104 ms
52,800 KB
testcase_72 AC 111 ms
54,120 KB
testcase_73 AC 112 ms
53,996 KB
testcase_74 AC 116 ms
54,008 KB
testcase_75 AC 102 ms
53,124 KB
testcase_76 AC 99 ms
53,020 KB
testcase_77 AC 114 ms
54,012 KB
testcase_78 AC 109 ms
54,080 KB
testcase_79 AC 103 ms
52,952 KB
testcase_80 AC 108 ms
53,760 KB
testcase_81 AC 110 ms
53,788 KB
testcase_82 AC 117 ms
53,932 KB
testcase-evil-0.txt AC 115 ms
53,892 KB
testcase-evil-1.txt AC 101 ms
52,744 KB
testcase-evil-2.txt AC 100 ms
53,064 KB
testcase-evil-3.txt AC 102 ms
53,100 KB
testcase-evil-4.txt AC 104 ms
52,984 KB
testcase-evil-5.txt AC 114 ms
54,144 KB
testcase-evil-6.txt AC 110 ms
54,040 KB
testcase-evil-7.txt AC 117 ms
53,848 KB
testcase-evil-8.txt AC 114 ms
54,160 KB
testcase-evil-9.txt AC 103 ms
52,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No141 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int m = sc.nextInt(), n = sc.nextInt();
		int c = 0;
		while(m != n) {
			if(m > n) {
				int t = 0;
				if(m%n == 0) t = (m / n)-1;
				else t = m / n;
				m = m - (t*n);
				c += t;
			}else {
				int t = m;
				m = n;
				n = t;
				c++;
			}
		}
		System.out.println(c);
    }
}
0