QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#37014 | #1958. Grid Triangle | afhi | WA | 2ms | 3652kb | C++ | 1.7kb | 2022-06-29 23:40:41 | 2022-06-29 23:40:43 |
Judging History
answer
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <string>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <complex>
#include <list>
#include <vector>
#include <array>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <random>
#ifdef AFHI
#include "debug.h"
#define debug(...) cerr << "[" << #__VA_ARGS__ << "] = ["; _print(##__VA_ARGS__)
#else
#define debug(...)
#endif
#define SZ(x) (int) x.size()
using ll = long long;
template<typename T> using V = std::vector<T>;
template<typename X, typename Y> bool ckmin(X& x, const Y& y) { return (y < x) ? (x=y,1):0; }
template<typename X, typename Y> bool ckmax(X& x, const Y& y) { return (x < y) ? (x=y,1):0; }
inline ll f(ll d) {
ll ans = (d - 2) / 2 * ((d - 2) / 2 + 1);
if (d & 1) ans += d / 2;
return ans;
}
struct Solver {
void solve() {
ll a[3];
for (int i = 0;i < 3;i++) {
std::cin>>a[i];
}
std::sort(a, a + 3);
ll d = std::min({a[0],a[1],a[2]});
ll ans = f(d);
debug(ans);
ans *= 48;
ans += (f(a[1]) - f(a[0])) * 16;
std::cout<<ans<<'\n';
}
};
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cin.exceptions(std::cin.failbit);
std::cout<<std::fixed<<std::setprecision(10);
int t = 1;
//std::cin>>t;
while (t--) {
auto solver = std::make_unique<Solver>();
solver->solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3568kb
input:
1 1 4
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3560kb
input:
1 1 5
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3644kb
input:
1 2 6
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1 2 7
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3544kb
input:
2 2 8
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
2 3 9
output:
16
result:
ok single line: '16'
Test #7:
score: 0
Accepted
time: 2ms
memory: 3652kb
input:
2 3 10
output:
16
result:
ok single line: '16'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3572kb
input:
2 3 11
output:
16
result:
ok single line: '16'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
3 4 12
output:
64
result:
ok single line: '64'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3640kb
input:
3 4 13
output:
64
result:
ok single line: '64'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3564kb
input:
3 4 14
output:
64
result:
ok single line: '64'
Test #12:
score: -100
Wrong Answer
time: 1ms
memory: 3540kb
input:
3 5 15
output:
96
result:
wrong answer 1st lines differ - expected: '80', found: '96'