Submission #8023083


Source Code Expand

Copy
#include <bits/stdc++.h>

int main()
{
	int N;
	scanf("%d", &N);
	std::vector<int> d(N);
	for (auto& e: d) scanf("%d", &e);
	int sum{};
	for (int i{}; i < N; i++)
		for (int j{i + 1}; j < N; j++)
			sum += d[i] * d[j];
	printf("%d\n", sum);

	return 0;
}

Submission Info

Submission Time
Task B - TAKOYAKI FESTIVAL 2019
User TanakaTaroh
Language C++14 (GCC 5.4.1)
Score 200
Code Size 269 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:6:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
                 ^
./Main.cpp:8:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for (auto& e: d) scanf("%d", &e);
                                  ^

Judge Result

Set Name All Sample
Score / Max Score 200 / 200 0 / 0
Status
AC × 12
AC × 2
Set Name Test Cases
All sample_01, sample_02, testcase_0, testcase_1, testcase_2, testcase_3, testcase_4, testcase_5, testcase_6, testcase_7, testcase_8, testcase_9
Sample sample_01, sample_02
Case Name Status Exec Time Memory
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
testcase_0 AC 1 ms 256 KB
testcase_1 AC 1 ms 256 KB
testcase_2 AC 1 ms 256 KB
testcase_3 AC 1 ms 256 KB
testcase_4 AC 1 ms 256 KB
testcase_5 AC 1 ms 256 KB
testcase_6 AC 1 ms 256 KB
testcase_7 AC 1 ms 256 KB
testcase_8 AC 1 ms 256 KB
testcase_9 AC 1 ms 256 KB