結果
| 問題 | No.2046 Ans Mod? Mod Ans! |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2021-07-19 14:54:41 |
| 言語 | C++17(clang) (clang++ 23.1.3 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 451 bytes |
| 記録 | |
| コンパイル時間 | 3,053 ms |
| コンパイル使用メモリ | 168,092 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-10-04 11:37:37 |
| 合計ジャッジ時間 | 20,537 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 TLE * 2 -- * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n, 0);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort(a.begin(), a.end());
ll ans = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
ans += a[i] - a[j] % a[i];
}
}
cout << ans << endl;
}