//(队列)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的更多相关文章

  1. POJ-3629

    Card Stacking Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3927   Accepted: 1541 Des ...

  2. POJ-3629 模拟

    A - Card Stacking Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u S ...

随机推荐

  1. navicat 破解

    首先上官网上下载LINUX版本: http://www.navicat.com/download 下载 navicat110_mysql_en.tar.gz 文件 下载后解压tar文件 tar -zx ...

  2. CString转换为string

    string CStringToString(CString strMFC) { CStringA strA; strA = strMFC.GetBuffer(); strMFC.ReleaseBuf ...

  3. java中readLine()方法为什么有的行读不到?

    今天在使用java对IO操作时,readLine()输出到控制台的行少了很多.后来发现readLine()实际上是一次读取一行.如果我们不话readLine()读取的行内容赋给一个字符串的话,每直接调 ...

  4. MySql导出数据到csv

    通过mysql客户端shell连接到服务器,选择使用的数据库,输入sql代码: select * from test_info into outfile '/tmp/test.csv' fields ...

  5. spring加载过程,源码带你理解从初始化到bean注入

    spring在容器启动时,容器正式初始化入口refresh()如下图 ①包括初始化FactoryBean.解析XML注册所有BeanDefinition信息  ②包括注册scope管理类  ③初始化单 ...

  6. CENTOS7 mysql 安装

    CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1. 下载mysql的repo源 $ wget http://repo.mysql.com ...

  7. POCO库——Foundation组件之核心Core

    核心Core: Version.h:版本控制信息,宏POCO_VERSION,值格式采用0xAABBCCDD,分别代表主版本.次版本.补丁版本.预发布版本: Poco.h:简单地包含了头文件Found ...

  8. Mac下没有权限启动tomcat的解决办法

    问题描述 在Mac中通过./startup.sh执行启动脚本文件,启动tomcat时报如下错误: -bash: ./startup.sh: Permission denied 解决方法 错误信息说明了 ...

  9. OpenCV 人脸识别 C++实例代码

    #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include & ...

  10. 调整Kali Linux的锁屏时间

    调整Kali Linux的锁屏时间   锁屏是保护隐私的一种重要机制.当用户不操作电脑一段时间后,系统会进入锁屏状态.用户需要输入口令,才能重新进入系统.避免因为操作人员离开电脑后,被其他人员利用现有 ...