猜数字的大小游戏 C:\Users\Administrator>python Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >…
#Filename:game1.py guess=10 running=True while running: try: answer=int(raw_input('Guess what i think:')) except: print 'Please input interga\n' continue if answer<guess: print 'Your answer is too small\n' continue elif answer>guess: print 'Your ans…
这题打着高精的旗号其实是闹着玩的……(我不是题目) 数据范围就是提示你这题O(1)的 我们知道,一个数膜9的余数等于它数字和膜9的余数 我们可以把l到r加起来然后膜9 也就是(l+r)(r-l+1)/2%9 出现了除法所以我们把/2转化成逆元*5 就完了. #include<bits/stdc++.h> using namespace std; long long q,l,r; int main(){ cin>>q; while(q--){ cin>>l>>…
from random import randintnum = randint(0,100)print("Guess what I think:?")bingo = Falsewhile bingo == False: answer = int(input()) if answer < num: print("too small!") if answer > num: print("too big") if answer == num…
https://scut.online/p/289 一个水到飞起的模板数位dp. #include<bits/stdc++.h> using namespace std; typedef long long ll; bool notp[2000]; const int MAXS1=200; const int MAXS2=2000; int a[20]; ll dp[20][MAXS1][MAXS2]; ll dfs(int pos,int s1,int s2,bool lead,bool l…