2015-07-20 14:46:19

传送门

总结:NEERC,一贯的欧洲风格。

  暑假的组队训练,赛中6题,目前补到7题。更新一下有意思的题的题解。

 

A题:规律。先选所有奇数行进行操作就能发现规律。

#include <cstdio>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;

#define getmid(l,r) ((l) + ((r) - (l)) / 2)
#define MP(a,b) make_pair(a,b)
#define PB(a) push_back(a)

typedef long long ll;
typedef pair<int,int> pii;
const double eps = 1e-8;
const int INF = (1 << 30) - 1;

int n,m;

int main(){
    freopen("alter.in","r",stdin);
    freopen("alter.out","w",stdout);
    while(scanf("%d%d",&n,&m) != EOF){
        printf("%d\n",n / 2 + m / 2);
        for(int i = 2; i <= n; i += 2){
            printf("%d %d %d %d\n",i,1,i,m);
        }
        for(int i = 2; i <= m; i += 2){
            printf("%d %d %d %d\n",1,i,n,i);
        }
    }
    return 0;
}
View Code

相关文章:

  • 2022-12-23
  • 2021-11-16
  • 2021-08-20
  • 2021-07-19
  • 2021-05-17
  • 2021-08-28
  • 2021-10-11
猜你喜欢
  • 2021-09-16
  • 2021-07-13
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2021-12-04
相关资源
相似解决方案