T-Shirt Hunt

思路:

  水题;

代码:

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm> using namespace std; int p,x,y,ai[],ans; bool check(int xx)
{
if(xx<y) return false;
int i=(xx/)%;
for(int j=;j<=;j++)
{
i=(i*+)%;
if(p==+i) return true;
}
return false;
} int main()
{
scanf("%d%d%d",&p,&x,&y);
int pos=x;
while(pos>=y)
{
if(check(pos))
{
printf("");
return ;
}
pos-=;
}
while(x<y) x+=,ans++;
while()
{
if(check(x)||check(x-))
{
printf("%d",ans);
return ;
}
x+=,ans++;
}
return ;
}

AC日记——T-Shirt Hunt codeforces 807b的更多相关文章

  1. AC日记——Dynamic Problem Scoring codeforces 807d

    Dynamic Problem Scoring 思路: 水题: 代码: #include <cstdio> #include <cstring> #include <io ...

  2. AC日记——Sign on Fence Codeforces 484e

    E. Sign on Fence time limit per test 4 seconds memory limit per test 256 megabytes input standard in ...

  3. AC日记——Sagheer, the Hausmeister codeforces 812b

    812B - Sagheer, the Hausmeister 思路: 搜索: 代码: #include <cstdio> #include <cstring> #includ ...

  4. AC日记——Sagheer and Crossroads codeforces 812a

    812A - Sagheer and Crossroads 思路: 模拟: 代码: #include <cstdio> #include <cstring> #include ...

  5. AC日记——Is it rated? codeforces 807a

    Is it rated? 思路: 水题: 代码: #include <cstdio> #include <cstring> using namespace std; ],b[] ...

  6. Ac日记——Distances to Zero codeforces 803b

    803B - Distances to Zero 思路: 水题: 代码: #include <cstdio> #include <cstring> #include <i ...

  7. AC日记——Mice and Holes codeforces 797f

    797F - Mice and Holes 思路: XXYXX: 代码: #include <cmath> #include <cstdio> #include <cst ...

  8. AC日记——Roma and Poker codeforces 803e

    803E - Roma and Poker 思路: 赢或输或者平的序列: 赢和平的差的绝对值不得超过k: 结束时差的绝对值必须为k: 当“?”时可以自己决定为什么状态: 输出最终序列或者NO: dp( ...

  9. AC日记——Periodic RMQ Problem codeforces 803G

    G - Periodic RMQ Problem 思路: 题目给一段序列,然后序列复制很多次: 维护序列很多次后的性质: 线段树动态开点: 来,上代码: #include <cstdio> ...

随机推荐

  1. ArcGis融合小多边形到相邻多边形

     在有的时候,我们的数据中可能会有许多细小的图斑,这些并不是我们想要的,需要将它们合并到周围的图斑中,如果一个一个手动合并,那工作量之大简直不敢想象.现在借助ArcGIS的Eliminate工具可 ...

  2. 【SVN】SVN服务器的本地搭建和使用

    Subversion是优秀的版本控制工具,其具体的的优点和详细介绍,这里就不再多说. 首先来下载和搭建SVN服务器. 现在Subversion已经迁移到apache网站上了,下载地址: http:// ...

  3. windows curl 命令

    windows 64 curl 命令的使用 https://blog.csdn.net/qq_27093465/article/details/53545693 curl命令可以通过命令行的方式,执行 ...

  4. [洛谷P2626]斐波那契数列(升级版)

    题目大意:请你求出第$n$个斐波那契数列的数$mod 2^{31}$之后的值.并把它分解质因数. 题解:乱搞 卡点:1.忘记取模 C++ Code: #include<cstdio> #i ...

  5. HDU.2095(异或运算)

    find your present (2) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...

  6. [链接] Linux下常见的~/.bashrc、/etc/profile、/etc/ld.so.config小科普以及caffe编译遇到的相关问题解决

    由于博主设置禁止转载,这里贴一个链接,http://blog.csdn.net/u014266895/article/details/61928602,内容很有用,linux下很多软件问题都是各种路径 ...

  7. [Usaco2005 Dec]Cleaning Shifts 清理牛棚 (DP优化/线段树)

    [Usaco2005 Dec] Cleaning Shifts 清理牛棚 题目描述 Farmer John's cows, pampered since birth, have reached new ...

  8. async的用法

    package com.example.administrator.myapplication; import android.os.AsyncTask; import android.util.Lo ...

  9. bzoj 3720 Gty的妹子树 树分块?瞎搞

    Gty的妹子树 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 2149  Solved: 781[Submit][Status][Discuss] D ...

  10. Linux Top 命令参数解析

    转载自:http://www.jb51.net/LINUXjishu/34604.html TOP是一个动态显示过程,即可以通过用户按键来不断刷新当前状态.如果在前台执行该命令,它将独占前台,直到用户 ...