結果

問題 No.544 Delete 7
ユーザー 14番14番
提出日時 2017-07-14 22:40:34
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,386 bytes
コンパイル時間 1,012 ms
コンパイル使用メモリ 115,296 KB
実行使用メモリ 34,900 KB
最終ジャッジ日時 2024-04-16 20:25:57
合計ジャッジ時間 3,817 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,936 KB
testcase_01 AC 25 ms
18,432 KB
testcase_02 AC 30 ms
19,968 KB
testcase_03 AC 25 ms
18,688 KB
testcase_04 AC 25 ms
18,176 KB
testcase_05 AC 25 ms
18,560 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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));
            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 = @"
 
 
17


 
";
	}

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