生平第一场Codeforce……纪念一下,虽然跪的跟渣渣似的……啊不就是跪成渣渣了……

A、B暴力过去的……不知道会不会超时……C我犯了个2B错误,让输出总共多少条边,我都求出来边集E了……直接输出E.size()就行了……我居然还特么的自己用n去算!还找度数为0的点去减!WA了两次pretest……然后时间上浪费也好多……本来可以上2000分的T_T果然还是经验不足啊。

A:

 #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,n) for(int i=0;i<n;++i)
#define F(i,j,n) for(int i=j;i<=n;++i)
#define D(i,j,n) for(int i=j;i>=n;--i)
using namespace std; int main(){
// freopen("input.txt","r",stdin);
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
int val1=max(a*/,a-a*c/),val2=max(b*/,b-b*d/);
if (val1>val2) printf("Misha\n");
else if (val1<val2) printf("Vasya\n");
else printf("Tie\n");
return ;
}

B:

 #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,n) for(int i=0;i<n;++i)
#define F(i,j,n) for(int i=j;i<=n;++i)
#define D(i,j,n) for(int i=j;i>=n;--i)
using namespace std; int cnt=,num[]; string oldname[],newname[];
bool sign[]; int main(){
ios::sync_with_stdio(false);
// freopen("input.txt","r",stdin);
int n;
cin >> n;
string s1,s2; int temp=; F(i,,n){
temp=;
cin >> s1 >> s2;
F(j,,cnt) if (s1==newname[j]) {temp=j; break;}
if (temp) newname[temp]=s2;
else {oldname[++cnt]=s1; newname[cnt]=s2;}
}
cout <<cnt<<endl;
F(i,,cnt)
cout << oldname[i]<<" "<<newname[i]<<endl;
return ;
}

C:

 #include<cstdio>
#include<queue>
#include<vector>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,n) for(int i=0;i<n;++i)
#define F(i,j,n) for(int i=j;i<=n;++i)
#define D(i,j,n) for(int i=j;i>=n;--i)
#define pb push_back
using namespace std;
const int N=; void read(int &v){
v=; int sig=;
char ch=getchar();
while(ch<''||ch>''){ if (ch=='-') sig=-; ch=getchar();}
while(ch>=''&&ch<=''){ v=v*+ch-''; ch=getchar();}
} int degree[N],sum[N],a[N],b[N];
queue<int>Q;
struct edge{int from,to;};
vector<edge>E; int main(){
// freopen("input.txt","r",stdin);
int n;
scanf("%d",&n);
F(i,,n-)
scanf("%d%d",&degree[i],&sum[i]);
int ans=;
F(i,,n-)
if (degree[i]==) Q.push(i); while(!Q.empty()){
int x=Q.front(); Q.pop();
if (degree[x]<) continue;
degree[x]=; E.pb((edge){x,sum[x]});
degree[sum[x]]--;
sum[sum[x]]^=x;
if (degree[sum[x]]==) Q.push(sum[x]);
}
printf("%d\n",E.size());
rep(i,E.size())
printf("%d %d\n",E[i].from,E[i].to);
return ;
}

D:(Orz vfleaking)

 伏特跳蚤国王() ::
a * ! + b * ! + c * ! + ...
a < , b < , c < ... 伏特跳蚤国王() ::
把大家表示成这个样子 = =|| 伏特跳蚤国王() ::
= =|||| 大家。。。就是。。所有数。。 伏特跳蚤国王() ::
比如读进来的排列。。。把它的名次写成这个形式。。 伏特跳蚤国王() ::
然后在这个形式下做加法。。 Tunix() ::
!然后按找逐位递增的进制来进位? Tunix() ::
只保留后n位……? 伏特跳蚤国王() ::
嗯 = = 伏特跳蚤国王() ::
你既然都写成这个形式了。。加到 ?? * n! 这一位的时候 伏特跳蚤国王() ::
就可以溜了

VFK的讲解

 

【CodeForces】【#285】Div.2的更多相关文章

  1. 【Codeforces #312 div2 A】Lala Land and Apple Trees

    # [Codeforces #312 div2 A]Lala Land and Apple Trees 首先,此题的大意是在一条坐标轴上,有\(n\)个点,每个点的权值为\(a_{i}\),第一次从原 ...

  2. 【Codeforces AIM Tech Round 4 (Div. 2) C】

    ·将排序限制于子序列中,又可以说明什么呢? C. Sorting by Subsequences ·英文题,述大意:       输入一个长度为n的无重复元素的序列{a1,a2……an}(1<= ...

  3. 【Codeforces Round #438 C】 Qualification Rounds

    [链接]h在这里写链接 [题意] 给你n个问题,每个人都知道一些问题. 然后让你选择一些问题,使得每个人知道的问题的数量,不超过这些问题的数量的一半. [题解] 想法题. 只要有两个问题. 这两个问题 ...

  4. 【Codeforces Round #438 B】Race Against Time

    [链接]h在这里写链接 [题意] 时针.分钟.秒针走不过去. 问你从t1时刻能不能走到t2时刻 [题解] 看看时针.分钟.秒针的影响就好. 看看是不是在整时的位置就好. 然后看看影响到x不能到y; 然 ...

  5. 【Codeforces Round #438 A】Bark to Unlock

    [链接]h在这里写链接 [题意] 在这里写题意 [题解] 枚举它是在连接处,还是就是整个字符串就好. [错的次数] 0 [反思] 在这了写反思 [代码] #include <bits/stdc+ ...

  6. 【codeforces 718 C&D】C. Sasha and Array&D. Andrew and Chemistry

    C. Sasha and Array 题目大意&题目链接: http://codeforces.com/problemset/problem/718/C 长度为n的正整数数列,有m次操作,$o ...

  7. 【Codeforces 321E / BZOJ 5311】【DP凸优化】【单调队列】贞鱼

    目录 题意: 输入格式 输出格式 思路: DP凸优化的部分 单调队列转移的部分 坑点 代码 题意: 有n条超级大佬贞鱼站成一行,现在你需要使用恰好k辆车把它们全都运走.要求每辆车上的贞鱼在序列中都是连 ...

  8. 【codeforces contest 1119 F】Niyaz and Small Degrees

    题目 描述 \(n\) 个点的树,每条边有一个边权: 对于一个 \(X\) ,求删去一些边后使得每个点的度数 \(d_i\) 均不超过 \(X\) 的最小代价: 你需要依次输出 \(X=0 \to n ...

  9. 【Codeforces】Round #491 (Div. 2) 总结

    [Codeforces]Round #491 (Div. 2) 总结 这次尴尬了,D题fst,E没有做出来.... 不过还好,rating只掉了30,总体来说比较不稳,下次加油 A:If at fir ...

  10. 【Codeforces】Round #488 (Div. 2) 总结

    [Codeforces]Round #488 (Div. 2) 总结 比较僵硬的一场,还是手速不够,但是作为正式成为竞赛生的第一场比赛还是比较圆满的,起码没有FST,A掉ABCD,总排82,怒涨rat ...

随机推荐

  1. WinForm程序安装、发布流程

    一  签名 所谓签名就是给应用程序一个身份,申请一个专利.签名的时候需要选择证书.就向我们上学一样,得奖了老师给你发个证书.如果不进行签名,杀毒软件会把你打包后的exe文件作为病毒处理. 签名的步骤: ...

  2. mysql给root开启远程访问权限,修改root密码

    1.MySql-Server 出于安全方面考虑只允许本机(localhost, 127.0.0.1)来连接访问. 这对于 Web-Server 与 MySql-Server 都在同一台服务器上的网站架 ...

  3. 基于jQuery编写的横向自适应幻灯片切换特效

    基于jQuery编写的横向自适应幻灯片切换特效 全屏自适应jquery焦点图切换特效,在IE6这个蛋疼的浏览器兼容性问题上得到了和谐,兼容IE6. 适用浏览器:IE6.IE7.IE8.360.Fire ...

  4. Py Split and Count For "PFW Impact Crusher For Sale South Africa"

    data = 'As we all know, the impact Crusher is fully used in the transportation, energy, construction ...

  5. VPN连接失败

    连接VPN是总提示 本来我以为是VPN服务器的问题,可是别人就能连接成功,所以只能是我自己机子的问题.后来检查了一下连接属性,终于发现了问题: 这里“允许使用这些协议”应该是处于选中状态,而我的属性里 ...

  6. 带有×的EditText

    代码: EditTextWithDel.java(直接复制): package com.sunday.customs; import com.example.customs.R; import and ...

  7. SQL Server 基础:Join用法

    Join(麻蛋  废话不多说 有图有真相) 测试数据脚本 CREATE TABLE Atable ( S# INT, Sname ), Sage INT, Sfrom ) ) insert into ...

  8. [terry笔记]RMAN综合学习之配置

    [terry笔记]RMAN综合学习之备份http://www.cnblogs.com/kkterry/p/3308405.html [terry笔记]RMAN综合学习之恢复 http://www.cn ...

  9. mvc中使用knockoutjs和ajax

    虽然说knockoutjs 官网上写的非常的清楚!但是像我这样的英语呕吐患者,真是虐心啊!今天我写下做个记录,也为那些初次使用的同学给予帮助, 首先我说一下今天我说的内容只是应用不做原理探究,如果没有 ...

  10. jquery-弹窗:layer

    键: 值 描述 下表的属性都是默认值,您可在调用时按需重新配置,他们可帮助你实现各式各样的风格.如是调用: $.layer({键: 值, 键: 值, …}); type: 0 层的类型.0:信息框(默 ...