QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#37012#1958. Grid TriangleafhiWA 2ms3668kbC++1.7kb2022-06-29 23:38:592022-06-29 23:38:59

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-06-29 23:38:59]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3668kb
  • [2022-06-29 23:38:59]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'