以后不放水题了

C.NN and the Optical Illusion

复习一下高中数学即可

$\frac{ans}{ans+r}=\sin \frac{\pi}{n}$

解方程

 #include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const double pai=acos(-);
int n,d; double a;
int main()
{
scanf("%d%d",&n,&d),a=pai/n;
printf("%f",sin(a)*d/(-sin(a)));
return ;
}

D.Dasha and Chess

先走到中间,然后背对着车最少的那个角落走,根据咕咕原理可知这边最少有 666*3/4=499.5— —也就是500 只车,而走过去只需要499步,所以一定能被将到;总步数最多499+499步

  #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=;
pair<int,int> rook[N];
int t1,t2,t3,kx,ky,mini;
int ocp[N][N],cnt[][];
void Check()
{
if(t1<=) exit();
}
void Move(int xx,int yy)
{
kx+=xx,ky+=yy;
if(ocp[kx][ky]) kx-=xx;
printf("%d %d\n",kx,ky),fflush(stdout);
scanf("%d%d%d",&t1,&t2,&t3),Check();
int rx=rook[t1].first,ry=rook[t1].second;
ocp[rx][ry]=false,rook[t1]=make_pair(t2,t3),ocp[t2][t3]=true;
}
int main()
{
scanf("%d%d",&kx,&ky),mini=1e9;
for(int i=;i<=;i++)
{
scanf("%d%d",&t1,&t2);
rook[i]=make_pair(t1,t2),ocp[t1][t2]=true;
}
while(kx<) Move(,);
while(kx>) Move(-,);
while(ky<) Move(,);
while(ky>) Move(,-);
for(int i=;i<=;i++)
for(int j=;j<=;j++)
if(ocp[i][j]) cnt[i>][j>]++;
for(int i=;i<=;i++)
for(int j=;j<=;j++)
if(cnt[i][j]<mini) mini=cnt[i][j];
for(int i=;i<=;i++)
for(int j=;j<=;j++)
if(cnt[i][j]==mini)
while(true) Move(i?-:,j?-:);
return ;
}

E.Andrew and Taxi

首先一定有解,构造方法是所有边都是小编号指向大编号,那么二分答案对大于答案的边跑拓扑排序检验即可

 #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=;
struct a
{
int u,v,w;
}edg[N];
int p[N],noww[N],goal[N];
int deg[N],idx[N],que[N],outp[N];
int n,m,f,b,t1,t2,t3,cnt,num,ans;
void Link(int f,int t)
{
noww[++cnt]=p[f],p[f]=cnt;
goal[cnt]=t,deg[t]++;
}
bool Nocir(int x)
{
num=,cnt=,f=,b=-;
memset(p,,sizeof p);
memset(deg,,sizeof deg);
for(int i=;i<=m;i++)
if(edg[i].w>x)
Link(edg[i].u,edg[i].v);
for(int i=;i<=n;i++)
if(!deg[i]) que[++b]=i;
while(f<=b)
{
int tn=que[f++]; idx[tn]=++num;
for(int i=p[tn];i;i=noww[i])
if(!(--deg[goal[i]]))
que[++b]=goal[i];
}
for(int i=;i<=n;i++)
if(deg[i]) return false;
return true;
}
int main()
{
scanf("%d%d",&n,&m);
for(int i=;i<=m;i++)
{
scanf("%d%d%d",&t1,&t2,&t3);
edg[i]=(a){t1,t2,t3},ans=max(ans,t3);
}
int l=,r=ans;
while(l<=r)
{
int mid=(l+r)/;
if(Nocir(mid)) r=mid-,ans=mid;
else l=mid+;
}
Nocir(ans);
for(int i=;i<=m;i++)
if(edg[i].w<=ans&&idx[edg[i].u]>idx[edg[i].v])
outp[++outp[]]=i;
printf("%d %d\n",ans,outp[]);
for(int i=;i<=outp[];i++)
printf("%d ",outp[i]);
return ;
}

F.Ivan and Burgers

恭喜出题人获得了“出到原题”成就

???

然后就被踩标算了。。。

 #include<cstdio>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=,K=;
vector<pair<int,int> > ve[N];
vector<pair<int,int> > ::iterator it;
int n,m,t1,t2,val[N],ans[N],bas[K],pos[K];
void Insert(int x,int y)
{
for(int i=;~i;i--)
if(x&(<<i))
{
if(!bas[i])
{
bas[i]=x,pos[i]=y;
return;
}
if(y>pos[i])
swap(x,bas[i]),swap(y,pos[i]);
x^=bas[i];
}
}
int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
scanf("%d",&val[i]);
scanf("%d",&m);
for(int i=;i<=m;i++)
{
scanf("%d%d",&t1,&t2);
ve[t2].push_back(make_pair(t1,i));
}
for(int i=;i<=n;i++)
{
Insert(val[i],i);
for(it=ve[i].begin();it!=ve[i].end();it++)
{
int lef=it->first,idx=it->second;
for(int j=;~j;j--)
if(pos[j]>=lef&&(ans[idx]^bas[j])>ans[idx])
ans[idx]^=bas[j];
}
}
for(int i=;i<=m;i++)
printf("%d\n",ans[i]);
return ;
}

Codeforces Round #532的更多相关文章

  1. Codeforces Round #532 (Div. 2)

    Codeforces Round #532 (Div. 2) A - Roman and Browser #include<bits/stdc++.h> #include<iostr ...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

随机推荐

  1. 如何批量删除QQ浏览器指定历史记录和导出指定的历史记录

    QQ浏览器的历史记录只有清空历史记录和删除选中项两个功能.有时我不想删除所有的历史记录,只是想删除指定的历史记录保留对自己有用的历史记录,方便自己以后查找.但是删除选中项功能只能一项一项的选择,才能批 ...

  2. Linux 文件系统 -- 简述几种文件类型

    Linux 中一切皆为文件,文件类型也有多种,使用 ls -l 命令可以查看文件的属性,所显示结果的第一列的第一个字符用来表明该文件的文件类型,如下: 1.普通文件 使用 ls -l 命令后,第一列第 ...

  3. Python列表解析

    列表解析 根据已有列表,高效创建新列表的方式. 列表解析是Python迭代机制的一种应用,它常用于实现创建新的列表,因此用在[]中. 语法: [expression for iter_val in i ...

  4. 团队项目开题Scrum Meeting报告

    团队项目开题Scrum Meeting报告 在10月30号星期四的晚上我们团队找到了给我们代码的王翊学长,由学长给我们讲解了他编写IOS平台上北航MOOC系统的架构和思路, 因为我们团队没有苹果公司的 ...

  5. No.111_第四次团队会议

    后端的偏执 啊,这次又轮到我写团队博客了. 此时又是深夜,窗外漫天繁星.舍友的呼噜声惊吓了月亮,它害羞地跑回了云里去. 我关上灯拔掉机械,悄悄拿着电脑上了床,写这次的团队博客.曾经觉得自己绝对不会晚睡 ...

  6. 08慕课网《进击Node.js基础(一)》事件events

    引用events模块中的EventEmitter 事件的监听和发射 相同的事件发射数量有限,可以通过setMaxListeners设置峰值 var EventEmitter = require('ev ...

  7. Beta后续感想/吐槽

    感想 磨人的软工实践终于结束了 艰难的度过了一学期,还是写点什么纪念一下吧. 大一大二的时候就听说软工实践是魔鬼般的锻炼,于是当年不知天高地厚的我是很期待的,终于,我大三了. 后来,我长大了. alp ...

  8. 啊啊啊 草蛋啊 之前努力一天搞出来的时间算法 被一句pk掉 给我砖头

    package yun3; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Cale ...

  9. linux上传的命令

    pscp D:\apache-tomcat-8.0.38\webapps\GameDataServer.zip root@112.74.32.215:/usr/local/tools/tomcat/a ...

  10. 在数组中找出两数之和为10的所有组合(JAVA)

    /*利用冒泡排序实现*/ import java.util.Scanner;public class Paixun { public static void main(String[] args) { ...