![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
小技巧
宋辰轩
这个作者很懒,什么都没留下…
展开
-
Two Switches 题解
1.题目 Alice and Bob are controlling a robot. They each have one switch that controls the robot. Alice started holding down her button A second after the start-up of the robot, and released her button B...原创 2019-03-26 22:45:59 · 276 阅读 · 0 评论 -
如何连续输入字符串
代码模板如下 连续输入可以含空格的字符串 #include<bits/stdc++.h> using namespace std; int main() { string a; while(getline(cin,a)) { cout<<a<<endl; } return 0; } 输入不带空格的 #inc...原创 2019-05-06 11:10:04 · 4435 阅读 · 0 评论 -
约分
#include<iostream> #include<bits/stdc++.h> using namespace std; void reduction_of_a_fraction(int a,int b) { int n; for(int i=1;i<=(a>b?b:a);i++) { if(a%i== 0&...原创 2019-08-13 16:36:22 · 263 阅读 · 1 评论 -
a^b%p快速幂
今天来复习下快速幂算法 #include <iostream> #include<stdio.h> using namespace std; typedef long long ll; int qpow(ll k,ll n,ll p) { ll res=1; while(n>0) { if(n&1) { ...原创 2019-08-07 08:57:20 · 142 阅读 · 0 评论 -
Acm各种运算符归纳
因读者总是搞混一些运算符的功能,所以在此归纳一下 异或运算符^ 规则:两个参与运算的数,若为异(两数不同),则为1,两数相同则为0(二进制) 例: 1^ 1=0 ,0^ 0=0, 0^ 1=1 用途:翻转特定位数 例:X=70(1000110)Y=7(0000111) Y可以把X的后三位翻转 X^Y=65(1000001) 按位与运算符& 其规则为:若两位同时为1,则为1,否则为...原创 2019-08-07 09:24:42 · 237 阅读 · 0 评论