結果

問題 No.544 Delete 7
ユーザー 14番14番
提出日時 2017-07-14 22:43:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 1,000 ms
コード長 1,391 bytes
コンパイル時間 2,852 ms
コンパイル使用メモリ 105,836 KB
実行使用メモリ 23,768 KB
最終ジャッジ日時 2023-08-13 22:05:11
合計ジャッジ時間 8,553 ms
ジャッジサーバーID
(参考情報)
judge15 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,680 KB
testcase_01 AC 61 ms
21,692 KB
testcase_02 AC 61 ms
21,612 KB
testcase_03 AC 60 ms
21,636 KB
testcase_04 AC 60 ms
21,716 KB
testcase_05 AC 61 ms
21,660 KB
testcase_06 AC 61 ms
21,676 KB
testcase_07 AC 61 ms
21,572 KB
testcase_08 AC 61 ms
23,768 KB
testcase_09 AC 62 ms
23,692 KB
testcase_10 AC 60 ms
21,616 KB
testcase_11 AC 60 ms
21,612 KB
testcase_12 AC 60 ms
19,700 KB
testcase_13 AC 61 ms
23,720 KB
testcase_14 AC 60 ms
23,612 KB
testcase_15 AC 61 ms
21,720 KB
testcase_16 AC 60 ms
21,696 KB
testcase_17 AC 61 ms
21,708 KB
testcase_18 AC 61 ms
21,744 KB
testcase_19 AC 61 ms
21,712 KB
testcase_20 AC 62 ms
21,616 KB
testcase_21 AC 62 ms
21,632 KB
testcase_22 AC 62 ms
23,608 KB
testcase_23 AC 61 ms
23,756 KB
testcase_24 AC 60 ms
21,584 KB
testcase_25 AC 62 ms
23,628 KB
testcase_26 AC 61 ms
21,668 KB
testcase_27 AC 61 ms
21,668 KB
testcase_28 AC 61 ms
23,624 KB
testcase_29 AC 63 ms
23,700 KB
testcase_30 AC 60 ms
21,672 KB
testcase_31 AC 61 ms
21,576 KB
testcase_32 AC 64 ms
21,728 KB
testcase_33 AC 61 ms
23,628 KB
testcase_34 AC 60 ms
21,632 KB
testcase_35 AC 60 ms
19,652 KB
testcase_36 AC 60 ms
19,668 KB
testcase_37 AC 61 ms
21,724 KB
testcase_38 AC 62 ms
23,748 KB
testcase_39 AC 61 ms
21,664 KB
testcase_40 AC 62 ms
21,636 KB
testcase_41 AC 61 ms
23,616 KB
testcase_42 AC 61 ms
19,768 KB
testcase_43 AC 61 ms
23,668 KB
testcase_44 AC 63 ms
21,636 KB
testcase_45 AC 62 ms
21,680 KB
testcase_46 AC 61 ms
21,724 KB
testcase_47 AC 62 ms
21,632 KB
testcase_48 AC 61 ms
21,616 KB
testcase_49 AC 61 ms
21,564 KB
testcase_50 AC 61 ms
23,568 KB
testcase_51 AC 61 ms
21,696 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{

	public void Proc()
	{
        long num = long.Parse(Reader.ReadLine());
        long num1 = num;
        long num2 = 0;
        for (long i = 0; i <= num; i++) {
            
            if(num1.ToString().Any(a=>a=='7') || num2.ToString().Any(a=>a=='7') ) {
                
            } else {
                break;
            }
            int keta = 0;
            if(num1.ToString().IndexOf('7')>=0) {
                keta = num1.ToString().Length - num1.ToString().IndexOf('7'); 
            } else {
                keta = num2.ToString().Length - num2.ToString().IndexOf('7');
            }
            num1 -= int.Parse("1".PadRight(keta, '0'));
            num2 = num - num1;
         }
        Console.WriteLine(num1 + " " + num2);
    }


	public class Reader
	{
		private static StringReader sr;
		public static bool IsDebug = false;
		public static string ReadLine()
		{
			if (IsDebug)
			{
				if (sr == null)
				{
					sr = new StringReader(InputText.Trim());
				}
				return sr.ReadLine();
			}
			else
			{
				return Console.ReadLine();
			}
		}
		private static string InputText = @"
 
 
77


 
";
	}

	public static void Main(string[] args)
	{
#if DEBUG
		Reader.IsDebug = true;
#endif
		Program prg = new Program();
		prg.Proc();
	}
}
0