代码改变世界

2B - The least round way

2013-10-14 21:53 by BrokenJar, 143 阅读, 0 推荐, 收藏, 编辑
摘要:#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, 194 阅读, 0 推荐, 收藏, 编辑
摘要:#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, 152 阅读, 0 推荐, 收藏, 编辑
摘要:#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, 126 阅读, 0 推荐, 收藏, 编辑
摘要:#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, 89 阅读, 0 推荐, 收藏, 编辑
摘要:#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;} 阅读全文

如何创建一个基础jQuery插件

2013-10-14 04:53 by BrokenJar, 255 阅读, 0 推荐, 收藏, 编辑
摘要:如何创建一个基础插件How to Create a Basic Plugin 有时你想使一块功能性的代码在你代码的任何地方有效.比如,也许你想调用jQuery对象的一个方法,对该对象进行一系列的操作.可能你写了一个真正有用的实用函数,想它能够轻易的移植到其他项目.在这种情况下,你可能想写一个插件. Sometimes you want to make a piece of functionality available throughout your code. For example, perhaps you want a single method you can call on a .. 阅读全文

[转]Magento 结构解析

2013-09-19 01:24 by BrokenJar, 231 阅读, 0 推荐, 收藏, 编辑
摘要:MODULES 模块 模块(module) 是Magento的核心. 站点上的任何一个动作(action),无论是在前台还是后台的每一个操作都是通过模块来实现的.模块可以视为一个容器, 它包含下面这几项:设置(settings)数据库模式(database schema)呈现模式(rendering object)辅助工具类(utility helpers)数据模型(data models)动作控制器(action controller) 一个模块可以包含全部的这六项也可以只包含其中的几项,甚至只有一项.所有的模块都可以通过app/etc/modules 目录中xml配置系统来进行开关.每.. 阅读全文