AIM Tech Round 5 (rated, Div. 1 + Div. 2) (A, B, E)
B.Unnatural Conditions
题目链接 :
http://codeforces.com/contest/1028/problem/B
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define lson x<<1
#define rson (x<<1)|1 using namespace std;
#define maxn 200010 void Swap(int &a, int &b){
int tmp = a;a = b;b = tmp;
} typedef long long ll;
int main(){int n, m;cin >> n >> m;for(int i = ; i <= n; i++) printf(""); cout << endl;
for(int i = ; i < n; i++)printf("");cout << "" << endl;return ;
}
E. Restore Array
题目链接:
http://codeforces.com/contest/1028/problem/E
#include<cstdio>
#include<algorithm>
using namespace std;
int n, pv = -;
long long w[], Mx, res[], ss, ck = ;
int main() {
int i;
scanf("%d", &n);
for (i = ; i < n; i++) {
scanf("%lld", &w[i]);
if (Mx < w[i])Mx = w[i];
ss += w[i];
}
if (Mx == ) {
puts("YES");
for (i = ; i < n; i++)printf("%d ", );
return ;
}
for (i = ; i < n; i++) {
if (w[i] != Mx && w[(i + ) % n] == Mx) {
pv = (i + ) % n;
}
}
if (pv == -) {
puts("NO");
return ;
}
res[pv] = Mx;
for (i = ; i < n - ; i++) {
int tpv = pv;
pv = (pv + n - ) % n;
if (w[pv] == && !ck) {
res[pv] = res[tpv] * ;
ck = ;
}
else {
res[pv] = res[tpv] + w[pv];
}
}
puts("YES");
for (i = ; i < n; i++)printf("%lld ", res[i]);
}
AIM Tech Round 5 (rated, Div. 1 + Div. 2) (A, B, E)的更多相关文章
- AIM Tech Round 5 (rated, Div. 1 + Div. 2)
A. Find Square 找到对角线的两个点的坐标,这道题就迎刃而解了. inline void work(int n) { int m; cin >> m; memset(str, ...
- 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 ...
随机推荐
- php数组实现根据某个键值将相同键值合并生成新二维数组的方法
$infos = array( array( 'a' => 36, 'b' => 'xa', 'c' => '2015-08-28 00:00:00', 'd' => '201 ...
- luo3372线段树模板的分块做法
题目大意 请你维护一个有n个元素的整数序列,要求支持区间查询&区间修改 对于100%的数据,\(1<=n<=10^5\) 分析 正常做法是线段树维护区间修改.区间查询,今天我要讲的 ...
- selenium3+java+POM 跨浏览器测试之------读取配置文件
我们知道,web 测试的时候是需要切换不同的浏览器以查看每个功能在不同浏览器上的运行情况,使得开发的程序更具有健壮性.本文先总结一下如何通过读取配置文件来切换浏览器. 具体步骤如下: 一.编写配置文件 ...
- 使用Eclipse中的SVN提交代码遇到的问题
问题: Previous operation has not finished; run 'cleanup' if it was interrupted svn: Commit failed (det ...
- __x__(43)0910第六天__ clearfix 解决:垂直外边距重叠,高度塌陷
<div class="box1"> <tabl></table> <div class="box2">< ...
- [LeetCode] Similar RGB Color 相似的红绿蓝颜色
In the following, every capital letter represents some hexadecimal digit from 0 to f. The red-green- ...
- laravel整合workerman做聊天室
测试工具 http://www.blue-zero.com/WebSocket/ 2018年8月6日17:28:24 <?php namespace App\Console\Commands; ...
- js滚动条滚动到底部触发事件
$("#contain").scroll(function(){ var $this =$(this), viewH =$(this).height(),//可见高度 conten ...
- Nuxt.js调用asyncData
<template> <div> Index {{ username }} </div> </template> <script> expo ...
- stm32入门学习路线个人见解
可以说就目前的市场需求来看,stm32在单片机领域已经拥有了绝对的地位,51什么的已经过时了也只能拿来打基础了,最后依然会转到stm32来,也正是因为这样stm32的学习者越来越多,其中不难发现绝大部 ...