Link:

Codeforces #190 传送门

 

A:

明显答案为$n+m-1$且能构造出来

#include <bits/stdc++.h>

using namespace std;
#define X first
#define Y second
typedef long long ll;
typedef double db;
typedef pair<int,int> P;
int n,m;

int main()
{
    scanf("%d%d",&n,&m);
    printf("%d\n",n+m-1);
    for(int i=1;i<=m;i++)
        printf("1 %d\n",i);
    for(int i=2;i<=n;i++)
        printf("%d 1\n",i);
    return 0;
}
Problem A

相关文章:

  • 2021-11-15
  • 2021-09-20
  • 2021-08-20
  • 2022-01-02
  • 2022-01-30
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-31
  • 2021-10-22
  • 2022-01-28
  • 2021-11-19
  • 2022-02-21
  • 2022-01-10
相关资源
相似解决方案