九度OJ
Allianzcortex
这个作者很懒,什么都没留下…
展开
-
九度-北航-1163-素数
传送门:http://ac.jobdu.com/problem.php?pid=1163思路:分类判断。是否为素数是一个部分,是否个位为1是一个部分。 第一次WA是因为没有注意到输出的不包括原来的数。sigh~ 还可以优化的地方是在index和number这里,但没有太大的必要,这道题给的数据还是太小了。AC代码:#include#include#includeus原创 2015-03-19 20:56:16 · 644 阅读 · 0 评论 -
ccf_窗口
这道题是第二道,难度肯定不大,但自己一开始思路就走偏了,一直想用vector来模拟,但迭代器实现起来总是麻烦。最后用数组,A掉。主要注意从后开始遍历,并且被点亮的窗口会被直接放在数组最后一位上。AC代码:#include#include#include#includeusing namespace std;const int maxn=1000;struct Node原创 2015-03-26 20:28:04 · 1551 阅读 · 0 评论 -
九度OJ_北邮_1117_字符串
#include#include#includeusing namespace std;const int maxn=1000;int main(void){ int n,m; int i,j,k,len; string s1,s2; while(cin>>s1) { cin>>s2; i=s2[1]-'0';原创 2015-03-26 21:34:19 · 779 阅读 · 0 评论 -
九度-北邮-1473-二进制
传送门:http://ac.jobdu.com/problem.php?pid=1473思路:按照求二进制数的原理进行模拟AC代码:#include#include#include#include#include#include#includeusing namespace std;const int maxn=1000;int num[maxn];原创 2015-03-22 10:29:31 · 664 阅读 · 0 评论