結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー fgwiebfaoishfgwiebfaoish
提出日時 2021-02-03 14:14:59
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 834 ms / 2,000 ms
コード長 3,243 bytes
コンパイル時間 3,363 ms
コンパイル使用メモリ 110,264 KB
実行使用メモリ 67,624 KB
最終ジャッジ日時 2023-09-12 12:51:41
合計ジャッジ時間 58,360 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
20,940 KB
testcase_01 AC 62 ms
20,944 KB
testcase_02 AC 62 ms
20,796 KB
testcase_03 AC 424 ms
52,452 KB
testcase_04 AC 418 ms
52,388 KB
testcase_05 AC 404 ms
50,104 KB
testcase_06 AC 411 ms
49,960 KB
testcase_07 AC 557 ms
60,576 KB
testcase_08 AC 570 ms
58,672 KB
testcase_09 AC 199 ms
41,572 KB
testcase_10 AC 203 ms
39,480 KB
testcase_11 AC 687 ms
59,596 KB
testcase_12 AC 697 ms
59,484 KB
testcase_13 AC 466 ms
51,224 KB
testcase_14 AC 468 ms
53,216 KB
testcase_15 AC 411 ms
49,788 KB
testcase_16 AC 411 ms
51,856 KB
testcase_17 AC 726 ms
59,372 KB
testcase_18 AC 723 ms
57,416 KB
testcase_19 AC 647 ms
64,224 KB
testcase_20 AC 639 ms
62,120 KB
testcase_21 AC 700 ms
67,624 KB
testcase_22 AC 679 ms
65,684 KB
testcase_23 AC 489 ms
54,912 KB
testcase_24 AC 503 ms
54,828 KB
testcase_25 AC 138 ms
31,936 KB
testcase_26 AC 134 ms
32,000 KB
testcase_27 AC 284 ms
48,084 KB
testcase_28 AC 291 ms
46,012 KB
testcase_29 AC 333 ms
45,124 KB
testcase_30 AC 339 ms
45,296 KB
testcase_31 AC 438 ms
58,376 KB
testcase_32 AC 431 ms
60,444 KB
testcase_33 AC 333 ms
42,956 KB
testcase_34 AC 330 ms
44,864 KB
testcase_35 AC 423 ms
50,264 KB
testcase_36 AC 415 ms
52,252 KB
testcase_37 AC 139 ms
34,476 KB
testcase_38 AC 135 ms
34,380 KB
testcase_39 AC 126 ms
32,796 KB
testcase_40 AC 122 ms
30,664 KB
testcase_41 AC 194 ms
38,728 KB
testcase_42 AC 190 ms
40,724 KB
testcase_43 AC 170 ms
35,908 KB
testcase_44 AC 741 ms
59,300 KB
testcase_45 AC 345 ms
45,556 KB
testcase_46 AC 160 ms
36,544 KB
testcase_47 AC 537 ms
57,056 KB
testcase_48 AC 513 ms
47,676 KB
testcase_49 AC 533 ms
53,092 KB
testcase_50 AC 488 ms
43,764 KB
testcase_51 AC 92 ms
21,552 KB
testcase_52 AC 819 ms
58,204 KB
testcase_53 AC 834 ms
60,340 KB
testcase_54 AC 766 ms
58,300 KB
testcase_55 AC 762 ms
60,312 KB
testcase_56 AC 766 ms
60,408 KB
testcase_57 AC 767 ms
58,424 KB
testcase_58 AC 761 ms
60,404 KB
testcase_59 AC 762 ms
56,312 KB
testcase_60 AC 758 ms
58,348 KB
testcase_61 AC 742 ms
62,408 KB
testcase_62 AC 760 ms
60,508 KB
testcase_63 AC 765 ms
60,276 KB
testcase_64 AC 769 ms
60,340 KB
testcase_65 AC 763 ms
58,344 KB
testcase_66 AC 770 ms
60,340 KB
testcase_67 AC 783 ms
60,452 KB
testcase_68 AC 770 ms
58,404 KB
testcase_69 AC 752 ms
58,372 KB
testcase_70 AC 752 ms
58,280 KB
testcase_71 AC 747 ms
60,436 KB
testcase_72 AC 780 ms
56,376 KB
testcase_73 AC 769 ms
60,364 KB
testcase_74 AC 751 ms
60,264 KB
testcase_75 AC 756 ms
58,372 KB
testcase_76 AC 765 ms
58,220 KB
testcase_77 AC 757 ms
60,400 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;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Diagnostics;
//using nint=System.Int32;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.Ia;
		var a=sc.Ia;
		var b=sc.Ia;
		var c=sc.Ia;
		var d=sc.Ia;
		Array.Sort(a);
		Array.Sort(b);
		Array.Sort(c);
		Array.Sort(d);
		long ans=0;
		for(int i = 0;i < s[0];i++) {
			var h=new int[]{a[i],b[i],c[i],d[i]};
			Array.Sort(h);
			ans=(ans+Fp(h[3]-h[0],s[1],s[2]))%s[2];
		}
		Console.WriteLine("{0}",ans);
	}
	static long Fp(long x,long e,int mod){
		long r=1;
		while(e>0){
			if((e&1)>0){r*=x;r%=mod;}
			x=(x*x)%mod;
			e>>=1;
		}
		return r;
	}
}

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(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),int.Parse);}
	public int[] Ia3(int a){return Array.ConvertAll((Console.ReadLine()+" "+a.ToString()).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),long.Parse);}
	public long[] La3(int a){return Array.ConvertAll((Console.ReadLine()+" "+a.ToString()).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).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;}
	public (T,T) Tp2<T>(){var s=Console.ReadLine().Split();return (Ct<T>(s[0]),Ct<T>(s[1]));}
	public (T,T,T) Tp3<T>(){var s=Console.ReadLine().Split();return (Ct<T>(s[0]),Ct<T>(s[1]),Ct<T>(s[2]));}
	public (T1,T1,T2) Tp3<T1,T2>(){var s=Console.ReadLine().Split();return (Ct<T1>(s[0]),Ct<T1>(s[1]),Ct<T2>(s[2]));}
	private T Ct<T>(string s){return (T)Convert.ChangeType(s,typeof(T));}
}
0