2021 牛客多校8 题解

A Ares, Toilet Ares

题意

略,模拟即可

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int ll
typedef long long ll;
const int mod = 4933;
const int N = 1e6 + 7;
ll a[N];
ll qkpow(ll a, ll b) {
    ll ans = 1;
    while (b) {
        if (b & 1)
            ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans;
}
ll getInv(ll a) { return qkpow(a, mod - 2); }
signed main() {
    int n, m, k, ax, l;
    cin >> n >> m >> k >> ax >> l;
    int up = 1, down = 1, x, y, z;
    while (k--) {
        cin >> x >> y >> z;
        if(!x) continue;
        up = ((z - y) * up ) % mod;
        down = down * z % mod;
    }
    cout << (up + ax * down) * getInv(down) % mod << endl;
    return 0;
}

E Rise of Shadows

既是闰年又是质数?

#include <bits/stdc++.h>
using namespace std;
void solve() {
    int n;
    cin >> n;
    cout << "no" << endl;
}
signed main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}
全部评论

相关推荐

头像
不愿透露姓名的神秘牛友
03-13 10:56
点赞 评论 收藏
转发
点赞 收藏 评论
分享
牛客网
牛客企业服务