【数学规律】Vijos P1582 笨笨的L阵游戏
2024-05-25 13:51:37
题目链接:
题目大意:
就是o(o<=50)个人在n*m(n,m<=2000)的格子上放L型的东西(有点像俄罗斯方块的L,可对称旋转),问第几个人覆盖全图或无解。
题目思路:
【数学】
n*m%8如果为0则(n*m/4-1)%o+1那个人胜利。
否则无解。
(当时手画了大概8以内的几种样例,就感觉好像有规律可循,慢慢推但是感觉可能有错,于是偷偷瞄了一眼别人的题解,果然是规律题。但是我并不会证明。)
//
//by coolxxx
//
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<memory.h>
#include<time.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<math.h>
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(a) ((a)>0?(a):(-(a)))
#define lowbit(a) (a&(-a))
#define sqr(a) (a)*(a)
#define swap(a,b) (a)^=(b),(b)^=(a),(a)^=(b)
#define eps 1e-8
#define MAX 0x7f7f7f7f
#define INF 20000
#define PI 3.1415926535897
#define N 54
using namespace std;
int n,m,lll,ans,cas;
char c[N][N];
int main()
{
#ifndef ONLINE_JUDGE
// freopen("1.txt","r",stdin);
// freopen("2.txt","w",stdout);
#endif
int i,j;
while(~scanf("%d",&cas) && cas)
{
scanf("%d%d",&n,&m);
for(i=;i<=cas;i++)
scanf("%s",c[i]);
if(n< || m< || n*m%!=)puts("Nobody can win!");
else printf("%s can win!\n",c[(m*n/+cas-)%cas+]);
}
return ;
} /*
// //
*/
最新文章
- 快速排名 让人疯狂的黑帽seo技术
- sphinx索引文件进一步说明——最好是结合lucene一起看,直觉告诉我二者本质无异
- JavaScript: Advanced
- wdcp升级php版本到5.3,5.5
- jquery源码学习--iceDog
- 加载驱动模块时Device or resource busy的解决方法
- 修改npm包管理器的registry为淘宝镜像(npm.taobao.org)
- /etc/shadow字段详解
- delphi字符串函数大全
- iOS_init相关信息
- 前端三剑客:html,css,JavaScript
- 001-JUnit之断言assert
- MT【307】周期数列
- AutoCAD开发1---获取块属性
- apache2 配置虚拟主机
- 3-安装hive
- 【CSS】定义元素的位置
- Scrum卡片层次图
- c#图像灰度化、灰度反转、二值化
- iOS利用block实现链式编程方法(Objective-C链式编程)
热门文章
- asp.net 的状态管理
- ASP.NET 动态属性筛选和分页绑定
- 常用的 css 命名规则
- jQuery实现页面滚动时顶部动态显示隐藏
- .NET中的三种Timer的区别和用法(转)
- MySQL 5.6 my.cnf 参数详细说明
- An App ID with Identifier &#39;xxxxxx’ is not available. Please ....
- 【POJ1151】【扫描线+线段树】Atlantis
- extern ";C"; {} 来沟通C和C++
- C#中foreach遍历学习笔记