Codeforces Round #532 (Div. 2)

A - Roman and Browser

 #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

B - Build a Contest

 #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)的更多相关文章

  1. Codeforces Round #532 (Div. 2) 题解

    Codeforces Round #532 (Div. 2) 题目总链接:https://codeforces.com/contest/1100 A. Roman and Browser 题意: 给出 ...

  2. Codeforces Round #532 (Div. 2) F 线性基(新坑) + 贪心 + 离线处理

    https://codeforces.com/contest/1100/problem/F 题意 一个有n个数组c[],q次询问,每次询问一个区间的子集最大异或和 题解 单问区间子集最大异或和,线性基 ...

  3. Codeforces Round #532 (Div. 2):F. Ivan and Burgers(贪心+异或基)

    F. Ivan and Burgers 题目链接:https://codeforces.com/contest/1100/problem/F 题意: 给出n个数,然后有多个询问,每次回答询问所给出的区 ...

  4. Codeforces Round #532 (Div. 2)- B(思维)

    Arkady coordinates rounds on some not really famous competitive programming platform. Each round fea ...

  5. Codeforces Round #532(Div. 2) C.NN and the Optical IIIusion

    链接:https://codeforces.com/contest/1100/problem/C 题意: 一个圆球外面由其他圆球包裹,两两相连. 给出n,r. n为外面圆球数量,r为内部圆球半径. 求 ...

  6. Codeforces Round #532(Div. 2) B.Build a Contest

    链接:https://codeforces.com/contest/1100/problem/B 题意: 给n,m. 给m个数,每个数代表一个等级,没给一个将其添加到题目池中,当题目池中有难度(1-n ...

  7. 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 ...

  8. Codeforces Round #532 (Div. 2) E. Andrew and Taxi(二分+拓扑排序)

    题目链接:https://codeforces.com/contest/1100/problem/E 题意:给出 n 个点 m 条边的有向图,要翻转一些边,使得有向图中不存在环,问翻转的边中最大权值最 ...

  9. Codeforces Round #532 (Div. 2) Solution

    A. Roman and Browser 签到. #include <bits/stdc++.h> using namespace std; ]; int get(int b) { ]; ...

随机推荐

  1. java中集合的组成及特点

    1:集合 Collection(单列集合) List(有序,可重复) ArrayList 底层数据结构是数组,查询快,增删慢 线程不安全,效率高 Vector 底层数据结构是数组,查询快,增删慢 线程 ...

  2. sum行列合计

    select sum(decode(cplb,'3',hj,0)) from lr_scsjdqdw t group by zcxmdm

  3. 005_关于HTTP协议中的保持连接

    缘起 中午在群里讨论,用ab测试 一台只提供静态文件服务, 不与其他任何系统交互的时候,为什么也会产生大量的TIME WAIT状态的. 首先,我们可以简单的理解,在TCP连接的两端,谁主动断开连接(先 ...

  4. zabbix3.0.4使用shell脚本和zabbix自带模板两种方法添加对指定进程和端口的监控

    zabbix3.0.4添加对进程的监控: 方法一:通过自定义命令进行监控 主要思路: 通过 ps -ef|grep sdk-push-1.0.0.jar |grep -v grep|wc -l 这个命 ...

  5. 中文汉字和常见英文数字等的unicode编码范围实例页面

    链接: https://www.zhangxinxu.com/study/201611/chinese-language-unicode-range.html

  6. TCP 远程执行CMD (解决粘包问题) 代码

    服务端 from socket import * import subprocess,json,struct server= socket(AF_INET,SOCK_STREAM) server.bi ...

  7. jquery之源码

    1.插件扩展机制 所有的Jquery代理对象的实例,都是扩展自$.fn对象的 意味着只要我们继续扩展$.fn这个对象的功能,就相当于扩展了所有的Jquery代理对象的实例的功能 代码 var $bod ...

  8. gulp-px2rem-plugin 插件的一个小bug

    最近在使用这个插件的过程中发现一个bug: 不支持 含有小数的形式. 查看源码后,修改了下其中的正则,使其支持小数形式(66.66px..6px ). 作者的源码最近一次更新都在两年前,所以就简单的记 ...

  9. python 全栈开发,Day13(迭代器,生成器)

    一.迭代器 python 一切皆对象 能被for循环的对象就是可迭代对象 可迭代对象: str,list,tuple,dict,set,range 迭代器: f1文件句柄 dir打印该对象的所有操作方 ...

  10. MonologFX最简demo,javafx外用dialog示例

    参考blog:https://blogs.oracle.com/javajungle/entry/monologfx_floss_javafx_dialogs_for /* * To change t ...