結果
問題 | No.141 魔法少女コバ |
ユーザー | mban |
提出日時 | 2017-01-12 15:40:06 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 28 ms / 5,000 ms |
コード長 | 1,862 bytes |
コンパイル時間 | 3,098 ms |
コンパイル使用メモリ | 109,200 KB |
実行使用メモリ | 28,052 KB |
最終ジャッジ日時 | 2024-12-21 10:12:58 |
合計ジャッジ時間 | 6,273 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 25 ms
24,224 KB |
testcase_01 | AC | 26 ms
22,068 KB |
testcase_02 | AC | 26 ms
25,812 KB |
testcase_03 | AC | 27 ms
23,708 KB |
testcase_04 | AC | 26 ms
25,816 KB |
testcase_05 | AC | 26 ms
24,116 KB |
testcase_06 | AC | 27 ms
23,908 KB |
testcase_07 | AC | 27 ms
25,948 KB |
testcase_08 | AC | 26 ms
23,780 KB |
testcase_09 | AC | 25 ms
23,652 KB |
testcase_10 | AC | 26 ms
24,108 KB |
testcase_11 | AC | 26 ms
23,704 KB |
testcase_12 | AC | 26 ms
23,780 KB |
testcase_13 | AC | 27 ms
28,052 KB |
testcase_14 | AC | 26 ms
23,900 KB |
testcase_15 | AC | 26 ms
23,960 KB |
testcase_16 | AC | 26 ms
23,832 KB |
testcase_17 | AC | 26 ms
23,776 KB |
testcase_18 | AC | 26 ms
26,012 KB |
testcase_19 | AC | 26 ms
22,072 KB |
testcase_20 | AC | 27 ms
25,692 KB |
testcase_21 | AC | 26 ms
24,040 KB |
testcase_22 | AC | 26 ms
23,972 KB |
testcase_23 | AC | 25 ms
23,708 KB |
testcase_24 | AC | 27 ms
26,016 KB |
testcase_25 | AC | 26 ms
25,952 KB |
testcase_26 | AC | 26 ms
24,112 KB |
testcase_27 | AC | 26 ms
21,688 KB |
testcase_28 | AC | 26 ms
23,784 KB |
testcase_29 | AC | 26 ms
24,244 KB |
testcase_30 | AC | 26 ms
25,980 KB |
testcase_31 | AC | 26 ms
23,648 KB |
testcase_32 | AC | 26 ms
23,648 KB |
testcase_33 | AC | 27 ms
26,132 KB |
testcase_34 | AC | 26 ms
24,036 KB |
testcase_35 | AC | 26 ms
23,648 KB |
testcase_36 | AC | 27 ms
23,912 KB |
testcase_37 | AC | 27 ms
23,840 KB |
testcase_38 | AC | 26 ms
23,728 KB |
testcase_39 | AC | 27 ms
21,940 KB |
testcase_40 | AC | 26 ms
24,032 KB |
testcase_41 | AC | 27 ms
24,168 KB |
testcase_42 | AC | 26 ms
23,652 KB |
testcase_43 | AC | 28 ms
25,880 KB |
testcase_44 | AC | 26 ms
23,980 KB |
testcase_45 | AC | 25 ms
23,776 KB |
testcase_46 | AC | 26 ms
24,092 KB |
testcase_47 | AC | 26 ms
23,656 KB |
testcase_48 | AC | 25 ms
25,888 KB |
testcase_49 | AC | 26 ms
23,980 KB |
testcase_50 | AC | 27 ms
24,240 KB |
testcase_51 | AC | 26 ms
24,096 KB |
testcase_52 | AC | 26 ms
23,908 KB |
testcase_53 | AC | 26 ms
25,752 KB |
testcase_54 | AC | 27 ms
24,028 KB |
testcase_55 | AC | 26 ms
23,968 KB |
testcase_56 | AC | 27 ms
25,812 KB |
testcase_57 | AC | 26 ms
24,032 KB |
testcase_58 | AC | 26 ms
23,976 KB |
testcase_59 | AC | 26 ms
25,876 KB |
testcase_60 | AC | 26 ms
23,776 KB |
testcase_61 | AC | 26 ms
25,820 KB |
testcase_62 | AC | 26 ms
23,904 KB |
testcase_63 | AC | 27 ms
23,980 KB |
testcase_64 | AC | 28 ms
25,944 KB |
testcase_65 | AC | 25 ms
23,908 KB |
testcase_66 | AC | 26 ms
23,776 KB |
testcase_67 | AC | 26 ms
24,164 KB |
testcase_68 | AC | 26 ms
25,948 KB |
testcase_69 | AC | 26 ms
23,704 KB |
testcase_70 | AC | 26 ms
23,904 KB |
testcase_71 | AC | 26 ms
22,192 KB |
testcase_72 | AC | 26 ms
23,780 KB |
testcase_73 | AC | 26 ms
23,924 KB |
testcase_74 | AC | 26 ms
23,836 KB |
testcase_75 | AC | 26 ms
25,820 KB |
testcase_76 | AC | 26 ms
23,776 KB |
testcase_77 | AC | 26 ms
24,092 KB |
testcase_78 | AC | 26 ms
21,808 KB |
testcase_79 | AC | 27 ms
23,776 KB |
testcase_80 | AC | 26 ms
25,820 KB |
testcase_81 | AC | 27 ms
21,816 KB |
testcase_82 | AC | 26 ms
25,948 KB |
testcase-evil-0.txt | AC | 26 ms
23,524 KB |
testcase-evil-1.txt | AC | 27 ms
23,832 KB |
testcase-evil-2.txt | AC | 26 ms
23,708 KB |
testcase-evil-3.txt | AC | 27 ms
23,652 KB |
testcase-evil-4.txt | AC | 26 ms
24,088 KB |
testcase-evil-5.txt | AC | 27 ms
23,772 KB |
testcase-evil-6.txt | AC | 26 ms
23,984 KB |
testcase-evil-7.txt | AC | 26 ms
25,952 KB |
testcase-evil-8.txt | AC | 26 ms
23,708 KB |
testcase-evil-9.txt | AC | 27 ms
23,964 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; using System.IO; class Program { static private Magatro M = new Magatro(); static private void Main(string[]args) { M.Scan(); M.Solve(); } } public class Scanner { private string[] S; private int Index; private char Separator; public Scanner(char separator = ' ') { Index = 0; Separator = separator; } private string[] Line() { return Console.ReadLine().Split(Separator); } public string Next() { string result; if (S == null || Index >= S.Length) { S = Line(); Index = 0; } result = S[Index]; Index++; return result; } public int NextInt() { return int.Parse(Next()); } public double NextDouble() { return double.Parse(Next()); } public long NextLong() { return long.Parse(Next()); } } public class Magatro { private int M, N; public void Scan() { Scanner sc = new Scanner(); M = sc.NextInt(); N = sc.NextInt(); } public void Solve() { int cnt = 0; while (M != N) { if (M < N) { Swap(ref M, ref N); cnt++; } else { cnt += M / N; M %= N; if (M == 0) { cnt--; break; } } } Console.WriteLine(cnt); } private void Swap(ref int a,ref int b) { int temp=a; a = b; b = temp; } }