結果
問題 | No.2235 Line Up Colored Balls |
ユーザー |
![]() |
提出日時 | 2023-03-11 08:05:18 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 801 ms |
コンパイル使用メモリ | 82,128 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-18 06:12:46 |
合計ジャッジ時間 | 3,095 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 55 |
ソースコード
#include <iostream>using namespace std;#include <atcoder/modint>int main() {cin.tie(nullptr), ios::sync_with_stdio(false);long long ret = 0, len = 0, N, x;cin >> N;while (N--) cin >> x, len += x, ret += x * (x - 1);cout << (len - atcoder::modint1000000007(ret) / len).val() << '\n';}