摘要:
简单题View Code //zoj1713#include <iostream>#include <string>using namespace std;string st;bool syll(char a){ if (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'y') return true; return false;}bool judge(string a, int num){ i 阅读全文
摘要:
简单题View Code //zoj1712#include <iostream>#include <string>using namespace std;string st;void work(){ int i, l = st.length(), temp = 1, ans = 0; for (i = l - 1; i >= 0; i--) { temp *= 2; ans += (st[i] - '0') * (temp - 1); } cout << ans << endl;}int main(){ //... 阅读全文
摘要:
dfs,x的范围似乎不是100而是1000View Code //zoj1711#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;const int maxnum = 1001, maxn = 12;int t, n, sum[maxnum], number[maxn][2], answer[maxn], total;bool found;void init(){ int i, x; memset(sum, 0, 阅读全文
摘要:
简单题View Code //zoj1710//当蜗牛每天白天爬升的距离因疲劳值过多而减为负数时,认为爬升距离为0,不认为下降。#include <iostream>#include <cmath>using namespace std;int h, u, d, f,time1;double now, speed;void work(){ while (1) { now += speed; if (now > h) { cout << "success on day " << time1 << en... 阅读全文
摘要:
简单题bfsView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define maxn 105struct Point{ int x, y; Point() {} Point(int xx, int yy):x(xx), y(yy) {}};int n, m;bool grid[maxn][maxn];bool vis[maxn][maxn];int 阅读全文