Submission #9717

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
97172014-09-28 08:20:35dolpang2Uniting (kriii2_U)C++14
0 / 4
0 ms1244 KiB
#include <algorithm>
#include <cstdio>
#include <deque>
#include <vector>
int main() {
int N = 0;
scanf("%d", &N);
std::deque<int> bundle_of_number;
for (int i = 0; i < N; ++i) {
int number = 0;
scanf("%d", &number);
bundle_of_number.push_back(number);
}
std::sort(bundle_of_number.begin(), bundle_of_number.end());
for (;;) {
if (bundle_of_number.size() == 1) {
break;
}
int ret = bundle_of_number.at(0) * bundle_of_number.at(1);
bundle_of_number.push_back(ret);
bundle_of_number.pop_front();
bundle_of_number.pop_front();
std::sort(bundle_of_number.begin(), bundle_of_number.end());
}
printf("%d", bundle_of_number.at(0));
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...