QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#172067#7178. Bishopsucup-team1251#WA 1ms3752kbC++141.9kb2023-09-09 17:59:582023-09-09 18:00:26

Judging History

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

  • [2023-09-09 18:00:26]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3752kb
  • [2023-09-09 17:59:58]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
    int n,m;
    scanf("%lld%lld\n",&n,&m);
    if(n==m)
    {
        printf("%lld\n",n+m-2);
        for(int i=1;i<n;i++)
        {
            printf("%lld %lld\n%lld %lld\n",1,i,n,i+1);
        }
    }
    if(n<m)
    {
        int ans=0;
        int tg=0;
        for(int i=1;i<=n;i++)
        {
            if(ans<m/i*i)
            {
                ans=m/i*i;
                tg=i;
            }
        }
        printf("%lld\n",ans);
        for(int i=1,v=0;i<=n;i=i+tg,v++)
        {
            for(int j=1;j<=tg;j++)
            {
                if(v%2)
                {
                    for(int k=1;k<=tg;k++)
                    {
                        printf("%lld %lld\n",k,i);
                    }
                }
                else
                {
                    for(int k=n;k>=n-tg+1;k--)
                    {
                        printf("%lld %lld\n",k,i);
                    }
                }
            }
        }
    }
    else
    {
        int ans=0;
        int tg=0;
        for(int i=1;i<=m;i++)
        {
            if(ans<n/i*i)
            {
                ans=n/i*i;
                tg=i;
            }
        }
        printf("%lld\n",ans);
        for(int i=1,v=0;i<=m;i=i+tg,v++)
        {
            for(int j=1;j<=tg;j++)
            {
                if(v%2)
                {
                    for(int k=1;k<=tg;k++)
                    {
                        printf("%lld %lld\n",i,k);
                    }
                }
                else
                {
                    for(int k=n;k>=m-tg+1;k--)
                    {
                        printf("%lld %lld\n",i,k);
                    }
                }
            }
        }
    }
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3752kb

input:

2 5

output:

5
2 1
1 2

result:

wrong output format Unexpected end of file - int32 expected