QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#498454#9134. Building a FenceAlliy666WA 1ms3968kbC++23878b2024-07-30 15:04:562024-07-30 15:04:57

Judging History

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

  • [2024-07-30 15:04:57]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3968kb
  • [2024-07-30 15:04:56]
  • 提交

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

详细

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'