比赛链接:https://codeforces.com/contest/1351

A - A+B (Trial Problem)

#include <bits/stdc++.h>
using namespace std; void solve() {
int a, b; cin >> a >> b;
cout << a + b << "\n";
} int main() {
int t; cin >> t;
while (t--) solve();
}

B - Square?

#include <bits/stdc++.h>
using namespace std; void solve() {
int a1, b1, a2, b2; cin >> a1 >> b1 >> a2 >> b2;
if (a1 > b1) swap(a1, b1);
if (a2 > b2) swap(a2, b2);
if (a1 + a2 == b1 and b1 == b2) cout << "YES" << "\n";
else cout << "NO" << "\n";
} int main() {
int t; cin >> t;
while (t--) solve();
}

C - Skier

#include <bits/stdc++.h>
using namespace std; void solve() {
string s; cin >> s;
map<pair<pair<int, int>, pair<int, int>>, bool> mp;
pair<int, int> pr{0, 0};
int ans = 0;
for (char c : s) {
pair<int, int> pr0 = pr;
if (c == 'N') pr.second++;
else if (c == 'S') pr.second--;
else if (c == 'W') pr.first--;
else pr.first++;
pair<pair<int, int>, pair<int, int>> p1 = make_pair(pr0, pr);
pair<pair<int, int>, pair<int, int>> p2 = make_pair(pr, pr0);
if (mp[p1] or mp[p2]) ++ans;
else mp[p1] = mp[p2] = true, ans += 5;
}
cout << ans << "\n";
} int main() {
int t; cin >> t;
while (t--) solve();
}

我这也算是在线 ak 过一场 cf 了吧 =。=

Testing Round #16 (Unrated)的更多相关文章

  1. Codeforces Testing Round #16 C.Skier

    题意: 一个人在雪地上滑雪,每次可以向上下左右四个方向移动一个单位,如果这条路径没有被访问过,则需要5秒的时间,如果被访问过,则需要1秒(注意:判断的是两点之间的距离,不是单纯的点).给你他的行动轨迹 ...

  2. [Educational Codeforces Round 16]E. Generate a String

    [Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...

  3. [Educational Codeforces Round 16]D. Two Arithmetic Progressions

    [Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...

  4. [Educational Codeforces Round 16]C. Magic Odd Square

    [Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...

  5. [Educational Codeforces Round 16]B. Optimal Point on a Line

    [Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...

  6. [Educational Codeforces Round 16]A. King Moves

    [Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...

  7. BestCoder Round #16

    BestCoder Round #16 题目链接 这场挫掉了,3挂2,都是非常sb的错误 23333 QAQ A:每一个数字.左边个数乘上右边个数,就是能够组成的区间个数,然后乘的过程注意取模不然会爆 ...

  8. Codeforces Beta Round #16 (Div. 2 Only)

    Codeforces Beta Round #16 (Div. 2 Only) http://codeforces.com/contest/16 A 水题 #include<bits/stdc+ ...

  9. Codeforces Beta Round #16 E. Fish (状压dp)(概率dp)

    Codeforces Beta Round #16 (Div. 2 Only) E. Fish 题目链接:## 点击打开链接 题意: 有 \(n\) 条鱼,每两条鱼相遇都会有其中一只吃掉对方,现在给你 ...

随机推荐

  1. Python解释器和IPython

    目录 简介 Python解释器 IPython 魔法函数 运行和编辑 Debug History 运行系统命令 简介 今天给大家介绍一下Python的一个功能非常强大的解释器IPython.虽然Pyt ...

  2. 利用GPU实现大规模动画角色的渲染(转)

    原文: https://www.cnblogs.com/murongxiaopifu/p/7250772.html 利用GPU实现大规模动画角色的渲染 0x00 前言 我想很多开发游戏的小伙伴都希望自 ...

  3. 基础Markdown语法

    Markdown语法 1.标题 //标题语法 # 一级标题 ## 二级标题 ### 三级标题 #### 四级标题 ##### 五级标题 ###### 六级标题 一级标题 二级标题 三级标题 四级标题 ...

  4. 电子邮箱、邮件地址、网站地址正则表达式!几个有用的RE、regex、regexp!

    几个常用的正则表达式! r"\w[-\w\.]*@\w[-\w]*(\.\w[-\w]*)+" 这个是电子邮件地址的. r"<TAG\b[^>]*<(. ...

  5. 01-CentOS 8.1安装 Docker

    官方参考地址:https://docs.docker.com/install/linux/docker-ce/centos/ 里面包含包下载地址:https://download.docker.com ...

  6. Oracle 常用命令大全(持续更新)

    数据库 ----数据库启动 & 关闭 启动数据库 SQL> startup nomount; SQL> alter database mount; SQL> alter da ...

  7. C++中输出变量类型的方法

    C++中输出变量类型的方法 在c++中输出变量或者数据类型,使用typeid().name()的方法.如下例子: #include <iostream> #include <stri ...

  8. webmvc 拦截器 允许跨域 跨域问题 sessionid不一样

    package cn.com.yitong.ares.filter; import java.io.IOException; import javax.servlet.Filter;import ja ...

  9. 结合python版本安装python-devel gcc和g++的区别 安装前做yum搜索

    [test@ecs autocloudservices]# yum install python-develLoaded plugins: fastestmirrorLoading mirror sp ...

  10. 从输入URL到页面展示,这中间都发生了什么?

    前言 在浏览器里,从用户输入URL到页面展示,这中间都发生了什么?这是一道非常经典的面试题.这里边涉及很多知识点,比如:网络协议.页面渲染.操作系统等.所以这是很好很全面的考察一个前端的知识.下面我将 ...