tjut 4633

#include <cstdio>  
#include <cstring>  
#include <cctype>  
#include <cstdlib>  
#include <ctime>  
#include <climits>  
#include <cmath>  
#include <iostream>  
#include <string>  
#include <vector>  
#include <set>  
#include <map>  
#include <list>  
#include <queue>  
#include <stack>  
#include <deque>  
#include <algorithm>  
using namespace std;  
typedef long long ll;  
const int mod = 10007;  
int T,cas=1,n,ans;  
  
int pow_mod(int x, int y)  
{  
    int ret = 1;  
    while (y)  
    {  
        if (y&1) ret=(ret*x)%mod;  
        x=(x*x)%mod;  
        y>>=1;  
    }  
    return ret;  
}  
  
int x,y,d;  
  
void exgcd(int a,int b)  
{  
  
    if(b==0)  
    {  
       x=1;  
       y=0;  
       d=a;  
    }  
    else  
    {  
        exgcd(b,a%b);  
        int t=x;  
        x=y;  
        y=t-a/b*x;  
    }  
}  
int main()  
{  
    scanf("%d",&T);  
    while (T--)  
    {  
        scanf("%d",&n);  
        ans=(pow_mod(n,74)+pow_mod(n,20)*6+pow_mod(n,38)*9+pow_mod(n,26)*8)%mod;  
        exgcd(24,mod);  
        ans=ans*((x+mod)%mod)%mod;  //欧几里得求逆元  
       // ans=(ans*pow_mod(24,mod-2))%mod;  //费马定理求逆元,速度快点  
        printf("Case %d: %d\n",cas++,ans);  
    }  
    return 0;  
}  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值