AtCoder Beginner Contest 250 A~E

AtCoder Beginner Contest 250 A~EA - Adjacent Squares题意:给出一个行列为H,W的矩阵,再给一个坐标,问周围有多少个正方形。// Problem: C - Adjacent Swaps// Contest: AtCoder - AtCoder Beginner Contest 250// URL: https://atcoder.jp/contests/abc250/tasks/abc250_c// Memory Limit: 1024 MB/
摘要由CSDN通过智能技术生成

AtCoder Beginner Contest 250 A~E

A - Adjacent Squares

题意:给出一个行列为H,W的矩阵,再给一个坐标,问周围有多少个正方形。

// Problem: C - Adjacent Swaps
// Contest: AtCoder - AtCoder Beginner Contest 250
// URL: https://atcoder.jp/contests/abc250/tasks/abc250_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms

#include<bits/stdc++.h>
using namespace std;
#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef vector<int> VI;
const int mod=1000000007;
ll powmod(ll a,ll b) {
   ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){
   if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) {
    return b?gcd(b,a%b):a;}
int main(){
   
	int n,m;
	int a,b;
	cin>>n>>m>>a>>b;
	int ans = 0;
	if(a > 1)	ans ++;
	if(b > 1)	ans ++;
	if(a < n)	ans ++;
	if(b < m)	ans ++;
	cout<<ans;
	return 0;
}

B - Enlarged Checker Board

题意:给出n*n的正方形矩阵,对地板染色,有黑白两种色 ,要求相邻两个的地板颜色不同,(1,1)为白色,给出每块地板的大小。

// Problem: B - Enlarged Checker Board
// Contest: AtCoder - AtCoder Beginner Contest 250
// URL: https://atcoder.jp/contests/abc250/tasks/abc250_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms

#include<bits/stdc++.h>
using namespace std;
#define ios ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef vector<int> VI;
const int mod=1000000007 , N = 110;
ll powmod(ll a,ll b) {
   ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){
   if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值