9.15


//mirror
/*
#include<iostream>
#include <cstring>
#include <cctype>

using namespace std;

int main() {
    string s = "jessie";

    string t;
    int T;

    cin >> T;

    while (T--) {

        cin >> t;
int flag = 0;
        if(t.size() == s.size()){
        for (int i = 0; s[i]; i++) {
            t[i] = tolower(t[i]);
if(t[i] != s[i]) {cout << "Dare you say that again?" << endl;flag = 1;break;}

        }
            if(flag == 0)
            cout << "Good guy!" << endl;}
    else cout << "Dare you say that again?" << endl;

//       if (strcmp(s, t) == 0)
 //           cout << "Good guy!" << endl;
  //      else cout << "Dare you say that again?" << endl;
  //

return 0;
}*/

//SAVE THE ROOM
/*
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int A, B, C;

    while(cin >> A >> B >> C)
    {//int flag =0;
        if(A%2 == 0 || B%2 == 0 || C%2==0)
            cout << "Yes" << endl;
        else cout << "No" << endl;
    }


    return 0;
}
*//*
#include<iostream>

using namespace std;

const long long DATA = 1000000007;

int main()
{
    int T, n;

    cin >> T;

    while(T--)
    {
        cin >> n;
        {

            cout << (unsigned long long)((1<<(n-1))) << endl;



        }

    }
}*/
/*
#include<iostream>
#include<cstdio>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>

using namespace std;

const long long mod=1000000007;

typedef long long LL;

LL powMod(LL x,LL n)
{
    LL res=1;
//    x%=mod;

    while(n>0)
    {
        if(n&1)
            res=(res*x)%mod;
        x=((x%mod)*(x%mod))%mod;
        n >>= 1;
    }
    return res%mod;
}

int main()
{
    int t;
    cin>>t;
  //  while(t--)
    {
        long long n;
        cin>>n;             // n 不能在这个地方直接mod
        if(n==1)
        {
            cout<<1<<endl;
            continue;
        }
        cout << (powMod(2,n-1)) << endl;   // n*n 会爆longlong,
    }
    return 0;
}

*/
/*
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <bitset>
#pragma comment(linker, "/STACK:102400000,102400000")
typedef long long LL;
const int inf=0x3f3f3f3f;
const double pi= acos(-1.0);
const double esp=1e-6;
using namespace std;
const int Maxn=1e6+10;
const long long Mod=1000000007;
//直接法求欧拉函数
int Euler(int n)
{
    int m=floor(sqrt(n+0.5));
    int ans=n;
    for(int i=2;i<=m;i++){
        if(n%i==0){
            ans=ans/i*(i-1);
            while(n%i==0)
                n/=i;
        }
    }
    if(n>1)
        ans=ans/n*(n-1);
    return ans;
}
//快速乘法
LL Mul(LL a,LL b,LL mod)
{
    LL res=0;
    while(b>0){
        if(b&1) res=(res+a)%mod;
        b>>=1;
        a=(a+a)%mod;
    }
    return res;
}
//快速幂
LL modxp(LL a,LL b,LL mod)
{
    LL res=1;
    while(b>0){
        if(b&1) res=Mul(res,a,mod);
        b>>=1;
        a=Mul(a,a,mod);
    }
    return res;
}

LL Solve(LL a,char str[],LL mod)
{
    LL len=strlen(str);
    LL res=0;
    LL t=Euler(mod);
    if(len<=15){
        for(int i=0;i<len;i++){
            res=res*10+str[i]-'0';
        }
    }
    else{
        for(int i=0;i<len;i++){
            res=res*10+str[i]-'0';
            res%=t;
        }
        if(res<0) res+=mod;
    }
    return res-1;
}

int main()
{
    LL c,res;
    char b[Maxn];
    int T;
    cin >> T;
    while(T--)
    {
        scanf("%s", b);
        res=Solve(2,b,Mod);
        printf("%lld\n",modxp(2,res,Mod));
    }
    return 0;
}*/
/*
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int n,k,len1,len2;
int next1[1000001];
char s1[1000001];
char s2[1000001];
inline void get_next() //求出next数组
{ //next数组是从 S[0到i-1]前子串 的前缀后缀最大值
    int t1=0,t2;
    next1[0]=t2=-1;
    while(t1<len2)
        if(t2==-1 || s2[t1]==s2[t2]) //类似于KMP的匹配
            next1[++t1]=++t2;
        else t2=next1[t2];//失配
}
inline void KMP() //KMP
{
    int t1=0,t2=0;//从0位开始匹配
    while(t1<len1) //临界值
    {
        if(t2==-1 || s1[t1]==s2[t2]) //匹配成功,继续
            t1++,t2++;
        else t2=next1[t2]; //失配
        if(t2==len2) printf("%d\n",t1-len2+1),t2=next1[t2];//t2==lenn2时,匹配成功;t1-len2+1即为第一个字母的位置
    } //匹配成功后,t2置为next[t2]
}
int main()
{
    string s2, s1;
    int A, B;

    while(cin >> s2 >> A >> B) {
        for (int i = 0; i < s2.size(); i++) {
            int k = 0;
            for (int j = i; j < s2.size(); j++) {
                s1[k++] = s2[j];
                len2 = s2.size();
                len1 = s1.size();
                get_next();
                KMP();
                for (int i = 1; i <= len2; ++i)
                    printf("%d ", next1[i]);//输出next数组
            }
        }
    }
    }
    return 0;
}*/

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值