Codeforces 183A(坐标系性质)
自从开始写上古场以后我就不断地写A、B题的题解了???
cf problem183A
无论每轮有哪几种选择,最后的可能结果放在一起一定是个钻石型,最后答案就是长方形长乘宽。
非常神奇的性质,如果走了either左or上(或者either右or下),会在45度方向拓展1个单位的宽度;反之右上或左下就会在135度方向拓展一个高度。
#include <cstdio>
#include <cstring>
#include <iostream>
using std::cin;
using std::cout;
using std::string;
int main() {
int n;
long long a = 1, b = 1;
string s;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s;
if (s == "UL" || s == "DR")
a++;
else if (s == "UR" || s == "DL")
b++;
else a++, b++;
}
cout << a * b << '\n';
return 0;
}
Codeforces 183A(坐标系性质)的更多相关文章
- CodeForces 1063B. Labyrinth 性质
给定$n *m$的格子 询问从$(r, c)$开始最多向左走$x$步,向右走$y$步 询问有多少个格子可以从$(r, c)$到达 有障碍物,$n, m \leqslant 2 * 10^3$ 对于一个 ...
- Codeforces 1142A(性质、暴举)
队友和大佬都什么几种情况啥的……我是把终点都插了,起点随便选一个,暴举答案莽A. ; ll n, k, a, b, aa, minn = INF, maxx = -; set<ll> bb ...
- Codeforces Gym 100531J Joy of Flight 变换坐标系
Joy of Flight 题目连接: http://codeforces.com/gym/100531/attachments Description Jacob likes to play wit ...
- Codeforces Round #541 (Div. 2) E 字符串 + 思维 + 猜性质
https://codeforces.com/contest/1131/problem/D 题意 给你n个字符串,字符串长度总和加起来不会超过1e5,定义字符串相乘为\(s*s1=s1+s[0]+s1 ...
- Codeforces Round #534 (Div. 2) D. Game with modulo(取余性质+二分)
D. Game with modulo 题目链接:https://codeforces.com/contest/1104/problem/D 题意: 这题是一个交互题,首先一开始会有一个数a,你最终的 ...
- codeforces 447E or 446C 线段树 + fib性质或二次剩余性质
CF446C题意: 给你一个数列\(a_i\),有两种操作:区间求和:\(\sum_{i=l}^{r}(a[i]+=fib[i-l+1])\).\(fib\)是斐波那契数列. 思路 (一) codef ...
- Codeforces Round #524 (Div. 2)C 二维坐标系求俩矩形面积交
题:https://codeforces.com/contest/1080/problem/C 题意:给n*m的二维坐标系,每个位置(xi,yi)都表示一个方格,(1,1)的位置是白色,整个坐标系黑白 ...
- Codeforces 526G - Spiders Evil Plan(长链剖分+直径+找性质)
Codeforces 题目传送门 & 洛谷题目传送门 %%%%% 这题也太神了吧 storz 57072 %%%%% 首先容易注意到我们选择的这 \(y\) 条路径的端点一定是叶子节点,否则我 ...
- Codeforces 1442D - Sum(找性质+分治+背包)
Codeforces 题面传送门 & 洛谷题面传送门 智商掉线/ll 本来以为是个奇怪的反悔贪心,然后便一直往反悔贪心的方向想就没想出来,看了题解才发现是个 nb 结论题. Conclusio ...
随机推荐
- ES搜索排序,文档相关度评分介绍——TF-IDF—term frequency, inverse document frequency, and field-length norm—are calculated and stored at index time.
Theory Behind Relevance Scoring Lucene (and thus Elasticsearch) uses the Boolean model to find match ...
- EmbarassedBird网站需求规格说明书
网站概述 一个特别的在线问答游戏 用户环境 小屏手机, 中等屏幕平板电脑, 大屏显示器 使用chrome浏览器将有全部功能, 其他浏览器完备的基本功能 编程语言&开发环境 HTML/CSS/J ...
- linux网络编程 ntohs, ntohl, htons,htonl inet_aton等详解
ntohs =net to host short int 16位 htons=host to net short int 16位 ntohs =net to host long int 32位 hto ...
- Android Studio的技巧
1.快速添加add unimplements methods: 右键generate 2.快速添加try-catch:左边就有一个小电灯,然后可以选. 3.格式化OPTION + CMD + L ( ...
- POJ3107Godfather(求树的重心裸题)
Last years Chicago was full of gangster fights and strange murders. The chief of the police got real ...
- 取分组TOPN好理解案例
- <十五>UML核心视图动态视图之活动图
一:动态视图 --->动态视图是描述事物动态行为的. --->需要注意的是:动态视图不能够独立存在,它必需特指一个静态视图活uml元素,说明在静态视图规定的事物结构下它们的动态行为. -- ...
- JAVA基础知识 String s = new String("ABC") VS String s = "abc"
一: String s = new String("ABC") VS String s = "abc" String s = "abc&q ...
- 七 vue学习 async/await
1: javaScript async/await: 调用async函数的时候,是异步的,函数后面的代码继续执行.! async / await是ES7的重要特性之一,也是目前社区里公认的优秀异步解 ...
- JavaScript与DOM常见面试题
1. JavaScript 1.1.简要描述 JavaScript的数据类型? 参考答案: Java Sc ri pt 的数据类型可以分为原始类型和对象类型.原始类型包括 string. number ...