Submission #19550780


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 ;}

ll calc(V<ll> &ans,int n){
    if(ans[n]>=0) return ans[n] ;
    return ans[n]=(calc(ans,n-1)*2+1)%mod ;
}

int main(){
    int n ; cin >> n ;
    V<ll> ans(n+1,-1) ;
    ans[1] = 1 ;
    cout << calc(ans,n) << endl ;
}

Submission Info

Submission Time
Task A - Dodecagon
User Izayoi_R
Language C++ (GCC 9.2.1)
Score 0
Code Size 1292 Byte
Status WA
Exec Time 53 ms
Memory 42264 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 1
AC × 1
WA × 11
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 WA 53 ms 42192 KB
001.txt WA 2 ms 3624 KB
002.txt WA 6 ms 5740 KB
003.txt WA 51 ms 42084 KB
004.txt WA 52 ms 41692 KB
005.txt WA 5 ms 4260 KB
006.txt WA 3 ms 3612 KB
007.txt WA 5 ms 4364 KB
008.txt WA 51 ms 42264 KB
009.txt WA 50 ms 42188 KB
010.txt WA 2 ms 3628 KB
example0.txt AC 2 ms 3592 KB