poj3629
//(队列)poj3629
/*
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std; #define MAXN 100005
int ans[MAXN];
int main(int argc, char *argv[])
{
long N,K,M,P;
long i,j,count;
count=0;
queue<long>q;
cin>>N>>K>>P;
for(i=1;i<=K;i++) q.push(i);
while(!q.empty()){
for(i=1;i<=N;i++){
//cout<<"??";
if(i==N) {ans[count++]=q.front();}
q.pop();
for(j=1;j<=P;j++){
q.push(q.front());
q.pop();
}
} }
sort(ans,ans+count);
for(i=0;i<count;i++) cout<<ans[i]<<endl; return 0;
}
//*/
poj3629的更多相关文章
- POJ-3629
Card Stacking Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3927 Accepted: 1541 Des ...
- POJ-3629 模拟
A - Card Stacking Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u S ...
随机推荐
- Gson解析纯Json数组
[ { "type": "123", "value": 123 }, { "type": "234" ...
- 在js中获取在css中设置的background-image值
1. html部分 <div class="bg-color-two" id="bg_color_two" onclick="setBg(thi ...
- 解决 odoo.py: error: option --addons-path: The addons-path 'local-addons/' does not seem to a be a valid Addons Directory!
情况说明 odoo源文件路径-/odoo-dev/odoo/: 我的模块插件路径 ~/odoo-dev/local-addons/my-module 在my-module中创建了__init__.py ...
- lvs+keepalived
一.简介 VS/NAT原理图: 二.系统环境 实验拓扑: 系统平台:CentOS 6.3 Kernel:2.6.32-279.el6.i686 LVS版本:ipvsadm-1.26 keepalive ...
- 【转】PHP的Trait 特性
Trait是在PHP5.4中加入的,它既不是接口也不是类.主要是为了解决单继承语言的限制.是PHP多重继承的一种解决方案.例如,需要同时继承两个 Abstract Class, 这将会是件很麻烦的事情 ...
- IT 网址
蒋金楠 (Artech) WCF ,asp.net等 博客地址:http://www.cnblogs.com/artech/tag/WCF/ 伍华聪 ...
- Jquery判断变量是否为空
var aaa=''; if(aaa) { //aaa不为空也不是不可识别对象时执行 } else { //aaa为空或不可识别时执行 } aaa必须是变量,对象的属性好像是不行,
- postgresql数据库
新建一个虚拟机,在本地跑程序,连虚拟机数据库报错: no pg_hba.conf entry for host "192.168.1.4" Google下,发现是要修改postgr ...
- Beginning Scala study note(3) Object Orientation in Scala
1. The three principles of OOP are encapsulation(封装性), inheritance(继承性) and polymorphism(多态性). examp ...
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
有时候,当我们使用"mysql"."mysqladmin"."mysqldump"等命令管理数据库时,服务器抛出类似如下错误: 一.错误现场 ...