답안 #20043

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
20043 2016-02-25T08:50:33 Z pjh0123 악수 (kriii4_D) C++
0 / 100
0 ms 1084 KB
#include <stdio.h>
#include <string.h>
#include <vector>
#include <queue>
#include <stdlib.h>
#include <algorithm>
#include <cmath>
#define INFL 90000000000000000
#define PI 3.141592653589793238462643383279502884
#define SQ(a) ((a)*(a))
#define pb push_back
#define mod 1000000007
typedef long long ll;
typedef long double ld;
typedef double dd;
typedef std::pair<int,int> pii;
using namespace std;


ll in(ll a){
	a%=mod;
	ll ret=1;
	ll x=mod-2;
	while(x){
		if(x%2){
			ret=ret*a%mod;			
		}
		a=a*a%mod;	
		x/=2;
	}
	return ret;
}

ll aofb(ll a,ll b){
	return a*in(b)%mod;
}

ll n,ans[10];
int main(){
	scanf("%lld",&n);
	ans[1]=0;
  	ans[2]=1;
  	ans[3]=2;
  	ans[4]=aofb(13,4);
  	ans[5]=aofb(4013,840);
	if(n<=5){
		printf("%lld",ans[n]);
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Incorrect 0 ms 1084 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Halted 0 ms 0 KB -