Submission #55378135


Source Code Expand

// LUOGU_RID: 164691133
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const int mod=998244353;
ll n;
ll qpow(ll a,ll b){
	ll res=1;
	while(b){
		if(b&1)res=res*a%mod;
		b>>=1;
		a=a*a%mod;
	}
	return res;
}
int main(){
    #ifndef ONLINE_JUDGE
    freopen("1.txt","r",stdin);
    #endif
    #ifdef ONLINE_JUDGE
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    #endif
	cin>>n;
	ll b=qpow(10,to_string(n).size())%mod;
	ll inv=qpow(b-1,mod-2);
	cout<<n%mod*(qpow(b,n%(mod-1))-1)%mod*inv%mod;
    return 0;
}

Submission Info

Submission Time
Task D - 88888888
User WUSICHENG
Language C++ 17 (gcc 12.2)
Score 350
Code Size 573 Byte
Status AC
Exec Time 2 ms
Memory 3628 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 3
AC × 28
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3496 KiB
example_01.txt AC 1 ms 3556 KiB
example_02.txt AC 1 ms 3628 KiB
hand_00.txt AC 1 ms 3432 KiB
hand_01.txt AC 1 ms 3620 KiB
hand_02.txt AC 1 ms 3420 KiB
hand_03.txt AC 2 ms 3476 KiB
hand_04.txt AC 1 ms 3364 KiB
hand_05.txt AC 1 ms 3568 KiB
hand_06.txt AC 1 ms 3560 KiB
hand_07.txt AC 1 ms 3400 KiB
hand_08.txt AC 1 ms 3468 KiB
hand_09.txt AC 1 ms 3504 KiB
random_00.txt AC 1 ms 3572 KiB
random_01.txt AC 1 ms 3488 KiB
random_02.txt AC 1 ms 3568 KiB
random_03.txt AC 1 ms 3504 KiB
random_04.txt AC 1 ms 3428 KiB
random_05.txt AC 1 ms 3424 KiB
random_06.txt AC 1 ms 3508 KiB
random_07.txt AC 1 ms 3508 KiB
random_08.txt AC 1 ms 3504 KiB
random_09.txt AC 1 ms 3428 KiB
random_10.txt AC 1 ms 3428 KiB
random_11.txt AC 1 ms 3496 KiB
random_12.txt AC 1 ms 3432 KiB
random_13.txt AC 1 ms 3492 KiB
random_14.txt AC 1 ms 3564 KiB