随笔分类 -  基础训练题解

摘要:RelativesTime Limit:1000MSMemory Limit:65536KTotal Submissions:8841Accepted:4134DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a = xy a 阅读全文
posted @ 2012-07-13 16:23 ismdeep 阅读(169) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 5 int main() 6 { 7 int t; 8 cin >> t; 9 while( t-- )10 {11 int n;12 cin >> n;13 int *a = new int[n];14 int sum = 0;15 16 // input data numbers that everyone own the app... 阅读全文
posted @ 2012-06-04 22:20 ismdeep 阅读(199) 评论(0) 推荐(0)
摘要:1 #include <iostream> 2 #include <stdio.h> 3 using namespace std; 4 5 int main() 6 { 7 int s, d; 8 while(scanf("%d%d" ,&s, &d) != EOF) 9 {10 int i;11 for(i = 1; i <= 5; i++)12 {13 if( s * (5-i) - d * i < 0 )14 {15 break;16... 阅读全文
posted @ 2012-06-04 22:19 ismdeep 阅读(371) 评论(0) 推荐(0)
摘要:1 // project : 3106 2 // file name : main.cpp 3 4 #include <iostream> 5 using namespace std; 6 7 #define SPACE 32 8 9 int main() 10 { 11 int n; 12 while (cin >> n && n) 13 { 14 string str; 15 int s_time, j_time, b_time; 16 17 // input data ... 阅读全文
posted @ 2012-06-04 22:11 ismdeep 阅读(221) 评论(0) 推荐(0)