2020牛客多校第六场

B 公式,向量秩

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define INF 0x3f3f3f3f
#define pi 3.141592654
typedef long long ll;
const int N = 2e7+2;
ll pow_mod(ll a, ll n, ll m){
    if(n == 0)  return 1;
    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];
int main(){
    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^n
    for(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]);
    }
    return 0;
}

### 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>
using namespace std;
#define mod 1000000007
#define INF 0x3f3f3f3f
#define pi 3.141592654
typedef long long ll;
const int N = 2e7+2;
ll pow_mod(ll a, ll n, ll m){
    if(n == 0)  return 1;
    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];
int main(){
    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^n
    for(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]);
    }
    return 0;
}

G

H 数位DP

K

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值