![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vijos 题解
Greed216
If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime
展开
-
vijos P1134 算24点 题解
无转载 2016-01-28 20:03:42 · 4082 阅读 · 0 评论 -
vijos P1320 清点人数 题解
#include#includeint main(){int n,k,i,j,m,p,a[500100],sum;char f;scanf("%d%d",&n,&k);for (i=1;ia[i]=0;for (i=1;i{sum=0;// printf("1\n");scanf("%s",&f);if (f=='A'){scanf(原创 2016-01-28 20:08:13 · 671 阅读 · 0 评论 -
vijos P1597 2的幂次方 题解(递归)
#include#include#includeusing namespace std;void solve(int n);int main(){int n;// while(scanf("%d",&n)!=EOF)// {scanf("%d",&n);solve(n);printf("\n");// }return 0;转载 2016-01-28 20:06:28 · 289 阅读 · 0 评论 -
vijos P1131 最小公倍数和最大公约数问题 题解
#includeusing namespace std;int gcd(int a,int b){ if(a==0)return b; else return gcd(b%a,a);}int lcm(int a,int b){ return a*b/gcd(a,b);}int main(){ int j,i,a,b,ans=0,cnt=0,tt=0转载 2016-01-28 21:16:51 · 339 阅读 · 0 评论 -
vijos P1134 矩形覆盖 题解
#include #include #include #define MAX(a,b) ((a)>(b)?(a):(b))#define MIN(a,b) ((a)<(b)?(a):(b))typedef struct{ short isEmpty; int l, r, t, b; //left, right, top, bottom} RECT;typedef转载 2016-01-28 21:18:09 · 386 阅读 · 0 评论 -
vijos P1026毒药?解药?
#include #define STATUS 0#define STEP 1int table[120][10];short searched[1<<15];int queue[1<<15][2];int head, tail;void addToQueue(int status, int step){ if(!searched[status]){转载 2016-02-02 15:29:42 · 613 阅读 · 0 评论 -
vijos P1197 费解的开关 题解
#include #include #define STATUS 0#define STEP 1int queue[1000000][2];int answer[1<<25];int head = 0, tail = 0;void addToQueue(int status, int step){ queue[tail][STATUS] = status; qu转载 2016-02-03 13:08:53 · 1356 阅读 · 0 评论