結果
問題 | No.141 魔法少女コバ |
ユーザー | crazybbb3 |
提出日時 | 2017-01-29 22:00:29 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 821 ms / 5,000 ms |
コード長 | 1,950 bytes |
コンパイル時間 | 2,140 ms |
コンパイル使用メモリ | 77,464 KB |
実行使用メモリ | 50,856 KB |
最終ジャッジ日時 | 2024-06-06 09:32:15 |
合計ジャッジ時間 | 13,823 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 55 ms
50,220 KB |
testcase_01 | AC | 756 ms
50,672 KB |
testcase_02 | AC | 821 ms
50,856 KB |
testcase_03 | AC | 58 ms
49,916 KB |
testcase_04 | AC | 57 ms
50,004 KB |
testcase_05 | AC | 56 ms
49,896 KB |
testcase_06 | AC | 57 ms
49,912 KB |
testcase_07 | AC | 56 ms
50,232 KB |
testcase_08 | AC | 57 ms
50,316 KB |
testcase_09 | AC | 57 ms
50,316 KB |
testcase_10 | AC | 58 ms
50,280 KB |
testcase_11 | AC | 57 ms
50,340 KB |
testcase_12 | AC | 56 ms
50,140 KB |
testcase_13 | AC | 58 ms
49,816 KB |
testcase_14 | AC | 57 ms
50,212 KB |
testcase_15 | AC | 55 ms
50,324 KB |
testcase_16 | AC | 57 ms
50,252 KB |
testcase_17 | AC | 58 ms
50,204 KB |
testcase_18 | AC | 56 ms
50,104 KB |
testcase_19 | AC | 58 ms
50,076 KB |
testcase_20 | AC | 58 ms
50,064 KB |
testcase_21 | AC | 57 ms
50,276 KB |
testcase_22 | AC | 56 ms
50,312 KB |
testcase_23 | AC | 54 ms
50,136 KB |
testcase_24 | AC | 55 ms
50,036 KB |
testcase_25 | AC | 55 ms
49,932 KB |
testcase_26 | AC | 55 ms
49,884 KB |
testcase_27 | AC | 56 ms
50,216 KB |
testcase_28 | AC | 56 ms
49,852 KB |
testcase_29 | AC | 54 ms
50,288 KB |
testcase_30 | AC | 54 ms
50,328 KB |
testcase_31 | AC | 55 ms
50,196 KB |
testcase_32 | AC | 55 ms
50,372 KB |
testcase_33 | AC | 56 ms
50,364 KB |
testcase_34 | AC | 56 ms
50,292 KB |
testcase_35 | AC | 54 ms
50,132 KB |
testcase_36 | AC | 53 ms
50,308 KB |
testcase_37 | AC | 55 ms
50,048 KB |
testcase_38 | AC | 55 ms
50,188 KB |
testcase_39 | AC | 54 ms
50,224 KB |
testcase_40 | AC | 54 ms
49,972 KB |
testcase_41 | AC | 54 ms
50,404 KB |
testcase_42 | AC | 53 ms
50,068 KB |
testcase_43 | AC | 53 ms
50,272 KB |
testcase_44 | AC | 54 ms
49,932 KB |
testcase_45 | AC | 54 ms
50,212 KB |
testcase_46 | AC | 54 ms
50,288 KB |
testcase_47 | AC | 56 ms
50,064 KB |
testcase_48 | AC | 56 ms
50,292 KB |
testcase_49 | AC | 55 ms
50,024 KB |
testcase_50 | AC | 54 ms
50,120 KB |
testcase_51 | AC | 53 ms
49,776 KB |
testcase_52 | AC | 53 ms
50,152 KB |
testcase_53 | AC | 54 ms
49,788 KB |
testcase_54 | AC | 55 ms
50,268 KB |
testcase_55 | AC | 55 ms
50,204 KB |
testcase_56 | AC | 54 ms
50,064 KB |
testcase_57 | AC | 54 ms
50,216 KB |
testcase_58 | AC | 53 ms
50,252 KB |
testcase_59 | AC | 51 ms
50,312 KB |
testcase_60 | AC | 52 ms
49,912 KB |
testcase_61 | AC | 54 ms
50,060 KB |
testcase_62 | AC | 52 ms
49,932 KB |
testcase_63 | AC | 54 ms
50,388 KB |
testcase_64 | AC | 51 ms
50,292 KB |
testcase_65 | AC | 53 ms
49,864 KB |
testcase_66 | AC | 53 ms
50,252 KB |
testcase_67 | AC | 53 ms
50,212 KB |
testcase_68 | AC | 57 ms
49,932 KB |
testcase_69 | AC | 56 ms
50,572 KB |
testcase_70 | AC | 56 ms
50,224 KB |
testcase_71 | AC | 55 ms
49,972 KB |
testcase_72 | AC | 56 ms
50,164 KB |
testcase_73 | AC | 57 ms
49,984 KB |
testcase_74 | AC | 58 ms
50,240 KB |
testcase_75 | AC | 59 ms
49,972 KB |
testcase_76 | AC | 56 ms
50,320 KB |
testcase_77 | AC | 58 ms
50,256 KB |
testcase_78 | AC | 58 ms
50,240 KB |
testcase_79 | AC | 57 ms
50,316 KB |
testcase_80 | AC | 57 ms
50,032 KB |
testcase_81 | AC | 57 ms
50,348 KB |
testcase_82 | AC | 56 ms
50,236 KB |
testcase-evil-0.txt | AC | 419 ms
51,024 KB |
testcase-evil-1.txt | AC | 289 ms
50,916 KB |
testcase-evil-2.txt | AC | 129 ms
50,860 KB |
testcase-evil-3.txt | AC | 184 ms
50,768 KB |
testcase-evil-4.txt | AC | 573 ms
50,808 KB |
testcase-evil-5.txt | AC | 252 ms
50,988 KB |
testcase-evil-6.txt | AC | 163 ms
50,964 KB |
testcase-evil-7.txt | AC | 455 ms
50,888 KB |
testcase-evil-8.txt | AC | 172 ms
50,856 KB |
testcase-evil-9.txt | AC | 97 ms
50,844 KB |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { void solve() throws IOException { int n = ni(), m = ni(); int ans = 0; while (n != m) { ans++; if (n < m) { int tmp = n; n = m; m = tmp; } else { n -= m; } } out.println(ans); } int gcd(int a, int b) { return a == 0 ? b : gcd(b % a, a); } String ns() throws IOException { while (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine(), " "); } return tok.nextToken(); } int ni() throws IOException { return Integer.parseInt(ns()); } long nl() throws IOException { return Long.parseLong(ns()); } double nd() throws IOException { return Double.parseDouble(ns()); } String[] nsa(int n) throws IOException { String[] res = new String[n]; for (int i = 0; i < n; i++) { res[i] = ns(); } return res; } int[] nia(int n) throws IOException { int[] res = new int[n]; for (int i = 0; i < n; i++) { res[i] = ni(); } return res; } long[] nla(int n) throws IOException { long[] res = new long[n]; for (int i = 0; i < n; i++) { res[i] = nl(); } return res; } static BufferedReader in; static PrintWriter out; static StringTokenizer tok; public static void main(String[] args) throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); tok = new StringTokenizer(""); Main main = new Main(); main.solve(); out.close(); } }