QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#74735 | #5004. Finalists | Smallbasic# | AC ✓ | 2ms | 3600kb | C++14 | 955b | 2023-02-03 16:22:00 | 2023-02-03 16:22:00 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
inline int read() {
register int s = 0, f = 1; register char ch = getchar();
while (!isdigit(ch)) f = (ch == '-' ? -1 : 1), ch = getchar();
while (isdigit(ch)) s = (s * 10) + (ch & 15), ch = getchar();
return s * f;
}
inline int readchar() {
register char ch = getchar();
while (!isalpha(ch)) ch = getchar();
return ch;
}
double val[15];
map<char, int> mp;
int ord[15], ans[15], rnk[15];
inline bool cmp(int a, int b) {
return val[a] > val[b];
}
int main() {
int n; n = read();
for (int i = 1; i <= 6; ++i) {
ord[i] = i; mp[readchar()] = i;
val[i] += 0.06 * read();
val[i] += 0.14 * read();
val[i] += 0.24 * read();
val[i] += 0.56 * read();
val[i] += 0.3 * read();
} sort(ord + 1, ord + 7, cmp);
for (int i = 1; i <= 6; ++i) rnk[ord[i]] = i;
for (int i = 0; i < n; ++i) ++ans[(i % 6) + 1];
printf("%d\n", ans[rnk[mp['T']]]);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3600kb
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: 2ms
memory: 3428kb
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: 3464kb
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: 2ms
memory: 3480kb
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: 3484kb
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'