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 ...
随机推荐
- sqlserver mdf ldf文件导入
EXEC sp_attach_db @dbname = '你的数据库名', @filename1 = 'mdf文件路径(包缀名)', @filename2 = 'Ldf文件路径(包缀名 ...
- SQL SERVER时间函数
本篇文章还是学习<程序员的SQL金典>内容的记录,此次将讲解的是SQL SERVER的时间函数. 本文只讲SQL SERVER支持的时间函数(其它数据库这里就不罗列了,想看更多的可以关注& ...
- memcached+memadmin
一.安装apache yum install httpd 二.安装php yum install php* 三.apache配置 vi /etc/httpd/conf/httpd.conf 添加Add ...
- [设计模式] 8 组合模式 Composite
DP书上给出的定义:将对象组合成树形结构以表示“部分-整体”的层次结构.组合使得用户对单个对象和组合对象的使用具有一致性.注意两个字“树形”.这种树形结构在现实生活中随处可见,比如一个集团公司,它有一 ...
- 【WCF--初入江湖】07 分布式事务
07 分布式事务 一.前言 [1]理解事务特性 [2]掌握TransactionFlow 特性 [3]掌握WCF中的事务属性 TransactionAutoCompleteOnSessionClose ...
- android音乐播放器开发教程
android音乐播放器开发教程 Android扫描sd卡和系统文件 Android 关于录音文件的编解码 实现米聊 微信一类的录音上传的功能 android操作sdcard中的多媒体文件——音乐列表 ...
- JDK8 学习
http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html
- APT攻击
http://netsecurity.51cto.com/art/201211/363040.htm
- Java 编译错误:缺少返回语句
示例: import java.util.*; import java.io.*; public class tt { public static void main(String[] args) { ...
- P1082 找朋友
描述 童年的我们,对各种事物充满了好奇与向往.这天,小朋友们对数字产生了兴趣,并且想和数字交朋友.可是,怎么分配这些数字才能使得每个小朋友都唯一地找到一个数字朋友呢?C小朋友说:咱们按自己名字的字典序 ...