QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#498454 | #9134. Building a Fence | Alliy666 | WA | 1ms | 3968kb | C++23 | 878b | 2024-07-30 15:04:56 | 2024-07-30 15:04:57 |
Judging History
answer
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t;
long long w,h,s;
scanf("%d",&t);
while(t--)
{
scanf("%lld %lld %lld",&w,&h,&s);
if(w>h)
swap(w,h);
if(s<=w)
printf("%d\n",(int)ceil(2.0*(w+h)/s));
else if(s>h)
{
if(w==h)
puts("2");
else if(2*w==s||2*h==s||2*w+h==2*s||2*h+w==2*s||2*(w+h)==3*s)
puts("3");
else
puts("4");
}
else
{
if(2*w+h>=2*s)
printf("%d\n",(int)ceil(2.0*(w+h)/s));
else
puts("3");
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3968kb
input:
7 7 9 4 1 1 2 1 1 4 4 6 2 3 3 5 10 6 4 1 11 5
output:
8 2 2 10 2 8 5
result:
wrong answer 3rd numbers differ - expected: '4', found: '2'