結果

問題 No.747 循環小数N桁目 Hard
ユーザー fgwiebfaoishfgwiebfaoish
提出日時 2020-03-27 17:10:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 2,845 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 107,612 KB
実行使用メモリ 25,212 KB
最終ジャッジ日時 2023-08-30 16:32:36
合計ジャッジ時間 12,126 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
21,236 KB
testcase_01 AC 50 ms
21,148 KB
testcase_02 AC 50 ms
21,072 KB
testcase_03 AC 51 ms
21,240 KB
testcase_04 AC 51 ms
21,100 KB
testcase_05 AC 50 ms
21,248 KB
testcase_06 AC 50 ms
23,216 KB
testcase_07 AC 51 ms
21,172 KB
testcase_08 AC 50 ms
21,000 KB
testcase_09 AC 50 ms
21,124 KB
testcase_10 AC 50 ms
21,172 KB
testcase_11 AC 50 ms
23,096 KB
testcase_12 AC 50 ms
21,172 KB
testcase_13 AC 50 ms
21,152 KB
testcase_14 AC 50 ms
23,152 KB
testcase_15 AC 49 ms
21,144 KB
testcase_16 AC 50 ms
21,052 KB
testcase_17 AC 50 ms
21,060 KB
testcase_18 AC 51 ms
19,252 KB
testcase_19 AC 51 ms
18,892 KB
testcase_20 AC 51 ms
21,072 KB
testcase_21 AC 50 ms
19,256 KB
testcase_22 AC 51 ms
21,192 KB
testcase_23 AC 51 ms
21,212 KB
testcase_24 AC 52 ms
21,236 KB
testcase_25 AC 51 ms
21,128 KB
testcase_26 AC 50 ms
21,060 KB
testcase_27 AC 49 ms
21,036 KB
testcase_28 AC 50 ms
23,108 KB
testcase_29 AC 50 ms
23,160 KB
testcase_30 AC 50 ms
20,976 KB
testcase_31 AC 50 ms
19,168 KB
testcase_32 AC 50 ms
23,104 KB
testcase_33 AC 51 ms
21,044 KB
testcase_34 AC 51 ms
23,132 KB
testcase_35 AC 51 ms
23,052 KB
testcase_36 AC 52 ms
20,988 KB
testcase_37 AC 50 ms
23,324 KB
testcase_38 AC 51 ms
21,204 KB
testcase_39 AC 51 ms
23,140 KB
testcase_40 AC 51 ms
21,048 KB
testcase_41 AC 52 ms
21,156 KB
testcase_42 AC 51 ms
21,036 KB
testcase_43 AC 51 ms
21,040 KB
testcase_44 AC 51 ms
20,976 KB
testcase_45 AC 52 ms
21,108 KB
testcase_46 AC 53 ms
21,240 KB
testcase_47 AC 52 ms
21,100 KB
testcase_48 AC 51 ms
21,116 KB
testcase_49 AC 51 ms
21,044 KB
testcase_50 AC 50 ms
21,256 KB
testcase_51 AC 52 ms
25,212 KB
testcase_52 AC 50 ms
21,104 KB
testcase_53 AC 53 ms
21,200 KB
testcase_54 AC 52 ms
21,224 KB
testcase_55 AC 52 ms
23,276 KB
testcase_56 AC 51 ms
21,168 KB
testcase_57 AC 51 ms
21,120 KB
testcase_58 AC 54 ms
21,112 KB
testcase_59 AC 51 ms
21,228 KB
testcase_60 AC 52 ms
21,048 KB
testcase_61 AC 52 ms
23,184 KB
testcase_62 AC 52 ms
23,084 KB
testcase_63 AC 51 ms
23,016 KB
testcase_64 AC 51 ms
21,104 KB
testcase_65 AC 50 ms
21,288 KB
testcase_66 AC 51 ms
23,160 KB
testcase_67 AC 51 ms
21,296 KB
testcase_68 AC 51 ms
21,228 KB
testcase_69 AC 52 ms
22,972 KB
testcase_70 AC 51 ms
21,132 KB
testcase_71 AC 52 ms
20,964 KB
testcase_72 AC 52 ms
23,100 KB
testcase_73 AC 53 ms
21,164 KB
testcase_74 AC 52 ms
23,032 KB
testcase_75 AC 51 ms
20,960 KB
testcase_76 AC 52 ms
21,176 KB
testcase_77 AC 52 ms
18,868 KB
testcase_78 AC 52 ms
20,944 KB
testcase_79 AC 52 ms
21,100 KB
testcase_80 AC 52 ms
20,872 KB
testcase_81 AC 52 ms
22,948 KB
testcase_82 AC 51 ms
21,052 KB
testcase_83 AC 51 ms
23,096 KB
testcase_84 AC 51 ms
21,048 KB
testcase_85 AC 52 ms
20,924 KB
testcase_86 AC 52 ms
23,248 KB
testcase_87 AC 52 ms
23,020 KB
testcase_88 AC 51 ms
19,068 KB
testcase_89 AC 51 ms
23,084 KB
testcase_90 AC 51 ms
21,160 KB
testcase_91 AC 51 ms
21,056 KB
testcase_92 AC 51 ms
20,984 KB
testcase_93 AC 52 ms
21,100 KB
testcase_94 AC 52 ms
21,136 KB
testcase_95 AC 52 ms
19,192 KB
testcase_96 AC 52 ms
21,148 KB
testcase_97 AC 52 ms
21,048 KB
testcase_98 AC 52 ms
21,320 KB
testcase_99 AC 52 ms
21,092 KB
testcase_100 AC 52 ms
21,112 KB
testcase_101 AC 51 ms
23,156 KB
testcase_102 AC 52 ms
21,108 KB
testcase_103 AC 52 ms
22,848 KB
testcase_104 AC 51 ms
23,144 KB
testcase_105 AC 52 ms
21,120 KB
testcase_106 AC 53 ms
23,088 KB
testcase_107 AC 52 ms
23,172 KB
testcase_108 AC 53 ms
23,216 KB
testcase_109 AC 52 ms
21,304 KB
testcase_110 AC 52 ms
19,176 KB
testcase_111 AC 52 ms
19,100 KB
testcase_112 AC 51 ms
21,100 KB
testcase_113 AC 51 ms
21,232 KB
testcase_114 AC 54 ms
22,908 KB
testcase_115 AC 51 ms
19,124 KB
testcase_116 AC 53 ms
21,108 KB
testcase_117 AC 52 ms
18,884 KB
testcase_118 AC 52 ms
21,036 KB
testcase_119 AC 51 ms
20,980 KB
testcase_120 AC 53 ms
21,040 KB
testcase_121 AC 53 ms
21,136 KB
testcase_122 AC 52 ms
21,052 KB
testcase_123 AC 52 ms
21,212 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.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.S;
		var t=sc.S;
		int p=0,g=0;
		var z="4285714";
		for(int i = 0;i<s.Length;i++) {
			p*=10;
			p+=s[i]-'0';
			p%=6;
		}
		for(int i = 0;i<t.Length;i++) {
			g*=10;
			g+=t[i]-'0';
			g%=4;
		}
		int ans=(int)Pow(p,g+4)%6;
		Console.WriteLine("{0}",z[ans]);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}
0