版本比较
题解:P16345 阿瓦的数列
正文
增加 8 行删除 8 行
4 行未改动56789910111212131415161718192021222223242526262728293018 行未改动495051525353545556565758596061626364656666676869705 行未改动767778798080818283849 行未改动4 行未改动#include<bits/stdc++.h>#define int long longusing namespace std;signed main(){ int t; int t; cin>>t; while(t--){ int x,y,n; int x,y,n; cin>>x>>y>>n; int z; bool flag=false; if(n==1){ cout<<x<<endl; continue; } if(n==2){ cout<<y<<endl; continue; continue; } for(int i=3;i<=n;i++){ z=(x%i)*(y%i)%i; x=y; x=y; y=z; } if(!flag){ cout<<y<<endl;18 行未改动#define int long longusing namespace std;string str="Stop copy";signed main(){ int t; int t; cin>>t; while(t--){ int x,y,n; int x,y,n; cin>>x>>y>>n; int z; bool flag=false; if(n==1){ cout<<x<<endl; continue; } if(n==2){ cout<<y<<endl; continue; continue; } for(int i=3;i<=n;i++){ z=(x%i)*(y%i)%i; if(z==0){5 行未改动 cout<<1<<endl; flag=true; break; } x=y; x=y; y=z; } if(!flag){ cout<<y<<endl;9 行未改动