AIM Tech Round 5 (rated, Div. 1 + Div. 2)
A. Find Square
找到对角线的两个点的坐标,这道题就迎刃而解了。
inline void work(int n) {
int m;
cin >> m;
memset(str, 0, sizeof(str));
rep(i,1,n) {
scanf("%s", str+1);
rep(j,1,m) a[i][j] = (str[j] == 'B' ? 1 : 0);
}
int lx = 0, ly = 0, rx = 0, ry = 0;
for (int i = n; i >= 1; -- i) {
rep(j,1,m)
if (a[i][j] == 1) {lx = i; ly = j;break;}
if (lx != 0) break;
}
rep(i,1,n) {
for (int j = m; j >= 1; -- j)
if (a[i][j] == 1) {rx = i; ry = j;break;}
if (rx != 0) break;
}
cout << (lx + rx) / 2 << " " << (ly + ry) / 2 << endl;
}
B. Unnatural Conditions
考虑到位数远远大于\(n,m\)的值,直接选择构造出\(s(a)\ >\ max(n),\ s(b)\ >\ max(m),\ s(a\ +\ b)\ = \ 1\)
inline void work(int n, int m) {
rep(i,1,2230) cout << 5;
cout << endl;
rep(i,1,2229) cout << 4;
cout << 5 << endl;
}
AIM Tech Round 5 (rated, Div. 1 + Div. 2)的更多相关文章
- AIM Tech Round 5 (rated, Div. 1 + Div. 2) (A, B, E)
B.Unnatural Conditions 题目链接 : http://codeforces.com/contest/1028/problem/B #include<iostream> ...
- AIM Tech Round 5 (rated, Div. 1 + Div. 2) C. Rectangles 【矩阵交集】
题目传传传送门:http://codeforces.com/contest/1028/problem/C C. Rectangles time limit per test 2 seconds mem ...
- AIM Tech Round 5 (rated, Div. 1 + Div. 2) E(思维,构造)
#include<bits/stdc++.h>using namespace std;long long a[150007];long long ans[150007];int main( ...
- AIM Tech Round 5 (rated, Div. 1 + Div. 2) D(SET,思维)
#include<bits/stdc++.h>using namespace std;const long long mod = 1e9+7;char s[370007][27];long ...
- 【AIM Tech Round 5 (rated, Div. 1 + Div. 2) 总结】【题解往前或往后翻,不在这】
又是爆炸的一场 心态有点小崩.但问题不大.. 看A题,一直担心有多个正方形..小心翼翼地看完之后,毅然地交上去了. [00:08] A[Accpted] 然后开始看B题. 觉得和之前做的某题很像,但翻 ...
- 【AIM Tech Round 5 (rated, Div. 1 + Div. 2) A】 Find Square
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 找到左上角.往下一直走,往右一直走走到B边界就好. 中点的话.直接输出中位数 [代码] #include <bits/stdc ...
- 【AIM Tech Round 5 (rated, Div. 1 + Div. 2) B】Unnatural Conditions
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 让a+b的和为100000000...0这样的形式就好了 这样s(a+b)=1<=m就肯定成立了(m>=1) 然后至于s ...
- 【 AIM Tech Round 5 (rated, Div. 1 + Div. 2) C】Rectangles
[链接] 我是链接,点我呀:) [题意] 给你n个矩形. 让你找出一个点(x,y) 使得这个点在其中至少(n-1)个矩形中. [题解] 若干个矩形交在一起的话. 它们所有的公共区域也会是一个矩形. 这 ...
- Codeforces AIM Tech Round 5 (rated, Div. 1 + Div. 2)
A. Find Square time limit per test: 1 second memory limit per test: 256 megabytes input: standard in ...
随机推荐
- linux awk时间计算脚本
在linux如果计划时间是个麻烦事, 用awk脚本如下 BEGIN {FS=":";OFS=":"} {total_seconds=total_seconds+ ...
- 一个Activity中使用两个layout实例
package com.sbs.aas2l; import android.app.Activity; import android.os.Bundle; import android.view.Vi ...
- 关于Visual Studio 20**自动添加头部注释信息
作为一个万年潜水党,不管这一篇文章技术含量如何,也算是一个好的开始吧. 在日常的开发中我们经常需要为类库添加注释和版权等信息,这样我们就需要每次去拷贝粘贴同样的文字,为了减少这种重复性的工作,我们 ...
- CSS Spritec下载,精灵图,雪碧图,初探之原理、使用
CSS Spritec下载,精灵图,雪碧图,初探之原理.使用 关于CSS Sprite CSSSprites在国内很多人叫css精灵雪碧图,是一种网页图片应用处理方式.它允许你将一个页面涉及到的所有零 ...
- .m2\repository\org\springframework\spring-beans\4.1.4.RELEASE\spring-beans-4.1.4.RELEASE.jar!\org\springframework\beans\factory\xml\spring-beans-4.1.xsd
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xsd:s ...
- Rancher OS
Rancher OS 是生产规模中运行 Docker 最小,最简单的方式.RancherOS 的所有东西都作为 Docker 管理的容器.这些系统服务包括 udev 和 rsyslog.Rancher ...
- Python开发【模块】:Urllib(一)
Urllib模块 1.模块说明: Urllib库是Python中的一个功能强大.用于操作的URL,并在做爬虫的时候经常要用到的库.在Python2.X中,分Urllib库和Urllib库,Python ...
- python中读取配置文件的方式
方式1:argparse argparse,是Python标准库中推荐使用的编写命令行程序的工具.也可以用于读取配置文件. 字典样式的配置文件*.conf 配置文件test1.conf { " ...
- PHP接收json格式的POST数据
/** * 获取 post 参数; 在 content_type 为 application/json 时,自动解析 json * @return array */ private function ...
- hbase Java API 介绍及使用示例
几个相关类与HBase数据模型之间的对应关系 java类 HBase数据模型 HBaseAdmin 数据库(DataBase) HBaseConfiguration HTable 表(Table) ...