Codeforces Round #194 (Div. 2)
来源:互联网 发布:2016中国汽车销量数据 编辑:程序博客网 时间:2024/05/17 06:54
这场总体感觉不是很难,但是题目理解上有些费劲
A - Candy Bags
#include<iostream>#include<cstdio>#include<cstring>using namespace std;int main(){ int n; cin>>n; int mid=n/2; int before=n*n/2,behind=before+1; for(int i=1;i<=n;i++) { for(int j=0;j<mid;j++) cout<<before--<<" "; for(int j=0;j<mid;j++) cout<<behind++<<" "; cout<<endl; } return 0;}
B - Eight Point Sets
#include<iostream>#include<cstdio>#include<map>#include<set>using namespace std;int main(){ //freopen("in.txt","r",stdin); int x,y; set<int> cntx,cnty; map<pair<int,int>,bool> m; for(int i=0;i<8;i++) { cin>>x>>y; cntx.insert(x); cnty.insert(y); m[make_pair(x,y)]=true; } if(cntx.size()!=3||cnty.size()!=3||m.size()!=8)cout<<"ugly"<<endl; else { set<int>::iterator it1=cntx.begin(),it2=cnty.begin(); it1++,it2++; if(m[make_pair(*it1,*it2)])cout<<"ugly"; else cout<<"respectable"; cout<<endl; } return 0;}
C - Secrets
题意看了半天没看懂
#include<iostream>#include<cstring>#include<cstdio>using namespace std;typedef long long LL;int main(){ LL n; cin>>n; while(!(n%3))n/=3; cout<<(n/3)+1<<endl; return 0;}
D - Chips
#include<iostream>#include<cstdio>#include<cstring>using namespace std;const int maxn=1010;int n,m,visx[maxn],visy[maxn];int solve(int *vis){ int ans=0; for(int i=2;i<=n-1;i++) if(!vis[i])ans++; return ans;}int main(){ //freopen("in.txt","r",stdin); cin>>n>>m; int x,y; memset(visx,0,sizeof(visx)); memset(visy,0,sizeof(visy)); for(int i=0;i<m;i++) { cin>>x>>y; visy[y]++; visx[x]++; } int ans=0; ans+=solve(visx)+solve(visy); if((n&1)&&!visx[n/2+1]&&!visy[n/2+1])ans--; cout<<ans<<endl; return 0;}
0 0
- Codeforces Round #194 (Div. 2)
- Codeforces Round #194 (Div. 2)总结
- Codeforces Round #194 (Div. 2) D. Chips
- Codeforces Round #194 (Div. 2) 题解
- Codeforces Round #194 (Div. 1)
- Codeforces Round #102 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #104 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #107 (Div. 2)
- Codeforces Round #108 (Div. 2)
- Codeforces Round #110 (Div. 2)
- Codeforces Round #122 (Div. 2)
- Codeforces Round #121 (Div. 2)
- Codeforces Round #124 (Div. 2)
- Codeforces Round #124 (Div. 2)
- Python 使用 Xlrd/xlwt 操作 Excel
- LeetCode Minimum Depth of Binary Tree
- Android的三种网络通信方式
- 第二周作业01 -- 素数的算法实现
- Python 学习经历(一) :python语法总结
- Codeforces Round #194 (Div. 2)
- Chrome OS (hexxeh编译版本)安装到硬盘的方法修正
- SmartMio:懒人健身专用,八块腹肌等着你
- 在C程序中内嵌Python解释器,用脚本语言实现灵活的Plugin机制
- Java中final关键字用法总结
- c++ getline()函数用法
- sokcet超时
- 图案打印
- hdu 2041 and hdu 2044 and hdu 2045(打表 递归)(备战LQB)