A (By ggg):

 

题意:一个人还有x秒到红绿灯,这个红绿灯有g秒绿灯,y秒黄
灯,r秒红灯,问你到红绿灯的时候是什么灯。值得注意的是绿
灯变黄灯时,第g秒是黄灯了。

  

  

B (By Anxdada):

Gym - 100947B

C(By Kresnt):

显然,当 n 时偶数的时候,只有 2 种取法(取下标为奇数的,或是取下标为偶数的)

当 n 为奇数时,按照隔一取一的方式遍历序列
Seq A:1 5 3 2 4
遍历为 Seq B:1 3 4 5 2 然后问题就变成了从 *B* 序列中取 *连续的* n/2+n&1 个数 开一个前缀和sum[] 就解决啦

  

D (By ggg) :

  

题意:给你一个n,要你输出三个数,相互给予后都能成为n,每次给予的数的大小是被给予的数的大小。数学思维题,直接贴代码感受

void solve() {
int n; scanf("%d", &n);
if (n%8!=0) puts("Impossible");
else {
printf("%d %d %d\n", n/8*11, n/8*7, n/8*6);
} }
int main() {
int t = 1;
scanf("%d", &t);
while(t--)
solve();
return 0;
}

  

E(By):

F(By pipixia):

Gym - 100947F

G(By Cyril1317):

Gym - 100947G Square Spiral Search

H(By Cyril1317):

Gym - 100947H Phobia

I(By xgg):

gym 100947I (求因子)

J(By):

K(By Kresnt):

这是一道模拟题

(0,0)

–> 右移

{

–> 向左下角移

–> 到边界,

1)左边界的话向下

2) 下边界的话向右

–> 向右上移

}

summarize 一下,发现 “{” “}”内的是重复的,故写成循环就好了

然后发现第一步右移到了右上角是有问题的,就改成

1)在上边界的话右移

2)在右边界的话下移

以

  

while(true){
ans.push_back(mp[x][y]);
if(y < n-1) y++;
else x++; while(y > 0 && x < n-1)
ans.push_back(mp[x++][y--]);
ans.push_back(mp[x][y]); if(x < n-1) x++;
else y++; while(y < n-1 && x > 0)
ans.push_back(mp[x--][y++]); if(x == n-1 && y == n-1) break;
}

  

2015 AlBaath Collegiate Programming Contest(2月14日训练赛)的更多相关文章

  1. 2015 AlBaath Collegiate Programming Contest B

    Description Yaaaay, Haven't you heard the news? Bakaloria results are out! And Reem had very good gr ...

  2. 2015 AlBaath Collegiate Programming Contest A

    Description Tamer is traveling with his brother on a long highway. He sees a traffic light at a dist ...

  3. The 2015 China Collegiate Programming Contest A. Secrete Master Plan hdu5540

    Secrete Master Plan Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Othe ...

  4. The 2015 China Collegiate Programming Contest Game Rooms

    Game Rooms Time Limit: 4000/4000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submi ...

  5. 2015 German Collegiate Programming Contest (GCPC 15) + POI 10-T3(12/13)

    $$2015\ German\ Collegiate\ Programming\ Contest\ (GCPC 15) + POI 10-T3$$ \(A.\ Journey\ to\ Greece\ ...

  6. Gym 100952E&&2015 HIAST Collegiate Programming Contest E. Arrange Teams【DFS+剪枝】

    E. Arrange Teams time limit per test:2 seconds memory limit per test:64 megabytes input:standard inp ...

  7. Gym 100952F&&2015 HIAST Collegiate Programming Contest F. Contestants Ranking【BFS+STL乱搞(map+vector)+优先队列】

    F. Contestants Ranking time limit per test:1 second memory limit per test:24 megabytes input:standar ...

  8. Gym 100952A&&2015 HIAST Collegiate Programming Contest A. Who is the winner?【字符串,暴力】

    A. Who is the winner? time limit per test:1 second memory limit per test:64 megabytes input:standard ...

  9. Codeforces Gym100952 A.Who is the winner? (2015 HIAST Collegiate Programming Contest)

      A. Who is the winner?   time limit per test 1 second memory limit per test 64 megabytes input stan ...

随机推荐

  1. SPOJ:Lost and survived(multiset+并查集)

    On September 22, 2004, Oceanic Flight 815 crashed on a mysterious island somewhere in the pacific. T ...

  2. 高性能框架gevent和gunicorn在web上的应用及性能测试

    WSGI Server有哪些: 比如 Flask,webpy,Django.CherryPy 都带着 WSGI server .当然性能都不好,自带的web server 更多的是测试用途, 发布时则 ...

  3. 用 SDL2 进行事件驱动编程

    其实没必要说得太复杂...就是读取用户输入啦. 沿用上一篇的代码,加入事件轮询. 环境:SDL2 + VC++2015 下面的代码将打开background.png和event.png,将backgr ...

  4. windows下安装RabbitMQ消息服务器 + 读写队列

    RabbitMQ是什么 ? RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.他遵循Mozilla Public License开源协议. 1:安装RabbitMQ需要先安装Erla ...

  5. UI控件初始化问题:initWithFrame和initWithCoder、aweakFromNib的执行

    在iOS学习和程序开发过程中,我们经常会遇到一些自定义UI控件或控制器在初始化时出现问题,尤其在大家刚开始接触时,几种初始化方法的作用以及调用的时机往往容易混淆,这也跟我们对iOS程序设计中,类的创建 ...

  6. ASP.NET Core MVC 2.x 全面教程_ASP.NET Core MVC 15. 用户管理

    源码的github的地址 https://github.com/solenovex/ASP.NET-Core-MVC-Tutorial-Code 语雀上的人的地址: https://github.co ...

  7. 任务24:WebHost的配置

    24 任务24:WebHost的配置 创建HelloCore的项目 我们新建一个空的mvc项目 我们在这里调用COnfigureAppConfiguration方法更改默认的配置.为读取setting ...

  8. Codeforces - 702A - Maximum Increase - 简单dp

    DP的学习计划,刷 https://codeforces.com/problemset?order=BY_RATING_ASC&tags=dp 遇到了这道题 https://codeforce ...

  9. bzoj 2626: JZPFAR【KD-tree】

    和3053差不多,把pair first做成负数就可以用大根堆维护了 注意:要开long long:比较的时候因为编号也占权重所以要比较pair:编号不是mid!不是mid!是初始输入的那个编号!搞混 ...

  10. Codeforces731D 80-th Level Archeology

    考虑将两个单词变成有序,我们可以得到一个或者两个旋转次数的区间. 然后考虑将两组单词变成有序,比如[l,mid]和[mid+1,r],对于mid和mid+1这两个单词我们可以求出使他们有序的旋转次数的 ...