1058. A+B in Hogwarts (20):有疑惑-第三个测试点错误
2015-08-31 16:23
218 查看
也考虑到数据的区间越界问题了···
#include<iostream> #include<cstring> #include<map> #include<string> #include<cmath> #include<algorithm> using namespace std; int main() { int P_G, P_S, P_K; int A_G, A_S, A_K; char c; while(cin>>P_G>>c>>P_S>>c>>P_K) { cin>>A_G>>c>>A_S>>c>>A_K; long long P_Sum = P_G*17*29 + P_S*29 + P_K; long long A_Sum = A_G*17*29 + A_S*29 + A_K; int K = ( P_Sum + A_Sum )%29; int S = (( P_Sum + A_Sum )/29)%17; int G = (( P_Sum + A_Sum )/29)/17; cout<<G<<'.'<<S<<'.'<<K<<endl; } return 0; }
相关文章推荐
- js 按需加载
- 【小姿势】如何搭建ipa下载web服务器(直接在手机打开浏览器安装)
- JS自动倒计时30秒后按钮才可用(两种场景)
- 数据结构与算法分析Java版练习1.14
- ubuntu禁用笔记本触摸板
- ROWID的含义与块地址rdba深入分析
- Axis2 Web服务配置文件services.xml详解
- ebs知识点100题
- HDU2282Chocolate(KM匹配)
- cocos2d-x 延迟执行一段代码1 顺序执行动作+延迟动作+CallFunc
- MySQL的Keepalived安装、配置、启动
- android常用权限命令
- LeetCode之Find Minimum in Rotated Sorted Array II
- 类中包含几种成员,分别是什么?
- OI回忆录——小学、初中
- AjaxFileUpload 在C#中应用
- vsftpd基本配置(原)
- 统计一个01字符串中0,1连续出现的最大次数
- 【Matlab学习笔记】(六)基本数据结构(矩阵定义方法)
- C++类的空间大小