摘要: There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible by 3.InputInput contains N (1 2 #include 3 4 using namespace std; 5 6 long long n; 7 int a[3] = {0,0,1}; 8 int main() 9 {10 scanf(... 阅读全文
posted @ 2014-03-04 22:04 hyx1 阅读(165) 评论(0) 推荐(0) 编辑
摘要: For given integer N (1 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define maxn 10005 8 9 int n,len = 0;10 int ele[20];11 bool prime[maxn],vis[maxn];12 13 void solve() {14 for(int i = 3; i <= n; i++) {15 prime[i] = i % 2;16 }17 18 prime[2] = 1;19 int ... 阅读全文
posted @ 2014-03-04 22:01 hyx1 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Dominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of dots, or pips, on its face. The blocks usually are called bones, dominoes, or pieces and sometimes men, stones, or even cards. The face of each piece is divided, by a line or ridge, into t 阅读全文
posted @ 2014-03-04 21:58 hyx1 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Read integers A and B from input file and write their sum in output file.InputInput file contains A and B (0 2 #include 3 using namespace std; 4 5 i... 阅读全文
posted @ 2014-03-04 21:54 hyx1 阅读(188) 评论(0) 推荐(0) 编辑