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. DataView RowFilter Syntax [C#]

    RowFilter语法 private void btnEnquiry_Click(object sender, EventArgs e) { string filterExpression = st ...

  2. SQL Server 部署CLR程序集错误`6218`

    Visual Studio 2015中开发的SQL Server项目,添加了用户自定义函数,需要部署到SQL Server 2005上, 在部署时报错: (70,1): SQL72014: .Net ...

  3. capacilitys 持续集成

    目前看好像是说以docker为例来看看这个权限到底是怎么来的? 可以通过在二进制上setcap得到,也可以通过函数自己用setcap得到,两种方法,docker肯定是第二种方法啊,docker中间肯定 ...

  4. 批处理之FOR命令

  5. 'com.alibaba.fastjson.support.spring.FastJsonpResponseBodyAdvice' is。。。。

    com.alibaba.fastjson版本1.2.43版本在通过xml方式配置spring的时候会出现这个个奇怪的问题: Class 'com.alibaba.fastjson.support.sp ...

  6. hdu 2838 Cow Sorting (树状数组)

    Cow Sorting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  7. clique 解题报告

    clique 题目描述 数轴上有 \(n\) 个点,第 \(i\) 个点的坐标为 \(x_i\),权值为 \(w_i\).两个点 \(i\),\(j\) 之间存在一条边当且仅当 \(abs(x_i-x ...

  8. 【NOIP模拟赛】chess 建图+spfa统计方案数

    似乎弗洛伊德和迪杰斯特拉都干不了统计方案数,spfa的话就是不断入队就好. #include <cstdio> #include <cstring> #include < ...

  9. MySQL DELAY_KEY_WRITE Option

    delay_key_write   This option applies only to MyISAM tables. It can have one of the following values ...

  10. HDU 多校对抗赛 D Distinct Values

    Distinct Values Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)T ...