模拟

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

  1. SGU 分类

    http://acm.sgu.ru/problemset.php?contest=0&volume=1 101 Domino 欧拉路 102 Coprime 枚举/数学方法 103 Traff ...

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

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

  4. Oracle12c Data Guard搭建手册

    Oracle12c Data Guard搭建手册 注:本文来源: 红黑联盟 < Oracle12c Data Guard搭建手册 > Oracle 12c 的DataGuard 是在CDB ...

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

  6. Oracle data guard学习

    Oracle data guard学习:三思笔记 Data guard 1data guard结构: data guard是一个集合,由一个primary数据库(生产数据库)和一个或多个standby ...

  7. Oracle data guard 10g 搭建

    Oracle data guard 10g 搭建 1系统常规参数检查 硬盘 [root@localhost ~]# df -h 内核 [root@localhost ~]# uname -a [roo ...

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

  9. Azure Data Factory(三)集成 Azure Devops 实现CI/CD

    一,引言 由于上一节文章内容过长,无法分享Azure Data Factory 的持续集成,持续发布.今天将着重介绍一下在使用 Azure DevOps Pipeline 发布,自动进行持续集成,并且 ...

随机推荐

  1. NDK的安装和下载

    从官网下载NDK 下载页面:https://developer.android.com/ndk/downloads/index.html 从镜像站点下载NDK "大师兄"是一个由腾 ...

  2. 2013.08.23.diary

    Today, my baby called me.She said, she want to go abroad . And she wants me to go abroad too. I thin ...

  3. Google邮箱:Gmail国际顶级邮箱

    本博文的主要内容有 .Google邮箱的介绍   1.Google邮箱的介绍 https://zh.wikipedia.org/wiki/Gmail http://mail/google.com/ h ...

  4. css开发经验&错误习惯

    CSS开发经验 1.尽量用class来定义样式.尽量少使用  .div1 ul li{}这样的样式下去,因为如果li里面还有<div><ul><li>这些元素的话会 ...

  5. 【Linux学习】Linux的文件权限(一)

    Linux操作系统是一个非常优秀的操作系统,同一时候也是一个多用户.多任务的操作系统.那么这就意味着会有非常多的人同一时候使用同一个操作系统的情况. 这时.对于一个用户来说,保护好自己的隐私权就成了一 ...

  6. Linq中Union与Contact方法用法对比

    文章一开始,我们来看看下面这个简单的实例. 代码片段1: int[] ints1 = { 2, 4, 9, 3, 0, 5, 1, 7 }; int[] ints2 = { 1, 3, 6, 4, 4 ...

  7. [React] React Fundamentals: Integrating Components with D3 and AngularJS

    Since React is only interested in the V (view) of MVC, it plays well with other toolkits and framewo ...

  8. Androidannotation使用之@Rest与server交互的JSON数据转换(二)

    开篇 之前的一篇博客:Androidannotation使用之@Rest获取资源及用户登录验证(一):http://blog.csdn.net/nupt123456789/article/detail ...

  9. Qt 学习之路 :文本文件读写

    上一章我们介绍了有关二进制文件的读写.二进制文件比较小巧,却不是人可读的格式.而文本文件是一种人可读的文件.为了操作这种文件,我们需要使用QTextStream类.QTextStream和QDataS ...

  10. [转] json in javascript

    JavaScript is a general purpose programming language that was introduced as the page scripting langu ...