Sicily 1020. Big Integer
来源:互联网 发布:最成功的发明 知乎 编辑:程序博客网 时间:2024/05/17 03:38
大数取模。将大数字符串从头到尾扫一遍,模拟平时除法运算取模的方法。
// Problem#: 1020// Submission#: 2198449// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/// All Copyright reserved by Informatic Lab of Sun Yat-sen University#include <iostream>#include <vector>#include <string.h>#include <algorithm>#include <cstdio>#include <cmath>#include <map>#include <string>#include <stack>using namespace std;int main(){ int t; cin >>t; while(t--){ int n; vector<int> v(105); cin >> n; for(int i = 0; i < n; i++) cin >> v[i]; string s; cin >> s; cout << "("; for(int j = 0 ; j < n; j++){ int res = 0; for(int i = 0; i < s.size(); i++){ res = (res *10 + (s[i]-'0')) % v[j]; } if(j == n-1) cout << res <<")" << endl; else cout << res << ","; } }}
- Sicily.1020. Big Integer
- Sicily 1020. Big Integer
- sicily 1020. Big Integer
- Sicily 1020. Big Integer
- sicily 1020.Big Integer
- Sicily 1020. Big Integer
- [sicily]1020. Big Integer
- sicily 1020. Big Integer
- [sicily] 1020. Big Integer
- [sicily online]1020. Big Integer
- Sicily 1020 Big Integer
- sicily 1020 Big Integer
- Sicily 1020 Big Integer
- sicily 1020 Big Integer
- sicily 1020 Big Integer
- Sicily 1020. Big Integer | 大整数取模运算
- Sicily 1020 Big Integer(高精度运算)
- 1020. Big Integer
- VC(MFC)在工具栏中使用PNG图片
- How to Install and Use JRebel with WebLogic and Eclipse
- 安装jdk的方式
- HDU 4708 Rotation Lock Puzzle && 2013 ACM/ICPC Asia Regional Online —— Warmup
- Android核心分析 Android应用框架之Activity
- Sicily 1020. Big Integer
- 移动数据文件、系统表空间文件、临时表空间文件
- php导入excel数据到mysql
- HDU 4715 Difference Between Primes && 2013 ACM/ICPC Asia Regional Online —— Warmup
- MFC工具栏ToolBar按钮添加下拉菜单
- Perl例程24例(包含很多运用示例-整理版)
- 查看归档文件路径
- linux 下安装 jdk1.6
- 利用SpiderMonkey进行嵌入式开发