QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#521895 | #7046. Function! | CharwingHawk | WA | 0ms | 3728kb | C++14 | 1.1kb | 2024-08-16 16:28:24 | 2024-08-16 16:28:24 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define fuck cout<<"fuck "
#define _ <<' '<<
#define __ <<' '
#define __l <<'\n'
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define Mod(x) ((x) %MOD +MOD) %MOD
#define int long long
#define append push_back
const int INF = 6452864528;
const int N = 1e5 + 10;
const int MatN = 3;
const int MOD = 998244353;
int tin,tinn,tinnn,tmp;string stin,stinn,stinnn;int itr;
// ---
// ---
void solve(){
int n; cin>>n;
int res = 0;
for(int a=2;a<=n;a++){
int tmp = a;
int exp = 1;
int ares = 0;
while(tmp * a < n){
ares -= exp * tmp;
tmp *= a;
ares += exp * tmp;
exp ++;
}
ares = (ares + exp * (n+1-tmp)) %MOD;
ares = (ares * a) %MOD;
res += ares %MOD;
}
cout<<res %MOD;
}
signed main(){
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
//cout<<fixed<<setprecision(3);
signed o_O = 1;
// cin>>o_O;
while (o_O--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3672kb
input:
2
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
10
output:
236
result:
ok 1 number(s): "236"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
20
output:
1646
result:
ok 1 number(s): "1646"
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3668kb
input:
27
output:
3859
result:
wrong answer 1st numbers differ - expected: '3862', found: '3859'