題目大意:
報數遊戲,不能報7的倍數和2進製下含有111的數。
給定n,m(1<=n,m<=20)表示起始位和總人數。報到255為止。能報輸出二進位制,否則"pass"。
題目思路:
【模擬】
暴力模擬即可。十進位制轉二進位制。
////by cool***
//#include#include#include#include#include#include#include#include#include//#include#include#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(a) ((a)>0?(a):(-(a)))
#define lowbit(a) (a&(-a))
#define sqr(a) ((a)*(a))
#define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
#define eps (1e-8)
#define j 10000000
#define max 0x7f7f7f7f
#define pi 3.1415926535897
#define n 256
using namespace std;
typedef long long ll;
int cas,cass;
int n,m,lll,ans;
string ss;
void change(int x)
}int main()
{ #ifndef online_judge
// freopen("1.txt","r",stdin);
// freopen("2.txt","w",stdout);
#endif
int i,j,k;
// for(scanf("%d",&cas);cas;cas--)
// for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
// while(~scanf("%s",s))
while(~scanf("%d",&n))
{ scanf("%d",&m);
for(i=n;i
迴圈數 (細節,模擬)
題目描述 迴圈數是那些不包括0這個數字的沒有重複數字的整數 比如說,81362 並且同時具有乙個有趣的性質,就像這個例子 如果你從最左邊的數字開始 在這個例子中是8 數最左邊這個數字個數字到右邊 回到最左邊如果數到了最右邊 你會停止在另乙個新的數字 如果沒有停在乙個不同的數字上,這個數就不是迴圈數 ...
son server模擬http mock資料
前端開發中,想通過非同步請求服務端json資料,但是服務端還沒有開發完,此時可以快速啟動乙個server服務 1,安裝json server外掛程式 npm g add json server 2,建立乙個json檔案 test.json comments profile 3,啟動server服務 ...
高數 高數B模擬試卷
高數b 模擬試卷 一 選擇題 滿分20分 本大題共有5個小題,每小題4分,在每小題給出的四個選型中,只有一項符合題目要求,把所選項前的字母填在題目後的括號內.1.設 f x x0 sintdt 則f f 2 a.1b.1c.cos1d.1 cos1.2.limx 0x2sin1x sinx a.1b...