Submission #481003


Source Code Expand

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
	int a, b, c, d, e, count=0;
	vector<int> answer(6);
	for(;;)
	{
		cin >> a >> b >> c >> d >> e ;
		if(1<=a&&b<c&&c<d&&d<e&&e<=100)
		{
			break;
		}
	}
	vector<int> quest{a,b,c,d};
	for(int i=3;i>=0;i--)
	for(int j=0;j<i;j++)
	{
		answer[count++]=quest[i]+quest[j];
	}
	sort(answer.begin(), answer.end());
	cout << answer[3]+e << endl;
	return 0;
}

Submission Info

Submission Time
Task C - 数を3つ選ぶマン
User sdsaoo
Language C++11 (Clang++ 3.4)
Score 100
Code Size 466 Byte
Status AC
Exec Time 28 ms
Memory 928 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 15
Set Name Test Cases
Sample example_0.txt, example_1.txt
All example_0.txt, example_1.txt, handmade_0.txt, handmade_1.txt, handmade_2.txt, handmade_3.txt, handmade_4.txt, handmade_5.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, example_0.txt, example_1.txt
Case Name Status Exec Time Memory
example_0.txt AC 27 ms 804 KiB
example_1.txt AC 25 ms 920 KiB
handmade_0.txt AC 27 ms 928 KiB
handmade_1.txt AC 25 ms 928 KiB
handmade_2.txt AC 28 ms 796 KiB
handmade_3.txt AC 27 ms 800 KiB
handmade_4.txt AC 24 ms 804 KiB
handmade_5.txt AC 26 ms 732 KiB
random_0.txt AC 26 ms 916 KiB
random_1.txt AC 25 ms 924 KiB
random_2.txt AC 26 ms 916 KiB
random_3.txt AC 24 ms 920 KiB
random_4.txt AC 25 ms 912 KiB