#include<bits/stdc++.h>usingnamespace std;#define mod 1000000007#define INF 0x3f3f3f3f#define pi 3.141592654typedeflonglong ll;constint N =2e7+2;
ll pow_mod(ll a, ll n, ll m){if(n ==0)return1;int x =pow_mod(a, n/2, m);
ll ans =(ll)x * x % m;if(n %2==1) ans = ans *a % m;return ans;}
ll fa[N];
ll fb[N];intmain(){
fa[1]=2;
fb[1]=pow_mod(2,mod-2,mod);for(ll i =2; i < N ; i++){
fa[i]= fa[i-1]*2%mod;
fb[i]= fb[i-1]*fb[1]%mod;}///2^nfor(int i =2; i < N ; i++){
fb[i]=(fb[i-1]*(fa[i]-1)%mod * fb[i]%mod)%mod;}for(int i =2; i < N ; i++)
fb[i]= fb[i]^ fb[i-1];int t,n;scanf("%d",&t);while(t--){scanf("%d",&n);printf("%lld\n",fb[n]);}return0;}
### C 推结论
```cpp
#include<bits/stdc++.h>
using namespace std;
#define INF 2e14
typedef long long ll;
ll s[410][410],a;
int t,n,m;
int main(){
scanf("%d",&t);
while(t--){
scanf("%d %d",&m,&n);
double ma = 1;
for(int i = 1 ; i <= m ; i ++)
for(int j = 1 ; j <= n ; j++){
scanf("%d",&a);
s[i][j] = s[i-1][j] + a;
if(1.0*s[i][j]/a > ma) ma = 1.0*s[i][j]/a;
}
printf("%.8f\n",ma);
}
}
E 构造
#include<bits/stdc++.h>usingnamespace std;#define mod 1000000007#define INF 0x3f3f3f3f#define pi 3.141592654typedeflonglong ll;constint N =2e7+2;
ll pow_mod(ll a, ll n, ll m){if(n ==0)return1;int x =pow_mod(a, n/2, m);
ll ans =(ll)x * x % m;if(n %2==1) ans = ans *a % m;return ans;}
ll fa[N];
ll fb[N];intmain(){
fa[1]=2;
fb[1]=pow_mod(2,mod-2,mod);for(ll i =2; i < N ; i++){
fa[i]= fa[i-1]*2%mod;
fb[i]= fb[i-1]*fb[1]%mod;}///2^nfor(int i =2; i < N ; i++){
fb[i]=(fb[i-1]*(fa[i]-1)%mod * fb[i]%mod)%mod;}for(int i =2; i < N ; i++)
fb[i]= fb[i]^ fb[i-1];int t,n;scanf("%d",&t);while(t--){scanf("%d",&n);printf("%lld\n",fb[n]);}return0;}