QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#746126#9620. osu!maniayeah14AC ✓15ms179288kbC++173.9kb2024-11-14 13:32:112024-11-14 13:32:12

Judging History

你现在查看的是最新测评结果

  • [2024-11-14 13:32:12]
  • 评测
  • 测评结果:AC
  • 用时:15ms
  • 内存:179288kb
  • [2024-11-14 13:32:11]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ull long long
#define PII  pair<int ,int>
const int INF = 0x3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
int fp(int a, int x, int mod) {
    int ans = 1;
    while (x) {
        if (x & 1)ans *= a;
        ans %= mod;
        a *= a;
        a %= mod;
        x >>= 1;
    }
    return ans;
}
bool check1(int n) {
    for (int i = 2; i <= n / 2; i++) {
        if (n % i == 0)return 0;
    }
    return 1;
}
struct tree {
    int sum, pre, suf;
    int tag = -1;
};
tree tr[4 * N];
int ls(int p) { return p << 1; }
int rs(int p) { return (p << 1) + 1; }
int history[N], tot = 0;
void add_tag(int p, int d, int pl, int pr) {
    tr[p].tag += d;
    tr[p].sum += d * (pr - pl + 1);
}
void push_down(int p, int len) {
    if (tr[p].tag != -1) {
        tr[ls(p)].tag = tr[rs(p)].tag = tr[p].tag;
        tr[ls(p)].pre = tr[ls(p)].sum = (tr[p].tag == 0) ? 0 : (len - (len >> 1));
        tr[rs(p)].pre = tr[rs(p)].sum = (tr[p].tag == 0) ? 0 : (len >> 1);
        tr[p].tag = -1;
    }
}
void push_up(int p, int len) {
    tr[p].pre = tr[ls(p)].pre;
    tr[p].suf = tr[rs(p)].suf;
    if (tr[ls(p)].pre == (len - (len >> 1))) {
        tr[p].pre = tr[ls(p)].pre + tr[rs(p)].pre;
    }
    if (tr[rs(p)].suf == (len >> 1)) {
        tr[p].suf = tr[rs(p)].suf + tr[ls(p)].suf;
    }
}
void build(int pl, int pr, int p) {
    tr[p].tag = -1;
    if (pl == pr) {
        tr[p].sum = tr[p].pre = tr[p].suf = 1;
        return;
    }
    int mid = (pl + pr) >> 1;
    build(pl, mid, ls(p));
    build(mid + 1, pr, rs(p));
    push_up(p, pr - pl + 1);
}

void update(int L, int R, int c, int p, int pl, int pr) {
    if (L <= pl && R >= pr) {
        tr[p].pre = tr[p].suf = tr[p].sum = (c == 0) ? 0 : pr - pl + 1;
        tr[p].tag = c;
        return;
    }
    int mid = (pl + pr) >> 1;
    if (L <= mid)update(L, R, c, ls(p), pl, mid);
    if (R > mid)update(L, R, c, rs(p), mid + 1, pr);
    //else update(x, c, rs(p), mid + 1, pr);
    push_up(p, pr - pl + 1);
}

int query(int len, int p, int pl, int pr) {
    if (pl == pr)return pl;
    int mid = (pl + pr) >> 1;
    if (len <= tr[ls(p)].sum) {
        if (len <= tr[p].pre)return pl;
        else return query(len, ls(p), pl, mid);
    }
    else if (len <= tr[rs(p)].pre + tr[ls(p)].suf) {
        return mid - tr[ls(p)].suf + 1;
    }
    else if (len <= tr[rs(p)].sum) {
        if (len <= tr[rs(p)].pre)return pl;
        else return query(len, rs(p), mid + 1, pr);
    }

}

const int M = N;
int prime[N], top = 0;
bool vis[N];
int a[N];
vector<PII>cntt[M];
vector<int>tt;
int sum[M];
bool vv[M];
void euler(int n) {
    memset(prime, 0, sizeof(prime));
    memset(vis, 0, sizeof(vis));
    for (int i = 2; i <= n; i++) {
        if (!vis[i])prime[top++] = i;
        for (int j = 0; j < top; j++) {
            if (i * prime[j] > n)break;
            vis[i * prime[j]] = 1;
            if (i % prime[j] == 0)break;
        }
    }
}



bool viss[N];
vector<int> pr[N];
int nxt[N];
bool is_prime[N];


void solve() {
    int ppmax;
    cin >> ppmax;
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    double acc = (300 * a + 300 * b + 200 * c + 100 * d + 50 * e );
    acc = acc / (300.0 * (a + b + c + d + e + f));
    acc *= 100;
    //cout << max(0.0, (320 * a + 300 * b + 200 * c + 100 * d + 50 * e) / (320.0 * (a + b + c + d + e + f)) - 0.8) << endl;
    int pp = round(round(max(0.0, (320 * a + 300 * b + 200 * c + 100 * d + 50 * e ) / (320.0 * (a + b + c + d + e +f)) - 0.8)*100000)/100000.0 * 5.0 * ppmax);
    printf("%.2lf%% ", acc);
    cout << pp << endl;
}

signed main() {
   // ios::sync_with_stdio(0);
   // cin.tie(0), cout.tie(0);
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
}
/*
2
630
 3029 2336 377 41 10 61
 3000
  20000 10000 0 0 0 0
*/

详细

Test #1:

score: 100
Accepted
time: 15ms
memory: 179288kb

input:

18
1279
4624 4458 1109 220 103 314
753
3604 3204 391 33 9 29
807
5173 3986 763 84 29 96
718
576 461 60 5 2 7
947
4058 3268 764 169 42 158
568
2660 1731 161 16 6 15
641
4181 3126 656 56 10 43
630
3029 2336 377 41 10 61
529
1991 1354 181 11 9 5
1802
8321 2335 115 19 11 27
1645
3965 1087 41 6 1 13
1688...

output:

91.54% 543
97.40% 543
95.75% 523
97.12% 513
93.38% 499
98.16% 444
96.19% 430
96.20% 423
97.74% 400
99.19% 1604
99.38% 1482
99.14% 1465
98.53% 1251
100.00% 2688
100.00% 1792
100.00% 3000
52.78% 0
0.00% 0

result:

ok 18 lines