結果
問題 | No.2880 Max Sigma Mod |
ユーザー |
|
提出日時 | 2024-09-18 00:12:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 218 ms / 3,000 ms |
コード長 | 653 bytes |
コンパイル時間 | 1,894 ms |
コンパイル使用メモリ | 170,204 KB |
実行使用メモリ | 24,700 KB |
最終ジャッジ日時 | 2024-09-18 00:12:48 |
合計ジャッジ時間 | 6,066 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 48 |
ソースコード
//#pragma GCC optimize("O3,unroll-loops") //#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") //#pragma GCC optimize("trapv") #include <bits/stdc++.h> //#define int long long using namespace std; const int N = 2e5+5; vector<int> start[N]; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; for(int i=1; i<=m; i++) { for(int j=i; j<=n; j+=i) start[j].push_back(i); } long long now = 0, ans = 0; for(int i=1; i<=n; i++) { for(int j: start[i]) now -= j-1; now += m - start[i].size(); ans = max(ans, now); //cout << i << ": " << start[i].size() << " " << now << "\n"; } cout << ans << "\n"; }