結果

問題 No.3084 ゲームブックにトライ!
ユーザー hirakich1000000007hirakich1000000007
提出日時 2021-03-29 00:26:31
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 1,272 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 30,068 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-19 15:59:10
合計ジャッジ時間 2,943 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,084 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0