问题描述 PAT上的一道水题,网上提交总是提示运行超时 以下是我的代码: #include int main(void) { char ch; int count[10]; for (int i = 0; i < 10; i++) { count[i] = 0; } while ((ch = getchar()) != 'n') count[ch - '0']++; for (int i = 0; i < 10; i++) if (count[i] != 0) printf("%d:
本以为是道中国剩余定理的题 结果是一道水题啊 题意就是求最小公倍数然后减去a就可以了 #include <iostream> #include<cstdio> #include<cstring> using namespace std; long long gcd(long long a,long long b) { return b==0?a:gcd(b,a%b); } int main() { long long i,a,m,ans; while(cin>&g
问题描述 一道acm水题 all in all 一直找不出错误 求大神解答 描述字符串s和t均由字母组成,若在t中除去一些字母能够得到s,我们就说s是t的一个子串.比如abc就是acbefc的子串(acbefc去掉第二.第四.第五个字符后就得到abc)输入有若干组输入数据,每组一行,分别为字符串s和t,s与t之间用空格隔开输出对于一组s与t,若s是t的子串,则输出Yes,否则输出No 样例输入sequence subsequence abc acb VERDI vivaVittorioEmanu