A题:给定A,N,P,计算A的N!次幂对P取模的结果. 数据范围: T次测试,1 ≤ T ≤ 100 1<=A,N,P<=105 快速幂一下就好了.O(nlogn). AC代码: #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;++i) using namespace std; const int MAXN=1e5+1e4; long long mo[MAXN]; int TT; long long a,…
Google Kick Start Round G 2019 Book Reading 暴力,没啥好说的 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=1e5+5; int n,m,q,p[maxn],r[maxn]; int cnt[maxn]; int main() { int T,Case=1; scanf("%d",&T); while(T-…
G. Raffles 题目连接: http://www.codeforces.com/contest/626/problem/G Description Johnny is at a carnival which has n raffles. Raffle i has a prize with value pi. Each participant can put tickets in whichever raffles they choose (they may have more than o…
这是现场完整做出来的唯一一道题Orz..而且还调了很久的bug.还是太弱了. Problem When you travel, you like to spend time sightseeing in as many cities as possible, but sometimes you might not be able to because you need to catch the bus to the next city. To maximize your travel enjoy…