摘要:
1 #include<iostream> 2 #include<queue> 3 #define MAXV 100000 4 using namespace std; 5 int sign[100001],len[100001]; //sign是用来做标记的,len用来走到重点需步长 6 int main() 7 { 8 int N, K, y; 9 cin >> N >> K;10 queue<int>Q;11 Q.push(N);12 len[N] = 0;13 while(!Q.empty())14 {15 ... 阅读全文
摘要:
1 #include<stdio.h> 2 3 int main() 4 { 5 int i, ncases; 6 int n; 7 8 while(scanf("%d", &ncases) != EOF) 9 {10 while(ncases--)11 {12 scanf("%d", &n);13 i = 0;14 while( n != 0)15 {16 if(n%2 == 1)17 ... 阅读全文