Task: | Crne |
Sender: | henrikaalto |
Submission time: | 2019-07-29 16:25:02 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | ACCEPTED | 0.01 s | details |
Code
#include<bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() using ii=long long; int main() { int n; cin >> n; // 2, 4, 6, 9, 12, 16, 21, //2*1 2*2 3*3 4*3 4*4 5*4 5*5 int r = 0; for (int x = 0; x <= 100; ++x){ for (int y = 0; y <= 100; ++y) { if (y + x - 2 == n) { r = max(r, y * x); } } } cout << r << "\n"; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
4 |
user output |
---|
4 |
Test 2
Verdict: ACCEPTED
input |
---|
5 |
correct output |
---|
12 |
user output |
---|
12 |
Test 3
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
36 |
user output |
---|
36 |
Test 4
Verdict: ACCEPTED
input |
---|
59 |
correct output |
---|
930 |
user output |
---|
930 |
Test 5
Verdict: ACCEPTED
input |
---|
100 |
correct output |
---|
2601 |
user output |
---|
2601 |