摘要:
简单题#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 1000005char st[maxn];int len;bool ok(int a){ for (int i = a; i < len; i++) if (st[i] != st[i % a]) return false; return true;}int work(){ for (int i = 1; i <= len 阅读全文
摘要:
几何公式#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <cmath>using namespace std;#define pi acos(-1)int D, V;int main(){ while (scanf("%d%d", &D, &V), D | V) { printf("%.3f\n", pow(D * D * D - 6 * V / pi, 1.0 / 阅读全文
摘要:
题意:n<=10000,并保证存在n的某个倍数的十进制表示形式各个数位都为1。问这个数是n的多少倍。分析:我们枚举1,11,111……直到找到能被n整除的为止。为了防止这个1序列过大,我们不断将其对n取余,这样可以保证其一直在int范围内,并且不影响整除性。#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;int n;int main(){ while (scanf("%d", & 阅读全文