QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#420157 | #1958. Grid Triangle | ZayinCTT# | WA | 0ms | 1640kb | C++11 | 1.5kb | 2024-05-24 14:59:48 | 2024-05-24 14:59:51 |
Judging History
answer
// 那就是希望。
// 即便需要取模,也是光明。
#include <algorithm>
#include <stdio.h>
#include <vector>
typedef long long llt;
typedef unsigned uint;typedef unsigned long long ullt;
typedef bool bol;typedef char chr;typedef void voi;
typedef double dbl;
template<typename T>bol _max(T&a,T b){return(a<b)?a=b,true:false;}
template<typename T>bol _min(T&a,T b){return(b<a)?a=b,true:false;}
template<typename T>T lowbit(T n){return n&-n;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T>T lcm(T a,T b){return(a!=0||b!=0)?a/gcd(a,b)*b:(T)0;}
template<typename T>T exgcd(T a,T b,T&x,T&y){if(b!=0){T ans=exgcd(b,a%b,y,x);y-=a/b*x;return ans;}else return y=0,x=1,a;}
template<typename T>T power(T base,T index,T mod)
{
T ans=1%mod;
while(index)
{
if(index&1)ans=ans*base%mod;
base=base*base%mod,index>>=1;
}
return ans;
}
// Your shadow Gets in the way of my light
ullt solve(ullt a,ullt b,ullt c)
{
ullt ans=0;
ullt r=std::min(a,c);
if(r<=b)
ans+=r*(r-1)/2;
else
ans+=b*(b-1)/2+b*(r-b);
// printf("%llu %llu %llu\n",r,b,ans);
ans-=std::min(b,r/2);
return ans;
}
int main()
{
#ifdef MYEE
freopen("QAQ.in","r",stdin);
freopen("QAQ.out","w",stdout);
#endif
uint a,b,c;scanf("%u%u%u",&a,&b,&c);
printf("%llu\n",8*(solve(a,b,c)+solve(b,c,a)+solve(c,a,b)));
return 0;
}
// 那就是希望。
// 即便需要取模,也是光明。
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 1584kb
input:
1 1 4
output:
0
result:
ok single line: '0'
Test #2:
score: 0
Accepted
time: 0ms
memory: 1636kb
input:
1 1 5
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 0ms
memory: 1640kb
input:
1 2 6
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 1536kb
input:
1 2 7
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
2 2 8
output:
0
result:
ok single line: '0'
Test #6:
score: 0
Accepted
time: 0ms
memory: 1608kb
input:
2 3 9
output:
16
result:
ok single line: '16'
Test #7:
score: 0
Accepted
time: 0ms
memory: 1616kb
input:
2 3 10
output:
16
result:
ok single line: '16'
Test #8:
score: 0
Accepted
time: 0ms
memory: 1592kb
input:
2 3 11
output:
16
result:
ok single line: '16'
Test #9:
score: 0
Accepted
time: 0ms
memory: 1640kb
input:
3 4 12
output:
64
result:
ok single line: '64'
Test #10:
score: 0
Accepted
time: 0ms
memory: 1632kb
input:
3 4 13
output:
64
result:
ok single line: '64'
Test #11:
score: 0
Accepted
time: 0ms
memory: 1636kb
input:
3 4 14
output:
64
result:
ok single line: '64'
Test #12:
score: -100
Wrong Answer
time: 0ms
memory: 1532kb
input:
3 5 15
output:
88
result:
wrong answer 1st lines differ - expected: '80', found: '88'