摘要: 题目链接: POJ 2260 Describe: A boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits 阅读全文
posted @ 2020-08-04 17:04 不敢说的梦 阅读(180) 评论(0) 推荐(0)
摘要: 题目:POJ 1555 Describe: Given the coefficients of a polynomial from degree 8 down to 0, you are to format the polynomial in a readable format with unnec 阅读全文
posted @ 2020-08-04 12:35 不敢说的梦 阅读(113) 评论(0) 推荐(0)
摘要: 先上题:POJ 1504 Describe: The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Ther 阅读全文
posted @ 2020-08-04 10:46 不敢说的梦 阅读(114) 评论(0) 推荐(0)
摘要: 高精度数的乘法: 补充:若两个数位数分别为la和lb,则两数相乘后结果的位数至少为la+lb-1,如果最高位有进位,则结果的位数为la+lb。 思路:先计算,再一次性进位。 代码: 1 for(int i = 0; i < la; i++) 2 for(int j = 0; j < lb; j++) 阅读全文
posted @ 2020-08-04 10:26 不敢说的梦 阅读(191) 评论(0) 推荐(0)
摘要: 高精度数的存储: 用数组来存储,先将大数用字符串输入,再存入数组。 1 string s; 2 int a[100]; 3 int n = s.size(); 4 for(int i = 0; i < n; i++) 5 a[i] = s[n-i-1]-'0'; 此处注意,数的低位在s下标高的地方, 阅读全文
posted @ 2020-08-04 08:08 不敢说的梦 阅读(278) 评论(0) 推荐(0)
摘要: (持续更新) string类中,每个元素属于char类型,底层是一个顺序表的结构。 字符串的输入: 如果不带空格,则scanf和cin都可以输入,若输入的字符串带空格:1、scanf(“%[ ^\n ]d”); 2、getline()(包含头文件<string>) getline(cin,s); 3 阅读全文
posted @ 2020-08-04 07:54 不敢说的梦 阅读(108) 评论(0) 推荐(0)