2019--徐州网络赛A题

After Asgard was destroyed, tanker brought his soldiers to earth, and at the same time took on the important task of protecting the peace of the earth. The best two solders were lb and zgx, were very capable, but they always disliked each other. However, one day they encountered a group of foreign invaders (many, but how many only tanker knew). They were all strong enough to destroy the enemy easily. But they found it too boring, so they agreed to follow some rules to deal with the invaders by taking turns, and if one of them had no enemies when it was his turn, he would later admit that the other man was better.
The rules are as follows:
zgx takes the first turn. But he cannot destroy all the enemies at the first time;
after that, the number of enemies that can be destroyed at a time is between 11 enemy and 22 times the number of enemies that the former has just destroyed (including 11 enemy and 22 times the number of enemies that the opponent has just destroyed).
the winner is the one who agrees to destroy the last enemy. Both zgx and lb are smart, so they only perform actions that are best for them.
To ensure fairness, they found their leader, tanker, to judge, but tanker just wanted people to say he was great, so he didn’t want them to decide easily, so he hid the number of intruders in a question:
there are kk sets of integers aa and bb such that nn ≡ bb (mod aa).
nn is the minimum positive integer solution satisfying the kk groups aa and bb.
Input
In the first line, input kk, and on lines 22 to k + 1k+1, input kk groups aa and bb.

Output
If lb wins, output “Lbnb!”, if zgx wins, output “Zgxnb!”, if they can’t solve, (nn does not exist) , output “Tankernb!” .

Note:
k\le 10k≤10 ,1< n \le 10^{15}n≤10
15

For the sample, n=8n=8,because 8%5=38%5=3, 8 %3=28%3=2 and 88 is the smallest possible integer that is fit the requirement.

样例输入 复制
2
5 3
3 2
样例输出 复制
Lbnb!

扩展中国剩余定理+斐波那契博弈

#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=500;
ll  fib[N];
void init()
{
  fib[0]=1;
  fib[1]=1;
  for(int i=2;i<N;i++) fib[i]=fib[i-1]+fib[i-2];
}
ll exgcd(ll a,ll b, ll &x,ll &y)
{
  if(b==0)
  {
    x=1;
    y=0;
    return a;
  }
  ll ans=exgcd(b,a%b,y,x);
  y-=x*(a/b);
  return ans;
}
int main()
{
  init();
   ll n,a1,a2,r1,r2,d,x,y;
   while(~scanf("%lld",&n))
   {
    // cout<<n<<endl;
     int f=0;
     scanf("%lld%lld",&a1,&r1);
     for(int i=2;i<=n;i++)
     {
       scanf("%lld%lld",&a2,&r2);
     if(f) continue;
     d=exgcd(a1,a2,x,y);
     if((r2-r1)%d!=0) f=1;//判断是否有解
     if(!f)
     {
       x=(r2-r1)/d*x;
       y=a2/d;
       x=(x%y+y)%y;
       r1=x*a1+r1;
       a1=(a1*a2)/d;
     }
   }
   if(f) cout<<"Tankernb!"<<endl;
   else
   {
     int flag=0;
     for(int i=0;i<N;i++)
     {
       if(fib[i]==r1)
       {
         flag=1;
         cout<<"Lbnb!"<<endl;
         break;
       }
     }
     if(flag==0) cout<<"Zgxnb!"<<endl;
   }
   memset(fib,0,sizeof(fib));
 }
   return 0;
}

基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip基于bert实现关系三元组抽取python源码+数据集+项目说明.zip 个人大四的毕业设计、课程设计、作业、经导师指导并认可通过的高分设计项目,评审平均分达96.5分。主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 [资源说明] 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设或者课设、作业,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96.5分,放心下载使用! 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),供学习参考。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值