nyoj 473 A^B Problem】的更多相关文章

A^B Problem 时间限制:1000 ms  |  内存限制:65535 KB 难度:2   描述 Give you two numbers a and b,how to know the a^b's the last digit number.It looks so easy,but everybody is too lazy to slove this problem,so they remit to you who is wise.   输入 There are mutiple te…
A*B Problem II 时间限制:1000 ms  |  内存限制:65535 KB 难度:1   描述 ACM的C++同学有好多作业要做,最头痛莫过于线性代数了,因为每次做到矩阵相乘的时候,大量的乘法都会把他搞乱,所以他想请你写个程序帮他检验一下计算结果是否正确.   输入 有多组测试数据,每行给出一组m,n,k(0<m,n,k<=50).m,n,k表示两个矩阵的大小,其中:矩阵A:m行n列.矩阵B:n行k列.接下来给出m*n个数表示矩阵A和n*k个数表示矩阵B,对于每个数s,0<…
点击打开链接 A+B Problem II 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述 I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. A,B must be positive. 输入 The first line of the input contains an integer T(1<=T<…
题目链接:http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=927 代码: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <algorithm> #include <iostream> using namespace std; int n,k; ]; ; ]…
A 计划日 题意:已知李明在YYYY年MM月DD日星期W订了学习计划,现在想看看李明N天后的完成情况和个人总结,你能告诉我那天的日期和星期几吗? 模拟日期计算: 计算星期可以用基姆拉尔森公式 //中国的星期 结果要+1 int Day(int y,int m,int d) { if(m==1 || m==2) m+=12,y-=1; return (d+2*m+3*(m+1)/5+y+y/4-y/100+y/400+1)%7; } AC代码 #include<bits/stdc++.h> us…
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=860 My思路: 先用两个字符串储存这两个实数,然后再用另外两个字符串储存去掉符号和前后多余的0后的新"实数",最后只需要比较两个化简后的新字符就ok了. My代码实现: #include<iostream> using namespace std; string simplify(string s) { //去字符串s的正负号和首尾多余的0 string a; ,…
Prime Ring Problem Time Limit : 4000/2000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 18   Accepted Submission(s) : 7 Problem Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2,…
A+B Problem IV 时间限制:1000 ms  |  内存限制:65535 KB 难度:3   描述 acmj最近发现在使用计算器计算高精度的大数加法时很不方便,于是他想着能不能写个程序把这个问题给解决了.   输入 包含多组测试数据每组数据包含两个正数A,B(可能为小数且位数不大于400) 输出 每组输出数据占一行,输出A+B的结果,结果需要是最简的形式. 样例输入 1.9 0.1 0.1 0.9 1.23 2.1 3 4.0 样例输出2 1 3.33 7 测试数据都对,又在网上找了…
A-B Problem 时间限制:1000 ms  |  内存限制:65535 KB 难度:3   描述 A+B问题早已经被大家所熟知了,是不是很无聊呢?现在大家来做一下A-B吧. 现在有两个实数A和B,聪明的你,能不能判断出A-B的值是否等于0呢?   输入 有多组测试数据.每组数据包括两行,分别代表A和B.它们的位数小于100,且每个数字前中可能包含+,- 号.每个数字前面和后面都可能有多余的0.每组测试数据后有一空行. 输出 对于每组数据,输出一行.如果A-B=0,输出YES,否则输出NO…
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=860 My思路: 先用两个字符串储存这两个实数,然后再用另外两个字符串储存去掉符号和前后多余的0后的新"实数",最后只需要比较两个化简后的新字符就ok了. My代码实现: #include<iostream> using namespace std; string simplify(string s) { //去字符串s的正负号和首尾多余的0 string a; ,…