結果
問題 |
No.2046 Ans Mod? Mod Ans!
|
ユーザー |
|
提出日時 | 2021-07-18 22:06:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 433 bytes |
コンパイル時間 | 2,122 ms |
コンパイル使用メモリ | 194,160 KB |
最終ジャッジ日時 | 2025-01-23 03:11:45 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 8 |
ソースコード
#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]; } ll ans = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { ans += abs(a[i] % a[j] - a[j] % a[i]); } } cout << ans << endl; }