Submission #19551757


Source Code Expand

Copy
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <chrono>
#include <random>
#include <assert.h>
#include <functional>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 998244353 ;
long double pie = acos(-1) ;
ll INF = 1000000000000 ;
 
void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T b){	if(a<b) a = b ;}
template<class T> void chmin(T &a,T b){	if(a>b) a = b ;}

vector<ll> fac(2,1),inv(2,1),finv(2,1) ;
 
void nCr_set(int n){
	for(int i=2;i<=n;i++){
		fac.push_back(fac.at(i-1)*i%mod) ;
		inv.push_back(mod-inv.at(mod%i)*(mod/i)%mod) ;
		finv.push_back(finv.at(i-1)*inv.at(i)%mod) ;
	}
}
 
ll nCr(ll n,ll r){
	if(n<0||r<0||n<r) return 0 ;
	if(n==r||r==0) return 1 ;
	return fac.at(n)*finv.at(n-r)%mod*finv.at(r)%mod ;
}
 
ll nPr(ll n,ll r){
	return fac.at(n)*finv.at(n-r)%mod ;
}
 
ll nHr(ll n,ll r){
	return nCr(n+r-1,n-1) ;
}

int main(){
    nCr_set(3e6) ;
    int n ; cin >> n ;
    cout << nCr(2*n,n)*499122177%mod << endl ;
}

Submission Info

Submission Time
Task A - Dodecagon
User Izayoi_R
Language C++ (GCC 9.2.1)
Score 500
Code Size 1660 Byte
Status AC
Exec Time 417 ms
Memory 73596 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 1
AC × 12
Set Name Test Cases
Sample example0.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, example0.txt
Case Name Status Exec Time Memory
000.txt AC 417 ms 73544 KB
001.txt AC 406 ms 73432 KB
002.txt AC 406 ms 73456 KB
003.txt AC 401 ms 73596 KB
004.txt AC 412 ms 73592 KB
005.txt AC 414 ms 73528 KB
006.txt AC 414 ms 73432 KB
007.txt AC 415 ms 73532 KB
008.txt AC 412 ms 73588 KB
009.txt AC 408 ms 73408 KB
010.txt AC 412 ms 73544 KB
example0.txt AC 409 ms 73544 KB