QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#37012 | #1958. Grid Triangle | afhi | WA | 2ms | 3668kb | C++ | 1.7kb | 2022-06-29 23:38:59 | 2022-06-29 23:38:59 |
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;
if (a[1] == a[2]) {
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: 3636kb
input:
1 1 4
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3668kb
input:
1 1 5
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3500kb
input:
1 2 6
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3616kb
input:
1 2 7
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3584kb
input:
2 2 8
output:
0
result:
ok single line: '0'
Test #6:
score: -100
Wrong Answer
time: 2ms
memory: 3656kb
input:
2 3 9
output:
0
result:
wrong answer 1st lines differ - expected: '16', found: '0'