提交记录 27890
用户 |
题目 |
状态 |
得分 |
用时 |
内存 |
语言 |
代码长度 |
wxqwq |
test. 自定义测试 |
Accepted |
100 |
104.2 ms |
44 KB |
C++ |
1.25 KB |
提交时间 |
评测时间 |
2025-02-06 17:38:54 |
2025-02-06 17:38:56 |
#include <bits/stdc++.h>
using namespace std;
inline int rd()
{
int x=0;bool f=0;char ch=getchar();
while(ch<'0' || ch>'9') {if(ch=='-') f=1;ch=getchar();}
while(ch>='0' && ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
return f?-x:x;
}
#define x first
#define y second
#define vec vector
#define mp make_pair
#define pb emplace_back
#define upb upper_bound
#define lowb lower_bound
#define isz(x) (int)x.size()
#define gmx(a,b) (a=max(a,b))
#define gmn(a,b) (a=min(a,b))
#define fil(a,x) memset(a,x,sizeof(a))
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
/*
*/
typedef __int128 i128;
typedef long long LL;
typedef long double LD;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef set<int>::iterator iter;
const int P=1e6+3,B=5000;
LL s(int x) {
LL ans=0,pw=1;
while(x>1) {
// ans=(ans+pw*P)%P;
pw=P-pw*(P/x)%P;
x=P%x;
}
// cerr<<pw<<"\n";
return pw;
// return x<=1?1:P-P/x*s(P%x)%P;
// if(x<=1) return 1;
// return P-P/x*s(P%x)%P;
}
LL qmi(int x,int k=P-2) {LL res=1; while(k) {if(k&1) res=res*x%P; x=x*1ll*x%P,k>>=1;} return res;}
signed main()
{
ull ans=0;
double st=clock();
rep(i,2,P) ans+=s(i);
double ed=clock();
cout<<ed-st<<' '<<ans<<" ms\n";
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 104.2 ms | 44 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-03-14 15:53:26 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠