忘了是偶数了,在纸上画奇数画了半天。。。

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

  1. 334A Candy Bags

    A. Candy Bags time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  2. codeforces A. Candy Bags 解题报告

    题目链接:http://codeforces.com/contest/334/problem/A 题意:有n个人,将1-n袋(第 i  袋共有 i  颗糖果,1<= i  <=n)所有的糖 ...

  3. A. Candy Bags

    A. Candy Bags http://codeforces.com/problemset/problem/334/A   time limit per test 1 second memory l ...

  4. Candy Bags

    读懂了题就会发现这是个超级大水题 Description Gerald has n younger brothers and their number happens to be even. One ...

  5. F - Candy Bags

    A. Candy Bags time limit per test 1 second memory limit per test 256 megabytes input standard input ...

  6. Codeforces 488B - Candy Boxes

    B. Candy Boxes 题目链接:http://codeforces.com/problemset/problem/488/B time limit per test 1 second memo ...

  7. CodeForces Round 194 Div2

    A. Candy Bagstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputs ...

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

  9. Candy Distribution

    Kids like candies, so much that they start beating each other if the candies are not fairly distribu ...

随机推荐

  1. hibernate中文乱码问题

    在学习hibernate的过程中,发现在往mysql数据库中插入数据的时候会报错. <property name="hibernate.connection.url"> ...

  2. 三层架构和MVC

    注:本文章内所有内容都来自互联网,本人主要是起了一个收集的作用 http://www.cnblogs.com/zhhh/archive/2011/06/10/2077519.html 又看到有人在问三 ...

  3. java数据结构学习(一)之二分查找

      二分查找法与我们在孩童时期玩过的猜数的游戏一样,这个游戏里一个朋友会让你猜他正想的一个1至100的数,当你猜了一个数后,他会告诉你三种选择的一个:你猜的比她想的大,或小,或猜中了.为了能用最少的次 ...

  4. TopCoder 603 div1 & div2

    div2 250pts MiddleCode 题意:s串长度为奇数时,将中间字符取掉并添加到t末尾:长度为偶数时,将中间两个较小的字符取掉并添加到末尾. 分析:直接做,学习了一下substr(s, p ...

  5. hdu2012

    http://acm.hdu.edu.cn/showproblem.php?pid=2012 数组大小算错了.....郁闷-_- #include<iostream> #include&l ...

  6. 【nginx运维基础(1)】Nginx的编译安装与使用

    nginx的官方手册: http://nginx.org/en/docs/ 编译安装 下载地址: http://nginx.org/en/download.html # 为了支持rewrite功能,我 ...

  7. Linux 学习guideline

    记得在中国人气和高手最多的linuxform上看到的一句话. 现在自己的书架上以后lkd2+ldd3+情景分析,再加上它ulk3,书架的linux kernel的四库全书已经凑齐,很充实. lkd2: ...

  8. 分布式内存对象缓存系统Memcached-Linux下使用

    Linux下Memcached的使用 1.       安装文件下载 1.1下载memcached服务器端安装文件 版本: memcached-1.4.2.tar.gz 下载地址:http://www ...

  9. Unix编程之size_t、ssize_t

    http://blog.csdn.net/lalor/article/details/7426184 首先,我非常肯定以 及确定的告诉你ssize_t是有符号整型,在32位机器上等同与int,在64位 ...

  10. TCL语言笔记:TCL中的控制结构命令

    一.引言 控制结构允许程序根据不同的状态.条件和参数来选择不同的处理和执行路径,从而使代码具有更强的灵活性.健壮性和可读性. Tcl 提供了 if.if/else.if/elseif.foreach. ...