CSUOJ 1018 Avatar
Description
In the planet Pandora, Jake found an old encryption algorithm. The plaintext, key and ciphertext are all four decimal numbers and all greater than 0. The way to get the ciphertext from the plaintext and the key is very simple: the ciphertext is the last four digits of the product of the plaintext and the key (for example: the plaintext is 2010 and the key is 4024, and then the product is 8088240. So the ciphertext is 8240).
Note that the plaintext and the key don’t have leading 0, while the ciphertext might have. Now given the plaintext and the key, you are asked to figure out the ciphertext for Jake quickly.
Input
The first line is an integer T, which presents the number of test cases. Then there are T lines, each line has two integers, the first integer is the plaintext and the second is the key.
Output
For each test case, output the ciphertext.
Sample Input
2
2010 4024
1234 1111
Sample Output
8240
0974
Hint
#include<stdio.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>
typedef long long ll;
using namespace std;
ll x, y;
int main()
{
int t;
while (~scanf("%d", &t))
{
while (t--)
{
scanf("%lld%lld", &x, &y);
ll num = x*y;
num = num % 10000;
printf("%.4lld\n", num);
}
}
return 0;
}
/**********************************************************************
Problem: 1018
User: leo6033
Language: C++
Result: AC
Time:0 ms
Memory:2024 kb
**********************************************************************/
CSUOJ 1018 Avatar的更多相关文章
- CSU1018: Avatar
1018: Avatar Submit Page Summary Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 841 ...
- PAT A 1018. Public Bike Management (30)【最短路径】
https://www.patest.cn/contests/pat-a-practise/1018 先用Dijkstra算出最短路,然后二分答案来验证,顺便求出剩余最小,然后再从终点dfs回去求出路 ...
- u3d avatar部件的理解
u3d中带动画的fbx文件导入的时候,就会显示一个avatar组件,这个到底干嘛的一直没能很好的理解,翻看网上的介绍,基本都是告诉你,设置humanoid类型动画时,拖拉过去之类,但是这玩意到底存储了 ...
- csuoj 1511: 残缺的棋盘
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1511 1511: 残缺的棋盘 时间限制: 1 Sec 内存限制: 128 MB 题目描述 输入 ...
- ERROR 1018 (HY000): Can't read dir of './test/' (errno: 13)
不能查看mysql中数据库的表. 一.查看 mysql> desc test; ERROR 1046 (3D000): No database selected mysql> use te ...
- (状压) Brush (IV) (Light OJ 1018)
http://www.lightoj.com/volume_showproblem.php?problem=1018 Mubashwir returned home from the contes ...
- HDU 1018 Big Number (数学题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1018 解题报告:输入一个n,求n!有多少位. 首先任意一个数 x 的位数 = (int)log10(x ...
- Ural 1018 (树形DP+背包+优化)
题目链接: http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=17662 题目大意:树枝上间连接着一坨坨苹果(不要在意'坨'),给 ...
- 【BZOJ】1018: [SHOI2008]堵塞的交通traffic
http://www.lydsy.com/JudgeOnline/problem.php?id=1018 题意:有2行,每行有c(c<=100000)个城市,则一共有c-1个格子,现在有q(q& ...
随机推荐
- JAVA多线程提高十四: 面试题
前面针对多线程相关知识点进行了学习,那么我们来来看看常见的面试题: 1. 空中网面试题1 package com.kongzhongwang.interview; import java.util.c ...
- XML学习(1)
什么是XML? XML是可拓展标记语言,类似HTML,它的设计宗旨是为了传输数据,而不是像HTML那样显示数据.XML标签没有被预定义,需要用户自定义标签. xml文档必须包含根元素,它是其他所有元素 ...
- Postgresql获取所有schema
Postgresql 连接方式_连接五要素_psql: https://blog.csdn.net/u011402596/article/details/38510547 postgresql的sho ...
- c++刷题(18/100)树
题目1:二叉搜索树的第k个节点 给定一颗二叉搜索树,请找出其中的第k小的结点.例如, 5 / \ 3 7 /\ /\ 2 4 6 8 中,按结点数值大小顺序第三个结点的值为4. 思路:因为是二叉搜索树 ...
- Nginx配置location及rewrite规则
Nginx配置location及rewrite规则 示例: location = / { # 精确匹配 / ,主机名后面不能带任何字符串 [ configuration A ] } loca ...
- xampp + windows 配置 memcache流程
1.运行xampp服务,打开phpinfo查看信息,如下图: 从上到下,依次为 PHP版本:5.6: architecture:x86: TS:线程安全: vc11 2.牢记以上几个横线内容之后去下载 ...
- 【数据库】SQL经典面试题 - 行列转换二 - 列转行
本帖子是行转列的一个逆向操作——列转行,看下面一个面试题 面试题2: 柠檬班第30期学生要毕业了,他们的Linux.MySQL.Java成绩数据表 tb_lemon_grade_column中, 表中 ...
- 差分约束系统+(矩阵)思维(H - THE MATRIX PROBLEM HDU - 3666 )
题目链接:https://cn.vjudge.net/contest/276233#problem/H 题目大意:对于给定的矩阵 每一行除以ai 每一列除以bi 之后 数组的所有元素都还在那个L- ...
- 信息安全学习笔记--CSRF
一.CSRF简介 CSRF(Cross-site request forgery)跨站请求伪造,也被称为“one click attack”或者“session riding”,通常缩写为CS ...
- CSS line-height应用
一.固定高度的容器,单行文本垂直居中 代码如下: <!DOCTYPE html> <html> <head> <meta charset="utf- ...