洛谷2019 3月月赛 T1

2019第一次月赛 我只有255pts T1还是比较水的。。。 海星 T1一道简单的模拟(就是有坑。。导致很多人不能一次性AC 比如说我)
_3个坑点
1.位数问题

2.-0

3.0...

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
inline LL read () { LL res = ;int f () ;char ch = getchar ();
while (!isdigit(ch)) { if (ch == '-') f = - ;ch = getchar();}
while (isdigit(ch)) res = (res << ) + (res << ) + (ch ^ ) ,ch = getchar(); return res * f ;
}
LL l,r,t;
inline void print(__int128 x) {
if(x<) putchar('-'),x*=-;
if(x>) print(x/); putchar(x%+);
}
inline bool pd(string s) { __int128 x=; register int f=,tot=-; register char ch=;
while(!isdigit(ch))f|=(ch=='-'),ch=s[++tot];
while(tot<=s.length() and isdigit(ch)) {
x=(x<<)+(x<<)+(ch^); if(f) { if(x*->r or x*-<l) return true;
} else if(x>r or x<l) return true;
ch=s[++tot];
}
return false;
}
signed main() {
l=read(),r=read(),t=read();
while(t--) {
string s; getline(cin,s);
bool flag1=,flag2=;
if(s=="-") flag1=;
if(s[]=='-' and s[]=='') flag1=;
if(s[]=='' and s.length()>) flag1=;
if(flag1) { puts(""); continue; } flag2=pd(s);
if(flag2) { puts(""); continue; }
puts("");
}
return ;
}
洛谷2019 3月月赛 T1的更多相关文章
- 洛谷2019 3月月赛 T2
题干 洛谷同款 T2?(看似比T1简单些) 二维前缀和嘛?[多简单 我天天拿二维前缀和水DP] 这是前缀和的预处理 2333 处理出来所有的情况 某个地方要加上mod再%mod 如果没有这一步 那么 ...
- 洛谷2019 3月月赛 T4
T3做不来.. 直接滚去T4 orz 乍一看 T4是个DP 题干 复杂度??(N^4) 咋优化... 还带一只捆绑 捆绑啥的最烦人了 最后20pts 直接废了 T了 很烦 不过拿到80pts已经很开心 ...
- 洛谷2019 3月月赛 T3
题干 唯一AC T3 的大巨佬%%% 这题就是个大模拟吧. 题解
- 洛谷P3862 8月月赛B
https://www.luogu.org/problemnew/show/P3862#sub P3862 8月月赛B 推公式:f(n)->f(n+1) 奇葩的预处理 https://www.l ...
- 洛谷2017 5月月赛R1
我只想说面对这种难度的题目就是冲着20%的数据暴力... 分数:40+20+36.1+38+0+19 T1 签到题 III 题目背景 pj组选手zzq近日学会了求最大公约数的辗转相除法. 题目描述 类 ...
- 【贪心】洛谷2019 OI春令营 - 普及组 作业
[P3817 小A的糖果 小A有N个糖果盒,第i个盒中有a[i]颗糖果. 小A每次可以从其中一盒糖果中吃掉一颗,他想知道,要让任意两个相邻的盒子中加起来都只有x颗或以下的糖果,至少得吃掉几颗糖. [贪 ...
- 洛谷 First Step (ファーストステップ) 3月月赛T1
题目背景 知らないことばかりなにもかもが(どうしたらいいの?) 一切的一切 尽是充满了未知数(该如何是好) それでも期待で足が軽いよ(ジャンプだ!) 但我仍因满怀期待而步伐轻盈(起跳吧!) 温度差なん ...
- 洛谷noip 模拟赛 day1 T1
T7925 剪纸 题目描述 小芳有一张nnn*mmm的长方形纸片.每次小芳将会从这个纸片里面剪去一个最大的正方形纸片,直到全部剪完(剩下一个正方形)为止. 小芳总共能得到多少片正方形纸片? 输入输出格 ...
- 【洛谷2019 OI春令营】期中考试
T68402 扫雷 题目链接:传送门 题目描述 扫雷,是一款单人的计算机游戏.游戏目标是找出所有没有地雷的方格,完成游戏:要是按了有地雷的方格,游戏失败.现在 Bob 正在玩扫雷游戏,你作为裁判要判断 ...
随机推荐
- UVA 10652 凸包问题
#include <cstdio> #include <cstring> #include <algorithm> #include <cmath> # ...
- hdu 1075
#include<stdio.h> #include<string.h> #include<string> #include<iostream> #in ...
- 如何爬取可用的IP代理
上一篇说到对付反爬虫有一个很关键的方法就是使用IP代理,那么我们应该如何获取这些可用的IP代理呢?这里分享一下自己这两天的一些爬取IP代理的心得体会. 1 步骤 1.找到几个提供免费IP代理的网站,获 ...
- transaction transaction transaction 最大费用最大流转化到SPFA最长路
//当时比赛的时候没有想到可以用SPFA做,TLE! Problem Description Kelukin is a businessman. Every day, he travels aroun ...
- [bzoj2453]维护队列_带修改莫队
维护队列 bzoj-2453 题目大意:给定一个n个数序列,支持查询区间数的种类数,单点修改.不强制在线. 注释:$1\le n,m\le 10^5$. 想法: 带修改莫队裸题. 如果没有修改操作的话 ...
- 洛谷——P1164 小A点菜
P1164 小A点菜 题目背景 uim神犇拿到了uoi的ra(镭牌)后,立刻拉着基友小A到了一家……餐馆,很低端的那种. uim指着墙上的价目表(太低级了没有菜单),说:“随便点”. 题目描述 不过u ...
- 011 router backup
Router>en Router#config t Enter configuration commands, one per line. End with CNTL/Z. Router(co ...
- Symantec Backup Exec部署手册
转载 http://xiaxiaoguo.blog.51cto.com/858884/402810 Symantec Backup Exec部署手册 目录 1.Backup Exec 12.5安装. ...
- [Jest] Automate your migration to Jest using codemods
Jest is a fantastic testing library, but maybe you've been putting off the switch because migrating ...
- [AngularJS 1.6] ngModelOptions and inheritance
Problem with ngModleOptions before 1.6: <input type="text" name="fullname" ng ...