![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Sicily
Master_Reid
这个作者很懒,什么都没留下…
展开
-
Sicily 1210. 二叉树
知道二叉树的前序遍历和后序遍历求二叉树的棵树可能性关键在于:数拥有单子树的节点个数特征:只有一棵子树的前序假如是AC, 其后序为CA。若有两棵子树,前序为ABC, 后序为BCA。// Problem#: 1210// Author#: Reid Chan#include #include #include using namespace std;int main()原创 2015-07-11 16:06:00 · 1328 阅读 · 0 评论 -
Sicily 1817. 校歌手大奖赛
它题目要求用类实现, 那我就用了个类实现了. 好简单不多说// Problem#: 1817// Author#: Reid Chan#include #include #include using namespace std;class Competitor {private: double sum; double cnt; double ma原创 2015-01-23 19:44:04 · 492 阅读 · 0 评论 -
Sicily 1816. 平面几何问题
实现简单的类的基本功还有高中数学画下图就知道怎么解了.第二次写这道题了, 可读性提高了很多, 代码也比以前漂亮, 有进步// Problem#: 1816// Author#: Reid Chan#include #include #include using namespace std;const double PI = acos(-1.0);const do原创 2015-01-23 19:48:58 · 392 阅读 · 0 评论 -
Sicily 1154. Easy sort
就写一个排序算法~懒人可以直接使用里面的sort~强人直接写一个快速排序或堆排序或基数排序鄙人写了一个插入排序.......// Problem#: 1154// Author#: 3254116#include #include using namespace std;void insertion_sort(int *a, int sz, int n){原创 2014-12-21 11:53:28 · 672 阅读 · 0 评论 -
Sicily 1298. 数制转换
同样是进制转换不过是特殊的三进制~~~// Problem#: 1298// Author#: Reid Chan#include #include using namespace std;void trans(string &r, int n){ if (n == 0) { r = '0'; return; } char c; while (n原创 2014-12-21 11:48:21 · 343 阅读 · 0 评论 -
Sicily 1325. Digit Generator
程序有下界~注意!不然会超时~// Problem#: 1325// Author#: 3253473#include #include #include using namespace std;int digitsum_of_(int n){ int t = n; while (t != 0) { n += (t % 10);原创 2014-12-21 11:52:30 · 334 阅读 · 0 评论 -
Sicily 1813. M进制数问题
简单的进制转换问题.// Problem#: 1813// Author#: Reid Chan#include using namespace std;int to_dec(string b, int len, int m){ int k = 1, r = 0; for (int i = len - 1; i >= 0; --i) { if (原创 2014-12-21 11:45:38 · 762 阅读 · 0 评论 -
Sicily 1636. show me the money
// Problem#: 1636// Author#: 3254634#include using namespace std;int main() { int t; cin >> t; while (t--) { int m, n; cin >> m >> n; int used = 0, ai, bi;原创 2014-12-21 11:56:48 · 582 阅读 · 0 评论 -
Sicily 1815. 计算两点间的距离
用类写一个求两点距离......权当练习写下类吧!// Problem#: 1815// Author#: Reid Chan#include #include #include using namespace std;class Point {public: Point(double x, double y) { this->x = x;原创 2014-12-21 11:58:14 · 385 阅读 · 0 评论 -
Sicily 1036. Crypto Columns
#include #include using namespace std;void sort_alp(string &text, int index[]){ int min; int i, k = 0; char alp; int visited[10] = { 0 }; int times = text.length(); while (times--) { alp原创 2014-10-21 14:19:27 · 421 阅读 · 0 评论 -
Sicily 1765. 笨小猴
也没什么技术含量看你会不会判断质数. 要小心输入都是一个相同字符的情况, 例如 "aaaaa";// Problem#: 1765// Author#: Reid Chan#include #include #include using namespace std;bool is_z(int n) { if (n <= 1) { return fa原创 2015-01-23 19:47:26 · 647 阅读 · 0 评论 -
Sicily 1052. Candy Sharing Game
按步骤模拟一下就好// Problem#: 1052// Author#: Reid Chan#include using namespace std;void isOdd(int &s) { if (s % 2 == 1) ++s;}bool check_same(int *s, int n) { for (int i = 1; i < n原创 2015-01-23 19:52:43 · 404 阅读 · 0 评论 -
Sicily 1200. Stick
看穿了其实就是异或而已// Problem#: 1200// Author#: Reid Chan#include using namespace std;int main() { int n; while (cin >> n && n != 0) { int result = 0; int in; for (int原创 2015-01-23 19:54:17 · 309 阅读 · 0 评论 -
Sicily 1509. Rails
堆栈的经典应用// Problem#: 1509// Author#: Reid Chan#include #include using namespace std;int main() { int n; int bline[1000]; bool flag; while (cin >> n && n) { flag = false原创 2015-07-11 16:00:23 · 916 阅读 · 0 评论 -
Sicily 1443. Printer Queue
按题意思路对于一串序列:子系列1 max1 子序列2 → max1 子序列2 子序列1 (子序列2 子序列1 组成新的子序列3max1 子序列3,子序列3可进一步拆解, 有 max1 (子序列4 max2 子序列5)→ max1 max2 子序列5 子序列 4如此// Problem#: 1443// Author#: Reid Chan#include using n原创 2015-06-24 20:26:39 · 376 阅读 · 0 评论 -
Sicily 1194. Message Flood
注意: 不区分大小写, 所以需要转换成统一小写, 方便比较另A为联系人集合, B为发送人集合题意就是求: A - B// Problem#: 1194// Author#: Reid Chan#include #include #include using namespace std;void to_low(string &a, string b, int l) {原创 2015-05-23 17:12:58 · 555 阅读 · 0 评论 -
Sicily 1934. 移动小球
用两个数组模拟双向列表// Problem#: 1934// Author#: Reid Chan#include using namespace std;void initial(int *f, int *b, int n) { int i; for (i = 0; i < n; i++) { f[i] = i + 1; } for (i = n; i原创 2015-06-24 20:41:24 · 394 阅读 · 0 评论 -
Sicily 1931. 卡片游戏
直接模拟// Problem#: 1931// Author#: Reid Chan#include using namespace std;void initial(int* arr, int len) { for (int i = 1; i <= len; i++) { arr[i] = i; } for (int j = len + 1; j < 80; j+原创 2015-06-24 20:23:04 · 389 阅读 · 0 评论 -
Sicily 1819. Matrix
0.96sec笑而不语~用了STL中的bitset. 在输入矩阵2的时候需要转置需要, 这样乘起来就方便了.相乘之后通过判断1的个数 然后和矩阵3作比对 就可以判断对错, 提前跳出.1是偶数的话, 相加必然是0, 所以对应矩阵3的位是1的话必然错误了. 1是奇数的话, 分析同理.// Problem#: 1819// Author#: Reid Chan#include原创 2015-01-23 19:58:42 · 471 阅读 · 0 评论 -
Sicily 1486. 统计数字
超恶心, 经常TL一定不能用c++的cin cout, 要改用c的printf 和 scanf还用了stl的map.// Problem#: 1486// Author#: Reid Chan#include #include #include using namespace std;int main() { int n; b原创 2015-01-23 19:55:32 · 708 阅读 · 0 评论 -
Sicily 1818. 成绩转换
用了STL的map.只需要正常输入, 可以达到覆盖效果.时间有点慢, 用了1.56sec// Problem#: 1818// Author#: Reid Chan#include #include #include using namespace std;void level(int s) { if (90 <= s && s <= 100) {原创 2015-01-23 19:40:56 · 367 阅读 · 0 评论 -
Sicily 1814. 日期计算问题
还是写类时间分三部分. 大年过了多少天, 小年还剩多少天, 中间多少天.// Problem#: 1814// Author#: Reid Chan#include #include using namespace std;int months[13] = { 29, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };cl原创 2015-01-23 19:50:07 · 353 阅读 · 0 评论 -
Sicily 1020. Big Integer
#include #include using namespace std;int mod(string big, int basic){ //int result; int len = big.length(); int div = 0; for (int i = 0; i < len; ++i) { div = div * 10 + big[i] - '0'; di原创 2014-10-20 23:28:19 · 489 阅读 · 0 评论 -
Sicily 1007. To and Fro
// Problem#: 1007// Submission#: 3042250// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by原创 2014-10-19 22:11:39 · 256 阅读 · 0 评论 -
Sicily 1795. Table tennis
// Problem#: 1795// Author#: Reid Chan#include using namespace std;bool in_the_circle(int x, int y, int r){ if (x * x + y * y < r * r) { return true; } return false;}int原创 2014-11-09 20:46:46 · 389 阅读 · 0 评论 -
Sicily 1051. Biker's Trip Odomete
// Problem#: 1051// Author#: Reid Chan#include #include #define PAI 3.1415927using namespace std;int main() { float dia, tim; int rev; int num = 0; while (cin >> dia >> rev >原创 2014-11-09 20:46:36 · 434 阅读 · 0 评论 -
Sicily 1157. The hardest problem
// Problem#: 1157// Author#: Reid Chan#include using namespace std;int main() { int t; while (cin >> t && t != 0) { int num, max; for (int i = 0; i < t; ++i) {原创 2014-11-08 20:45:59 · 476 阅读 · 0 评论 -
Sicily 1147. 谁拿了最多奖学金
// Problem#: 1147// Author#: Reid Chan#include #include using namespace std;int main() { int N; cin >> N; string name, admin, west, the_one; int final, class_, sci; int tot原创 2014-11-08 20:46:29 · 599 阅读 · 0 评论 -
Sicily 1232. Electrical Outlets
// Problem#: 1232// Author#: Reid Chan#include using namespace std;int main() { int N; int strip; cin >> N; while (N--) { int num, total = 0; cin >> num;原创 2014-11-08 20:39:57 · 352 阅读 · 0 评论 -
Sicily 1388. Quicksum
// Problem#: 1388// Author#: Reid Chan#include #include #include using namespace std;int main() { string packet; while (getline(cin, packet) && packet != "#") { int len = pack原创 2014-11-08 20:41:49 · 345 阅读 · 0 评论 -
Sicily 1144. 陶陶摘苹果
// Problem#: 1144// Author#: Reid Chan #include using namespace std;int main(){ int height[10]; for (int i = 0; i < 10; ++i) { cin >> height[i]; } int get, count = 0;原创 2014-11-08 20:35:11 · 615 阅读 · 0 评论 -
Sicily 题目分类
依照自己水平挑着做→ →转载 2014-11-07 23:32:56 · 1451 阅读 · 0 评论 -
Sicily 1324. Score
// Problem#: 1324// Author#: Reid Chan#include #include using namespace std;int main() { int T; cin >> T; while (T--) { string input; cin >> input; int len原创 2014-11-08 20:44:11 · 446 阅读 · 0 评论 -
Sicily 1798. Alice and Bob
// Problem#: 1798// Author#: Reid Chan#include using namespace std;int main() { int num; while (cin >> num && num != 0) { if (num % 2 == 0) { cout << "Alice" << endl原创 2014-11-09 20:47:47 · 459 阅读 · 0 评论 -
Sicily 1510. Mispelling
// Problem#: 1510// Author#: Reid Chan#include #include using namespace std;int main() { int num, n = 0; cin >> num; while (num--) { ++n; int loc; string wo原创 2014-11-09 20:59:27 · 381 阅读 · 0 评论 -
Sicily 1500. Prime Gap
// Problem#: 1500// Author#: Reid Chan#include #include using namespace std;bool isPrime(int n){ for (int i = 2; i <= sqrt(n); ++i) { if (n % i == 0) { return false;原创 2014-11-09 20:59:22 · 454 阅读 · 0 评论 -
Sicily 1001. Alphacode
// Problem#: 1001// Submission#: 3049085// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by原创 2014-10-20 16:53:47 · 319 阅读 · 0 评论 -
Sicily 1027. MJ, Nowhere to Hide
#include #include #include using namespace std;struct BBS { string name; string ip;};int main(){ int n; BBS bbs[20]; while (cin >> n && n) { map user; map account; for (int i = 0;原创 2014-10-20 23:05:26 · 399 阅读 · 0 评论 -
Sicily 1014. Specialized Four-Dig
// Problem#: 1014// Submission#: 3042907// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by原创 2014-10-19 22:15:50 · 385 阅读 · 0 评论 -
Sicily 1021. Couples
// Problem#: 1021// Submission#: 3043348// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by原创 2014-10-19 22:17:16 · 332 阅读 · 0 评论