codeforces 334A - Candy Bags
忘了是偶数了,在纸上画奇数画了半天。。。
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
using namespace std; #define LL __int64 int vis[]; int main()
{
int n,i,j,tot;
scanf("%d",&n);
j=;
for(i=;i<n;i++)
{
int tot=;
while()
{
printf("%d %d ",j,n*n-j+);
j++;
tot++;
if(tot>=n/)
break;
}
printf("\n");
}
return ;
}
codeforces 334A - Candy Bags的更多相关文章
- 334A Candy Bags
A. Candy Bags time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- codeforces A. Candy Bags 解题报告
题目链接:http://codeforces.com/contest/334/problem/A 题意:有n个人,将1-n袋(第 i 袋共有 i 颗糖果,1<= i <=n)所有的糖 ...
- A. Candy Bags
A. Candy Bags http://codeforces.com/problemset/problem/334/A time limit per test 1 second memory l ...
- Candy Bags
读懂了题就会发现这是个超级大水题 Description Gerald has n younger brothers and their number happens to be even. One ...
- F - Candy Bags
A. Candy Bags time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- Codeforces 488B - Candy Boxes
B. Candy Boxes 题目链接:http://codeforces.com/problemset/problem/488/B time limit per test 1 second memo ...
- CodeForces Round 194 Div2
A. Candy Bagstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputs ...
- Codeforces Round #194 (Div.1 + Div. 2)
A. Candy Bags 总糖果数\(\frac{n^2(n^2+1)}{2}\),所以每人的数量为\(\frac{n}{2}(n^2+1)\) \(n\)是偶数. B. Eight Point S ...
- Candy Distribution
Kids like candies, so much that they start beating each other if the candies are not fairly distribu ...
随机推荐
- ubuntu 12.04 搭建nginx + php + mysql +phpmyadmin
1. 使用官方PPA安装 Nginx 最新版本,使用以下命令:sudo add-apt-repository ppa:nginx/stablesudo apt-get updatesudo apt-g ...
- tomcat 优化实记
好记性不如烂笔头,以下是 tomcat 无脑优化 1.内存设置(VM参数调优)(1). Windows环境下,是tomcat解压版(执行startup.bat启动tomcat) 解决办法:修改“%T ...
- 剑指offer--面试题15
题目:打印单向链表中倒数第k个节点 以下为自己所写代码,未经过验证,只是写个思路... #include<iostream> #include<vector> #include ...
- 本地不安装oracle-client,使用pl/sql developer连接数据库
一.问题描述 本地未安装oracle-client端,由于机器资源有限,希望通过pl/sql developer进行远程数据库连接.单纯的安装pl/sql developer无法远程连接数据库. 二. ...
- JavaScript高级---门面模式设计
门面模式 两个作用: 1.简化类的接口 2.消除类与使用它的客户代码之间的耦合 门面模式常常是开发人员最亲密的朋友.它几乎是所有javascript库的核心原则 门面模式的目的是为了让开发人员用更简单 ...
- firefox无法安装未通过验证的扩展
firefox43版本无法安装未验证附加组件,利用以下方法: 1.进入firefox about:config页面中 2.搜索xpinstall.signatures.required,将值改为fa ...
- 从后端到页面:如何全方位监控 Ruby 应用?
[编者按]本文参考技术分享 ,由 OneAPM 工程师补充整理,并且已经征得原作者的同意. 为什么选择 OneAPM ? 在性能监控领域,业界比较有名的是 New Relic 还有 Appdynami ...
- Codeforces 337D Book of evil
一道树形dp,写出来是因为最近也做了道类似的.这题是看了分析的思路才做出来的,但感觉很多这样的dp都是利用类似的性质.像这题的话distDown很好想,但distUp的时候就很难想了,其实只要抓住di ...
- Android 异步加载
Android 4.0 后 貌似规定了 在主线程中不允许访问网络,在子线程中不允许修改UI. 否则会抛出NetworkOnMainThreadException 异常 解决办法: 采用继承 Async ...
- My_Plan
离清北夏令营不远了,今天时间也不太多了,貌似并不够我写一道题 所以就先挖个坑制定个计划啦 从5.10到5.20 先制定十天的计划吧 1.考试题的每道题目都要改出来并做总结 2.数位DP练习(十道+总结 ...