CodeForces Gym 101047L Putting plates on the tuk-tuks 快速幂

Putting plates on the tuk-tuks
Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Description

standard input/output

The tuk-tuk (ตกตก), also known as "auto rickshaw," is a popular form of transportation in Thailand. In order to distinguish tuk-tuks from the other types of vehicles, the Phuket administration decided to create a new license plate system for them. Phuket's tuk-tuk fleet has been growing rapidly, mostly due to tourism, one of the most important economic activities in the province. The administration plans the new system to meet the demand for distinct license plates for the next 42 years.

A license plate system is defined by two numbers, C and D. A license plate in this system is a string formed by C consonants followed by D digits. A license plate cannot be empty (no consonant and no digit).

In the Thai alphabet there are 44 consonants and 10 digits. However, since the symbols of some consonants are too much alike, the administration decided to use only 26 consonants, whose symbols were considered sufficiently distinguishable.

To guarantee an appropriate supply of tuk-tuks for the contestants in the ICPC World Finals in 2016, Phuket's administration would like to know the number of distinct license plates it is possible to generate with a given license plate system.

Input

The first line has a single integer T, the number of test cases.

Each test case consists of a single line containing two integers C and D, the number of consonants and digits, respectively, in a license plate system.

Limits

  • 1 ≤ T ≤ 20
  • 0 ≤ C ≤ 6
  • 0 ≤ D ≤ 9

Output

For each test case, print a line with the amount of distinct license plates that can be generated by the corresponding system. The answer is guaranteed to be smaller than 231.

Sample Input

Input
3
0 6
2 4
0 0
Output
1000000
6760000
0


套模板速度一发a
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <iomanip>
#include <math.h>
#include <map>
using namespace std;
#define FIN     freopen("input.txt","r",stdin);
#define FOUT    freopen("output.txt","w",stdout);
#define INF     0x3f3f3f3f
#define INFLL   0x3f3f3f3f3f3f3f
#define lson    l,m,rt<<1
#define rson    m+1,r,rt<<1|1
typedef long long LL;
typedef pair<int,int> PII;
const double PI = acos(-1);


LL fastpow(LL a,LL b,LL c){
    LL res = a;
    while(c){
        if(c & 1) res = (res * b);
        b = (b * b);
        c >>= 1;

    }
    return res;
}

int main()
{
    //FIN
    int T;
    scanf("%d", &T);
    while(T--){
        LL a, b;
        scanf("%I64d%I64d", &a, &b);
        LL ans = 1;
        ans = fastpow(1, 26, a) * fastpow(1, 10, b);
        if(a == b && a == 0)  ans = 0;
        printf("%I64d\n", ans);

    }

}

  

转载于:https://www.cnblogs.com/Hyouka/p/5802039.html

您提供的链接是Codeforces的一个问题,问题编号为104377。Codeforces是一个知名的在线编程竞赛平台,经常举办各种编程比赛和训练。GymCodeforces的一个扩展包,用于组织私人比赛和训练。您提供的链接指向了一个问题的页面,但具体的问题内容和描述无法通过链接获取。如果您有具体的问题或需要了解关于Codeforces Gym的更多信息,请提供更详细的信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [http://codeforces.com/gym/100623/attachments E题](https://blog.csdn.net/weixin_30820077/article/details/99723867)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [http://codeforces.com/gym/100623/attachments H题](https://blog.csdn.net/weixin_38166726/article/details/99723856)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [CodeforcesPP:Codeforces扩展包](https://download.csdn.net/download/weixin_42101164/18409501)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值