QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#493992 | #5004. Finalists | Ink_bai | AC ✓ | 2ms | 10088kb | C++14 | 2.2kb | 2024-07-27 13:38:13 | 2024-07-27 13:38:13 |
Judging History
answer
#define _CRT_SECURE_NO_WARNINGS
#define itn int
#define PII pair<int, int>
#define PLI pair<long long, int>
#define fep(i,a,b) for(int i = (a); i >= (b); --i)
#define rep(i,a,b) for(int i = (a); i <= (b); ++i)
#include<bits/stdc++.h>
#include<unordered_map>
using ll = long long;
using ldou = long double;
using unll = unsigned long long;
using namespace std;
ll gcd(ll a, ll b) { // 最大公约数
while (b ^= a ^= b ^= a %= b)
;
return a;
}
ll lcm(ll a, ll b) { // 最小公倍数
return a / gcd(a, b) * b;
}
ll qmi(ll m, ll k, ll p) { // 快速幂
// 求 m^k mod p,时间复杂度 O(logk)。
// m为底数,k为幂
ll res = 1 % p, t = m;
while (k) {
if (k & 1) res = res * t % p;
t = t * t % p;
k >>= 1;
}
return res;
}
unll qmi(unll m, unll k, unll p) { //龟速乘
ll res = 0, t = m;
while (k) {
if (k & 1) res = (res + t) % p;
k >>= 1;
t = (t << 1) % p;
}
return res;
}
//////////////////////////////////////////////////////////////////////////////////
unll n, m, k;
string str, s2;
const int N = 1e5 + 5;
const ll INF = 4e18;
const ll MODE = ll(998244353);
const unll base = 131;
const unll prime = 233317;
const int dx[4] = { 1,-1, 0, 0 };
const int dy[4] = { 0, 0, 1,-1 };
//priority_queue<unll, vector<unll>, greater<unll> >pq;
struct PER
{
string name;
int pt, pu, rt, ru, f;
double score;
}p[N];
bool cmp(PER p1, PER p2) {
return p1.score > p2.score;
}
void solve() {
cin >> n;
rep(i, 1, 6) {
cin >> p[i].name >> p[i].pt >> p[i].pu >> p[i].rt >> p[i].ru >> p[i].f;
p[i].score = 1.0 * p[i].pt * 0.56 + 1.0 * p[i].pu * 0.24,
1.0 * p[i].rt * 0.14, 1.0 * p[i].ru * 0.06,
1.0 * p[i].f * 0.3;
}
sort(p + 1, p + 6 + 1, cmp);
//rep(i, 1, 6) cout << p[i].name << ' ' << p[i].score << '\n';
m = n % 6;
ll res = n / 6;
rep(i, 1, m) {
if (p[i].name == "Taiwan")
res++;
}
cout << res << '\n';
}
signed main() {
std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0);
//freopen("wrt.txt", "r", stdin); //freopen("out.txt", "w", stdout);
int TTT = 1; //cin >> TTT;
while (TTT--) {
solve();
}
/*while (cin >> n >> m) {
solve();
}*/
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 9784kb
input:
17 Japan 500 95 40 30 5 Vietnam 400 50 150 40 20 Indonesia 700 25 80 35 20 Taiwan 200 30 100 35 1 Korea 600 100 100 70 0 Philippines 50 10 40 15 15
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 0ms
memory: 9872kb
input:
16 Japan 500 95 40 30 5 Taiwan 200 30 100 35 1 Indonesia 700 25 80 35 20 Philippines 50 10 40 15 15 Korea 600 100 100 70 0 Vietnam 400 50 150 40 20
output:
2
result:
ok single line: '2'
Test #3:
score: 0
Accepted
time: 2ms
memory: 9844kb
input:
16 Vietnam 321 51 113 48 0 Indonesia 690 19 60 17 15 Korea 333 54 59 39 0 Japan 294 86 40 29 0 Taiwan 145 26 101 30 0 Philippines 29 26 50 30 4
output:
2
result:
ok single line: '2'
Test #4:
score: 0
Accepted
time: 0ms
memory: 10088kb
input:
17 Vietnam 321 51 113 48 0 Indonesia 690 19 60 17 15 Korea 333 54 59 39 0 Japan 294 86 40 29 0 Taiwan 145 26 101 30 0 Philippines 29 26 50 30 4
output:
3
result:
ok single line: '3'
Test #5:
score: 0
Accepted
time: 2ms
memory: 9804kb
input:
17 Japan 294 86 40 29 0 Philippines 145 26 101 30 0 Taiwan 29 26 50 30 4 Vietnam 321 51 113 48 0 Indonesia 690 19 60 17 15 Korea 333 54 59 39 0
output:
2
result:
ok single line: '2'