2023CSP考前冲刺模拟4
Done
OI
Start at: 2023-10-1 8:30
4
hour(s)
Host:
5
Notice: 公告
请认真拿部分分,我相信这套题想AC两道题很难,但是靠拿部分分获得200分很简单 2023-11-16 21:11:36
Notice: 乘法逆元
#include #include #include #include #define int long long using namespace std; const int maxn=3e6+5; int inv[maxn]; signed main() { int n,p; cin>>n>>p; inv[1]=1; cout<<1<<endl; for(int i=2;i<=n;i++) inv[i]=p-(p/i)*inv[p%i]%p, printf("%lld\n",inv[i]); return 0; } 2023-11-16 21:11:36
- Status
- Done
- Rule
- OI
- Problem
- 4
- Start at
- 2023-10-1 8:30
- End at
- 2023-10-1 12:30
- Duration
- 4 hour(s)
- Host
- Partic.
- 5