結果
問題 |
No.8084 ゲームブックにトライ!
|
ユーザー |
|
提出日時 | 2021-03-29 00:26:31 |
言語 | C (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,272 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 31,232 KB |
実行使用メモリ | 13,644 KB |
最終ジャッジ日時 | 2024-11-29 09:37:04 |
合計ジャッジ時間 | 29,979 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 TLE * 19 |
ソースコード
#include <stdio.h> #include <stdint.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> typedef uint64_t ull; typedef int64_t ll; #ifdef __cplusplus #include <vector> using std::vector; using std::pair; #include <set> using std::set; #include <map> using std::map; typedef pair<ll, ll> P; #endif static const ll MOD = 1000000007LL; static const ll FOD = 998244353LL; ll n, k, m, q; ll h, w, r; char s[2019100]; ll a[201910], b[201910], c[201910]; ll qx[201910], qy[201910]; ll smin (ll a, ll b) { return (a < b) ? a : b; } ll smax (ll a, ll b) { return (a > b) ? a : b; } typedef struct { ll a; ll b; } hwll; int cmp (const void *left, const void *right) { ll l = *(ll*)left, r = *(ll*)right; if (l < r) return -1; if (l > r) return +1; return 0; } ll frac[5050505], invf[5050505]; ll bpow (ll x, ll y) { if (y == 0) return 1; return bpow(x * x % MOD, y / 2) * ((y % 2) ? x : 1) % MOD; } ll binv (ll x) { return bpow(x, MOD - 2); } ull solve () { ll i, j, ki; ull res = 0; for (i = 0; i < n; i++) { for (j = i + 1; j < n; j++) { res += ((a[i] + a[j]) % FOD); } } return res; } int main(void){ scanf("%lld", &n); for (int i = 0; i < n; i++) { scanf("%lld", &a[i]); } printf("%llu\n", solve()); return 0; }