摘要:#include using namespace std;int inv(int a,int p){ if(a == 1) return 1; return inv(p%a,p)*(p-p/a)%p;}int main(){ int p,a; while(cin >> a >> p){ cout <...
阅读全文
摘要:F - Number Sequence#include#includeusing namespace std;struct mat{ int ans[2][2];};mat I,MID;int M;mat cal(mat a,mat b){ mat c; int i,j,k; for(i=0;i>=...
阅读全文
摘要:#include #include#includeusing namespace std;struct node{int x,y;node(int x = 0,int y = 0){ this -> x = x; this -> y = y; }};queue A;int n,m,t;int xx,...
阅读全文