代码改变世界

随笔分类 -  ACM

2B - The least round way

2013-10-14 21:53 by BrokenJar, 149 阅读, 收藏,
摘要: #include #include #include #include using namespace std; int n;vector > > coll;vector best_way(2); int zero_x = 0; /*struct elem{ int factor_count_2; int factor_count_5; int orign_2; int orign_5;}*/int get_factor_count(int number, int factor){ int result = 0; while(number && !(num... 阅读全文

1C - Ancient Berland Circus

2013-10-14 21:50 by BrokenJar, 206 阅读, 收藏,
摘要: #include #include #include const double pi = 3.141592654; inline bool isinteger(double x, int prec){ double decimal = ceil(x)-x (decimal * pow(10, prec - 1));} int main(){ double x1, y1; double x2, y2; double x3, y3; std::cin >> x1 >> y1; std::cin >> x2 >> y2; std::cin >&g 阅读全文

2A - Winner

2013-10-14 21:48 by BrokenJar, 158 阅读, 收藏,
摘要: #include #include #include #include #include class player{public: player(const std::string& name) :_name(name), _score(0) { } void addscore(int score) { _score += score; _count ++; _scores.push_back(_score); _counts.push_back(_count); } ... 阅读全文

1B - Spreadsheet

2013-10-14 21:44 by BrokenJar, 132 阅读, 收藏,
摘要: #include #include #include #include #include #include #include #include int main(){ int n; std::cin >> n; for(int i = 0; i > sin; std::string::iterator iter = sin.end(); if(sin[0] == 'R' && std::isdigit(sin[1])) iter = std::find(sin.beg... 阅读全文

1A - Theater Square

2013-10-14 21:37 by BrokenJar, 94 阅读, 收藏,
摘要: #include #include #include int main(){ int m, n, a; std::cin >> m >> n >> a; double double_a = static_cast(a); std::cout (std::ceil(m / double_a) * std::ceil(n / double_a)) << std::endl; return EXIT_SUCCESS;} 阅读全文