Submission #53336544
Source Code Expand
#include <iostream>
#include <vector>
// 定数 MOD を定義
const long long MOD = 1e8;
int main() {
int N;
std::cin >> N; // 配列の長さを入力
std::vector<long long> A(N);
for (int i = 0; i < N; i++) {
std::cin >> A[i]; // 各要素を入力
}
long long sum = 0; // 合計を保存する変数を初期化
// 各ペアに対して関数 f(x, y) を計算
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j < N; j++) {
sum += (long long)(A[i] + A[j]) % MOD; // (x + y) mod 10^8 を計算
// sum %= MOD; // 合計を MOD で割った余りを取る
}
}
std::cout << sum << std::endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Sigma Problem |
| User | arashin |
| Language | C++ 20 (gcc 12.2) |
| Score | 0 |
| Code Size | 736 Byte |
| Status | TLE |
| Exec Time | 2211 ms |
| Memory | 5704 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3516 KiB |
| 00_sample_02.txt | AC | 1 ms | 3528 KiB |
| 01_test_01.txt | TLE | 2207 ms | 5612 KiB |
| 01_test_02.txt | TLE | 2207 ms | 5640 KiB |
| 01_test_03.txt | TLE | 2207 ms | 5696 KiB |
| 01_test_04.txt | TLE | 2207 ms | 5536 KiB |
| 01_test_05.txt | TLE | 2207 ms | 5616 KiB |
| 01_test_06.txt | TLE | 2207 ms | 5608 KiB |
| 01_test_07.txt | TLE | 2207 ms | 5612 KiB |
| 01_test_08.txt | TLE | 2207 ms | 5532 KiB |
| 01_test_09.txt | TLE | 2207 ms | 5532 KiB |
| 01_test_10.txt | TLE | 2207 ms | 5568 KiB |
| 01_test_11.txt | TLE | 2207 ms | 5616 KiB |
| 01_test_12.txt | TLE | 2207 ms | 5704 KiB |
| 01_test_13.txt | TLE | 2207 ms | 5568 KiB |
| 01_test_14.txt | AC | 709 ms | 3516 KiB |
| 01_test_15.txt | TLE | 2210 ms | 5592 KiB |
| 01_test_16.txt | TLE | 2207 ms | 4736 KiB |
| 01_test_17.txt | AC | 1 ms | 3480 KiB |
| 01_test_18.txt | AC | 1 ms | 3440 KiB |
| 01_test_19.txt | TLE | 2207 ms | 5612 KiB |
| 01_test_20.txt | TLE | 2211 ms | 5652 KiB |