#include<stdio.h>#include<iostream>using namespace std;main(){ int M,N; while(scanf("%d%d",&M,&N)!=EOF) { if (M==1||N==1) cout<<(M+N)/2<<endl; else cout<<((M*N)%3?1:2)<<endl; } return 0;}
欢迎分享,转载请注明来源:内存溢出
#include<stdio.h>#include<iostream>using namespace std;main(){ int M,N; while(scanf("%d%d",&M,&N)!=EOF) { if (M==1||N==1) cout<<(M+N)/2<<endl; else cout<<((M*N)%3?1:2)<<endl; } return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)