結果
問題 |
No.2880 Max Sigma Mod
|
ユーザー |
![]() |
提出日時 | 2024-09-08 12:55:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 428 bytes |
コンパイル時間 | 1,909 ms |
コンパイル使用メモリ | 195,692 KB |
最終ジャッジ日時 | 2025-02-24 05:26:19 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 5 TLE * 1 -- * 42 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N,M; cin>>N>>M; vector<bool>P(N+1,true); long ans=0; for(int x=2;x<=N;x++) { if(P[x]) { for(int y=x;y<=N;y+=y)P[y]=false; long sum=0; for(int i=1;i<=M;i++)sum+=(x%i); ans=max(ans,sum); } } cout<<ans<<endl; }