Codeforces Round #532 (Div. 2)
Codeforces Round #532 (Div. 2)
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#define lson i<<1
#define rson i<<1|1
#define LS l,mid,lson
#define RS mid+1,r,rson
#define mem(a,x) memset(a,x,sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define ll long long
#define ull unsigned long long
#define lowbit(x) (x&-x)
#define pb(x) push_back(x)
#define enld endl
#define mian main
#define itn int
#define prinft printf
#pragma GCC optimize(2)
//#pragma comment(linker, "/STACK:102400000,102400000")
const double PI = acos (-1.0);
const int INF = 0x3f3f3f3f;
;
;
;
;
using namespace std;
int n, k, ans;
];
int cnt1, cnt2;
int main() {
cin >> n >> k;
cnt1 = cnt2 = ans = ;
; i <= n; ++i) {
cin >> a[i];
) {
cnt1++;
} else {
cnt2++;
}
}
int t1, t2;
; i <= ; ++i) {
t1 = t2 = ;
; i + j * k <= n; ++j) {
) {
t1++;
} ) {
t2++;
}
}
ans = max(ans, abs((cnt1 - t1) - (cnt2 - t2)));
}
cout << ans << endl;
}
A
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#define lson i<<1
#define rson i<<1|1
#define LS l,mid,lson
#define RS mid+1,r,rson
#define mem(a,x) memset(a,x,sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define ll long long
#define ull unsigned long long
#define lowbit(x) (x&-x)
#define pb(x) push_back(x)
#define enld endl
#define mian main
#define itn int
#define prinft printf
#pragma GCC optimize(2)
//#pragma comment(linker, "/STACK:102400000,102400000")
const double PI = acos (-1.0);
const int INF = 0x3f3f3f3f;
;
;
;
;
using namespace std;
int n, m, tmp;
queue<int> q;
queue<int> qt;
int vis[MAXN];
int main() {
cin >> n >> m;
; i <= m; ++i) {
cin >> tmp;
if(!vis[tmp]) {
q.push(tmp);
}
vis[tmp]++;
if(q.size() == n) {
int cnt = n;
while(cnt--) {
vis[q.front()]--;
if(vis[q.front()])
q.push(q.front());
q.pop();
}
cout << ;
} else
cout << ;
}
cout << endl;
}
B
C
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<map>
#define lson i<<1
#define rson i<<1|1
#define LS l,mid,lson
#define RS mid+1,r,rson
#define mem(a,x) memset(a,x,sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define ll long long
#define ull unsigned long long
#define lowbit(x) (x&-x)
#define pb(x) push_back(x)
#define enld endl
#define mian main
#define itn int
#define prinft printf
#pragma GCC optimize(2)
//#pragma comment(linker, "/STACK:102400000,102400000")
const double PI = acos (-1.0);
const int INF = 0x3f3f3f3f;
;
;
;
;
using namespace std;
double n,r;
int main()
{
cin>>n>>r;
printf(-sin(PI/n))*r);
}
C
Codeforces Round #532 (Div. 2)的更多相关文章
- Codeforces Round #532 (Div. 2) 题解
Codeforces Round #532 (Div. 2) 题目总链接:https://codeforces.com/contest/1100 A. Roman and Browser 题意: 给出 ...
- Codeforces Round #532 (Div. 2) F 线性基(新坑) + 贪心 + 离线处理
https://codeforces.com/contest/1100/problem/F 题意 一个有n个数组c[],q次询问,每次询问一个区间的子集最大异或和 题解 单问区间子集最大异或和,线性基 ...
- Codeforces Round #532 (Div. 2):F. Ivan and Burgers(贪心+异或基)
F. Ivan and Burgers 题目链接:https://codeforces.com/contest/1100/problem/F 题意: 给出n个数,然后有多个询问,每次回答询问所给出的区 ...
- Codeforces Round #532 (Div. 2)- B(思维)
Arkady coordinates rounds on some not really famous competitive programming platform. Each round fea ...
- Codeforces Round #532(Div. 2) C.NN and the Optical IIIusion
链接:https://codeforces.com/contest/1100/problem/C 题意: 一个圆球外面由其他圆球包裹,两两相连. 给出n,r. n为外面圆球数量,r为内部圆球半径. 求 ...
- Codeforces Round #532(Div. 2) B.Build a Contest
链接:https://codeforces.com/contest/1100/problem/B 题意: 给n,m. 给m个数,每个数代表一个等级,没给一个将其添加到题目池中,当题目池中有难度(1-n ...
- Codeforces Round #532(Div. 2) A.Roman and Browser
链接:https://codeforces.com/contest/1100/problem/A 题意: 给定n,k. 给定一串由正负1组成的数. 任选b,c = b + i*k(i为任意整数).将c ...
- Codeforces Round #532 (Div. 2) E. Andrew and Taxi(二分+拓扑排序)
题目链接:https://codeforces.com/contest/1100/problem/E 题意:给出 n 个点 m 条边的有向图,要翻转一些边,使得有向图中不存在环,问翻转的边中最大权值最 ...
- Codeforces Round #532 (Div. 2) Solution
A. Roman and Browser 签到. #include <bits/stdc++.h> using namespace std; ]; int get(int b) { ]; ...
随机推荐
- zabbix系列(四)Zabbix3.0.4添加对Nginx服务的监控
Zabbix3.0.4添加对Nginx服务的监控 通过Nginx的http_stub_status_module模块提供的状态信息来监控,所以在Agent端需要配置Nginx状态获取的脚本,和添加ke ...
- Ex 6_26 序列对齐..._第七次作业
- Day5-----------------------系统监控
1.top 命令 查看终端信息 who 显示终端用户有哪些 bash 开启终端进程 PID:进程身份证 buffer:缓冲区 cache:高速缓存 进程:动起来的文件,CPU调用运行的过程 2.fre ...
- 中文多分类 BERT
直接把自己的工作文档导入的,由于是在外企工作,所以都是英文写的 Steps: git clone https://github.com/google-research/bert prepare dat ...
- java多线程快速入门(五)
常用线程api方法 多线程运行状态 1.新建状态 用new创建一个线程 2.就绪状态 当调用线程的start()方法 3.运行状态 当线程获得cpu,开始执行run方法 4.阻塞状态 线程通过调用sl ...
- 深度学习Bible学习笔记:第六章 深度前馈网络
第四章 数值计算(numerical calculation)和第五章 机器学习基础下去自己看. 一.深度前馈网络(Deep Feedfarward Network,DFN)概要: DFN:深度前馈网 ...
- php中的接口interface
* 接口 * 1.使用关键字:interface * 2.类是对象的模板,接口是类的模板 * 3.接口看作是一个特殊的类 * 4.接口中的方法,只声明不实现,与抽象类一样 * 5.接口中的方法必须是p ...
- javafx的scene大小不能在控制器中设置
做个记录,备忘 遇到一个问题,点击提交,红色标识的VBox大小不能改变.问题如图,代码如下 点击后 fxml结构简化代码: 红色框体对应vboxMax <VBox fx:id="vbo ...
- 【APUE | 10】函数signal
函数signal 函数signal介绍 typedef void (*sighandler_t)(int); sighandler_t signal(int signum, sighandler_t ...
- day15--JavaScript
上节作业回顾 <style></style>代表的是CSS样式 <script></script>代表的是JavaScript样式 1. ...