結果

問題 No.557 点対称
ユーザー fal_rndfal_rnd
提出日時 2017-08-11 23:35:49
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 806 bytes
コンパイル時間 6,755 ms
コンパイル使用メモリ 81,204 KB
実行使用メモリ 54,124 KB
最終ジャッジ日時 2024-04-20 23:46:41
合計ジャッジ時間 6,695 ms
ジャッジサーバーID
(参考情報)
judge7 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
41,068 KB
testcase_01 RE -
testcase_02 AC 109 ms
41,148 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 105 ms
41,404 KB
testcase_06 AC 109 ms
41,132 KB
testcase_07 RE -
testcase_08 AC 107 ms
41,472 KB
testcase_09 AC 103 ms
41,436 KB
testcase_10 RE -
testcase_11 AC 104 ms
41,364 KB
testcase_12 AC 108 ms
41,372 KB
testcase_13 AC 104 ms
40,168 KB
testcase_14 AC 105 ms
40,940 KB
testcase_15 AC 104 ms
41,612 KB
testcase_16 RE -
testcase_17 AC 94 ms
40,072 KB
testcase_18 AC 105 ms
40,228 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 104 ms
41,384 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 97 ms
41,180 KB
testcase_26 AC 110 ms
41,008 KB
testcase_27 AC 104 ms
40,992 KB
testcase_28 AC 99 ms
41,228 KB
testcase_29 AC 106 ms
40,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		long n=getInt(),r=4,mod=1000000007;
		if(n==1) {
			System.out.println(2);
			return;
		}
		r=r*modPow(5,n/2-1,mod)%mod;
		if(n%2==1)
			r=r*3%mod;
		System.out.println(r);
	}
	public static long modPow(long n,long p,long mod) {
		if(p==0) return 1;
		if(p==1) return n%mod;
		if(p%2==0) {
			long buf=modPow(n, p/2, mod);
			return buf*buf%mod;
		}
		return n*modPow(n, p-1, mod)%mod;
	}
}
0