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) { ]; ...
随机推荐
- 使用命令行登陆数据库配置文件修改 解决ora12528
下面是问题解决: ORA-12528: TNS:listener: all appropriate instances are blocking new connections 1:修改listene ...
- spring+activemq配置文件内容及实现原理
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...
- 一个shell的面试题
5.写一个脚本,实现判断192.168.1.024网络里,当前在线的D有哪些,能ping通则认为在线,在线输出"TP地址UP",不在线输出TP地址DOWN",无其他输出. ...
- centos7和centos6.5环境rpm方式安装mysql5.7和mysql5.6详解
centos环境安装mysql5.7 其实不建议安装mysql5.7 语法和配置可能和以前的版本区别较大,多坑,慎入 1.yum方式安装(不推荐) a.安装mysql5.7 yum源 centos6: ...
- java.lang.NoClassDefFoundError: com/google/inject/Injector
报错如下: 解决方案: <dependency> <groupId>com.google.inject</groupId> <artifactId>gu ...
- Android 截屏与 WebView 长图分享经验总结
最近在做新业务需求的同时,我们在 Android 上遇到了一些之前没有碰到过的问题,截屏分享. WebView 生成长图以及长图在各个分享渠道分享时图片模糊甚至分享失败等问题,在这过程中踩了很多坑,到 ...
- js闭包实例汇总
本文是通过实例来帮助大家深刻理解js闭包,是篇非常不错的文章,这里推荐给大家,有需要的小伙伴可以参考下 Js闭包 闭包前要了解的知识 1. 函数作用域 (1).Js语言特殊之处在于函数内部可以直接读取 ...
- Jquery----对文档操作
jquery对css操作: 1.CSS .css() - .css("color") -> 获取color css值 - .css("color", &q ...
- Myeclipse调试模式下自动提示变量值设置
1.Window->Preferences->Java->Editor->Hovers 将[Variable Values]选择即可,如果第一个[Combined Hover] ...
- Ext.js入门:常用组件与综合案例(七)
一:datefield简单示例 二:timefield简单示例 三:numberfield简单示例 四:FormPanel提交 datefield简单示例: <html xmlns=&quo ...