第一次AK,真爽qwq

A

很zz啊,,直接判断三种情况就行

/*

*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<cmath>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
#define Pair pair<int, int>
#define MP(x, y) make_pair(x, y)
#define fi first
#define se second
#define int long long
#define LL long long
#define ull unsigned long long
#define rg register
#define pt(x) printf("%d ", x);
//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1<<22, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 22)], *p1 = buf, *p2 = buf;
//char obuf[1<<24], *O = obuf;
//void print(int x) {if(x > 9) print(x / 10); *O++ = x % 10 + '0';}
//#define OS *O++ = ' ';
using namespace std;
//using namespace __gnu_pbds;
const int MAXN = 1e6 + , INF = 1e9 + , mod = 1e9 + ;
const double eps = 1e-;
inline int read() {
char c = getchar(); int x = , f = ;
while(c < '' || c > '') {if(c == '-') f = -; c = getchar();}
while(c >= '' && c <= '') x = x * + c - '', c = getchar();
return x * f;
}
int check(int a, int b, int c) {
return a * b * c & ;
}
main() {
int A = read(), B = read();
if(check(, A, B) || check(, A, B) || check(, A, B)) puts("Yes");
else puts("No"); return ;
}
/*
2 2 1
1 1
2 1 1
*/

A

B

直接模拟即可

/*

*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<cmath>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
#define Pair pair<int, int>
#define MP(x, y) make_pair(x, y)
#define fi first
#define se second
#define int long long
#define LL long long
#define ull unsigned long long
#define rg register
#define pt(x) printf("%d ", x);
//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1<<22, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 22)], *p1 = buf, *p2 = buf;
//char obuf[1<<24], *O = obuf;
//void print(int x) {if(x > 9) print(x / 10); *O++ = x % 10 + '0';}
//#define OS *O++ = ' ';
using namespace std;
//using namespace __gnu_pbds;
const int MAXN = 1e6 + , INF = 1e9 + , mod = 1e9 + ;
const double eps = 1e-;
inline int read() {
char c = getchar(); int x = , f = ;
while(c < '' || c > '') {if(c == '-') f = -; c = getchar();}
while(c >= '' && c <= '') x = x * + c - '', c = getchar();
return x * f;
}
map<string, bool> mp;
int N;
string s[MAXN];
main() {
int N = read(); for(int i = ; i <= N; i++) {
cin >> s[i];
if(mp.find(s[i]) != mp.end()) {puts("No"); return ;}
if(i > ) {
int l = s[i - ].length();
if(s[i][] != s[i - ][l - ]) {puts("No"); return ;
}
}
mp[s[i]] = ;
}
puts("Yes"); return ;
}
/*
2 2 1
1 1
2 1 1
*/

B

C

一开始想二分来着,然后发现我zz了。

直接输出 所有距离与起始距离的最大公约数即可

证明显然。。。

/*

*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<cmath>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
#define Pair pair<int, int>
#define MP(x, y) make_pair(x, y)
#define fi first
#define se second
#define int long long
#define LL long long
#define ull unsigned long long
#define rg register
#define pt(x) printf("%d ", x);
//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1<<22, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 22)], *p1 = buf, *p2 = buf;
//char obuf[1<<24], *O = obuf;
//void print(int x) {if(x > 9) print(x / 10); *O++ = x % 10 + '0';}
//#define OS *O++ = ' ';
using namespace std;
//using namespace __gnu_pbds;
const int MAXN = 1e6 + , INF = 1e9 + , mod = 1e9 + ;
const double eps = 1e-;
inline int read() {
char c = getchar(); int x = , f = ;
while(c < '' || c > '') {if(c == '-') f = -; c = getchar();}
while(c >= '' && c <= '') x = x * + c - '', c = getchar();
return x * f;
}
int N, a[MAXN];
main() {
int N = read(), X = read();
for(int i = ; i <= N; i++) a[i] = read();
int g = abs(X - a[]);
for(int i = ; i <= N; i++) {
int dis = abs(X - a[i]);
g = __gcd(g, dis);
}
printf("%d", g);
return ;
}
/*
2 2 1
1 1
2 1 1
*/

C

D

一开始读错题了,我以为移动几个都可以,事实上只能移动一个qwq,而且我以为0不统计入答案

我还特地问了一下,真没想到他居然知道我问的什么

考虑一个很显然的正确做法。。

先把所有奇数点往下移动,直到移动到最后一行

再把最后一行的奇数点从左往右移动。。

/*

*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<cmath>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
#define Pair pair<int, int>
#define MP(x, y) make_pair(x, y)
#define fi first
#define se second
//#define int long long
#define LL long long
#define ull unsigned long long
#define rg register
#define pt(x) printf("%d ", x);
//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1<<22, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 22)], *p1 = buf, *p2 = buf;
//char obuf[1<<24], *O = obuf;
//void print(int x) {if(x > 9) print(x / 10); *O++ = x % 10 + '0';}
//#define OS *O++ = ' ';
using namespace std;
//using namespace __gnu_pbds;
const int MAXN = , INF = 1e9 + , mod = 1e9 + ;
const double eps = 1e-;
inline int read() {
char c = getchar(); int x = , f = ;
while(c < '' || c > '') {if(c == '-') f = -; c = getchar();}
while(c >= '' && c <= '') x = x * + c - '', c = getchar();
return x * f;
}
int N, M;
int a[MAXN][MAXN];
int xx[] = {, -, +, , };
int yy[] = {, , , -, +};
int ans[MAXN * MAXN][], cnt = ;
void add(int i, int j, int wx, int wy) {
ans[++cnt][] = i;
ans[cnt][] = j;
ans[cnt][] = wx;
ans[cnt][] = wy;
}
main() {
N = read(); M = read();
for(int i = ; i <= N; i++)
for(int j = ; j <= M; j++)
a[i][j] = read();
for(int i = ; i < N; i++) {
for(int j = ; j <= M; j++) {
if(a[i][j] & ) {
int wx = i + , wy = j;
a[i][j]--; a[wx][wy]++;
add(i, j, wx, wy);
}
}
}
for(int i = ; i < M; i++) {
if(a[N][i] & ) {
a[N][i]--; a[N][i + ]++;
add(N, i, N, i + );
}
}
printf("%d\n", cnt);
for(int i = ; i <= cnt; i++)
printf("%d %d %d %d\n", ans[i][], ans[i][], ans[i][], ans[i][]);
return ;
}
/*
2 2 1
1 1
2 1 1
*/

D

AtCoderBeginnerContest109题解的更多相关文章

  1. 2016 华南师大ACM校赛 SCNUCPC 非官方题解

    我要举报本次校赛出题人的消极出题!!! 官方题解请戳:http://3.scnuacm2015.sinaapp.com/?p=89(其实就是一堆代码没有题解) A. 树链剖分数据结构板题 题目大意:我 ...

  2. noip2016十连测题解

    以下代码为了阅读方便,省去以下头文件: #include <iostream> #include <stdio.h> #include <math.h> #incl ...

  3. BZOJ-2561-最小生成树 题解(最小割)

    2561: 最小生成树(题解) Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 1628  Solved: 786 传送门:http://www.lyd ...

  4. Codeforces Round #353 (Div. 2) ABCDE 题解 python

    Problems     # Name     A Infinite Sequence standard input/output 1 s, 256 MB    x3509 B Restoring P ...

  5. 哈尔滨理工大学ACM全国邀请赛(网络同步赛)题解

    题目链接 提交连接:http://acm-software.hrbust.edu.cn/problemset.php?page=5 1470-1482 只做出来四道比较水的题目,还需要加强中等题的训练 ...

  6. 2016ACM青岛区域赛题解

    A.Relic Discovery_hdu5982 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Jav ...

  7. poj1399 hoj1037 Direct Visibility 题解 (宽搜)

    http://poj.org/problem?id=1399 http://acm.hit.edu.cn/hoj/problem/view?id=1037 题意: 在一个最多200*200的minec ...

  8. 网络流n题 题解

    学会了网络流,就经常闲的没事儿刷网络流--于是乎来一发题解. 1. COGS2093 花园的守护之神 题意:给定一个带权无向图,问至少删除多少条边才能使得s-t最短路的长度变长. 用Dijkstra或 ...

  9. CF100965C题解..

    求方程 \[ \begin{array}\\ \sum_{i=1}^n x_i & \equiv & a_1 \pmod{p} \\ \sum_{i=1}^n x_i^2 & ...

随机推荐

  1. OGG 11g Checkpoint 详解

    OGG Checkpoint 详解   定位中断的位置,下次启动从中断的位置开始恢复.     1.target  端配置: 2.一条记录对应一个replicat   一. Extract Check ...

  2. POJ1860(ford判环)

    Currency Exchange Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 24243   Accepted: 881 ...

  3. 图解SynchronousQueue原理详解-非公平模式

    SynchronousQueue原理详解-非公平模式 开篇 说明:本文分析采用的是jdk1.8 约定:下面内容中Ref-xxx代表的是引用地址,引用对应的节点 前面已经讲解了公平模式的内容,今天来讲解 ...

  4. 51nod1255(栈)

    题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1255 题意:中文题诶- 思路:对于当前字符 s[i],若其不在 ...

  5. mui框架使用心得

    这段时间一直在用mui框架做项目,现在很多快速开发的app大部分是用MUI和APICloud开发的.所以我就把他们对比了一下. mui有自己的UI组件,我在项目中,很少用框架的UI组件,而使用框架的j ...

  6. 剑指Offer的学习笔记(C#篇)-- 链表中倒数第K个点

    题目描述 输入一个链表,输出该链表中倒数第k个结点. 一 . 数据结构基础概念普及(线性表). 线性表可分为顺序表与链表,它们是堆栈.队列.树.图等数据结构的实现基础. 顺序表,线性表的顺序存储结构是 ...

  7. webpack 打包和手动创建一个vue的项目

    首先我们为啥要用webpack,为啥不用其他的打包的工具. 先听我捋捋, Webpack有人也称之为 模块打包机 ,由此也可以看出Webpack更侧重于模块打包,当然我们可以把开发中的所有资源(图片. ...

  8. PJzhang:kali linux安装网易云音乐、Visual Studio Code、skype

    猫宁!!! 参考链接:https://blog.csdn.net/cloudatlasm/article/details/79183583 https://code.visualstudio.com/ ...

  9. 黑马Mybatis day3 多表查询 1.xml配置方式 2.注解方式

    package com.itheima.mozq; import com.itheima.domain.Order; import com.itheima.mapper.OrderMapper; im ...

  10. JavaWeb之用户数据回显