SGU 188.Factory guard
模拟
code
- #include <iostream>
- #include <cstdio>
- #define LEN 1000
- using namespace std;
- int n, t;
- int pos[], last[], v[];
- int ans[];
- int main()
- {
- cin >> n >> t;
- for (int i = ; i <= n; ++i) cin >> pos[i];
- for (int i = ; i <= n; ++i) cin >> v[i];
- for (int time = ; time <= t; ++time)
- {
- for (int i = ; i <= n; ++i)
- last[i] = pos[i], pos[i] += v[i];
- for (int i = ; i <= n; ++i)
- for (int j = ; j <= n; ++j)
- if ( v[i] > && v[j] < )
- {
- if (last[j] > last[i] && pos[i] >= pos[j])
- ++ans[i], ++ans[j];
- else if (last[j] < last[i] && pos[i] - LEN >= pos[j])
- ++ans[i], ++ans[j];
- }
- for (int i = ; i <= n; ++i)
- {
- while (pos[i] < ) pos[i] += LEN;
- while (pos[i] >= LEN) pos[i] -= LEN;
- }
- }
- for (int i = ; i <= n; ++i)
- cout << ans[i] << ' ';
- return ;
- }
SGU 188.Factory guard的更多相关文章
- SGU 分类
http://acm.sgu.ru/problemset.php?contest=0&volume=1 101 Domino 欧拉路 102 Coprime 枚举/数学方法 103 Traff ...
- org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/lonecloud/tomcat/apache-tomcat-7.0.70 2/webapps/myproject/WEB-INF/classes/cn/lone
解决这个报错的解决办法: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidat ...
- Spring错误之org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'bookService' is expected to be of type 'pw.fengya.tx.BookService' but was actually of type 'com.sun.proxy.$Proxy1
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cas ...
- Oracle12c Data Guard搭建手册
Oracle12c Data Guard搭建手册 注:本文来源: 红黑联盟 < Oracle12c Data Guard搭建手册 > Oracle 12c 的DataGuard 是在CDB ...
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource
二月 20, 2017 3:09:47 下午 org.apache.catalina.startup.SetAllPropertiesRule begin警告: [SetAllPropertiesRu ...
- Oracle data guard学习
Oracle data guard学习:三思笔记 Data guard 1data guard结构: data guard是一个集合,由一个primary数据库(生产数据库)和一个或多个standby ...
- Oracle data guard 10g 搭建
Oracle data guard 10g 搭建 1系统常规参数检查 硬盘 [root@localhost ~]# df -h 内核 [root@localhost ~]# uname -a [roo ...
- Log4j2 - Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFileAppender for element RollingFile
问题与分析 在使用Log4j2时,虽然可以正确读取配置文件并生成log文件,但偶然发现控制台打印了异常信息如下: 2018-12-31 17:28:14,282 Log4j2-TF-19-Config ...
- Azure Data Factory(三)集成 Azure Devops 实现CI/CD
一,引言 由于上一节文章内容过长,无法分享Azure Data Factory 的持续集成,持续发布.今天将着重介绍一下在使用 Azure DevOps Pipeline 发布,自动进行持续集成,并且 ...
随机推荐
- poj 2960 S-Nim(SG函数)
S-Nim Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 3694 Accepted: 1936 Description ...
- 基于curl 的zabbix API调用
1,认证并取得加密字段 curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0&q ...
- 常用的MySQL图形化管理软件
本博文的主要内容有 .SQLyog软件的安装.下载和使用 .Navicat for MySQL软件的安装.下载和使用 1.SQLyog软件的安装.下载和使用 2.Navicat for MySQL软件 ...
- Kafka中错误:Unrecognized VM option ‘UseCompressedOops’ Error: Clould not create the Java Vritual Machine. Error: A fatal exception has occurres . Program will exit.
错误的描述: 在kafka安装目录下,执行 $ bin/zookeeper-server-start.sh config/zookeeper.properties & Unrecognized ...
- JavaEE学习笔记---数据库操作篇
测试JDBC和SQLServer的插入操作,源码如下: import java.sql.Connection;import java.sql.DriverManager;import java.sql ...
- IE的Cookie目录和临时缓存目录的关系
1.IE的Cookie位置注册表设置: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folde ...
- 推荐一个网站——聚合了微软的文件的Knowledge Base下载地址
Microsoft Files是一个微软的文件数据库,从这里可以很方便的找到各个文件版本对应的下载链接. 比如今天debug需要找一个特定版本的sos.dll,从这个网站就很方便的给出了这个sos.d ...
- 【Android - 框架】之Glide的使用
一.Glide简介: Glide是Google官方推荐的一个图片加载和缓存的开源库,它不仅能实现平滑的图片列表滚动效果,还支持远程图片的获取.大小调整和展示,并且可以加载GIF图片.Glide相比与U ...
- JS时钟钟表
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> ...
- cocos2d-x3.0 ListView
.h #include "cocos2d.h" #include "cocos-ext.h" #include "ui/CocosGUI.h" ...