QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#281313 | #7853. Naming Wine Bottles | wnmrmr# | AC ✓ | 4ms | 4792kb | C++23 | 843b | 2023-12-10 02:33:20 | 2023-12-10 02:33:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
constexpr int N = 10'000;
string distinct_names[N+1];
signed main() {
distinct_names[0] = "a";
for(int i=1;i<=N;i++) {
int num = i;
while(num > 0) {
distinct_names[i].push_back('a' + num % 26);
num /= 26;
}
}
ll n; cin >> n;
string s;
vector <pair<ll,ll>> v(n);
for(int i = 0; i < n; i++){
cin >> s;
v[i].second = i;
v[i].first = round(stold(s) * 1e10);
}
map<ll, vector<ll>> mp;
for(auto [valor, id]: v) {
mp[valor].push_back(id);
}
vector<string> ans(n);
int cnt = 0;
for(auto &[valor, conj]: mp) {
vector<int> foo = conj;
for(auto id: conj) {
ans[id] = distinct_names[cnt];
}
cnt++;
}
for(auto s: ans) cout << s << '\n';
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 4024kb
input:
6 15L 0.88L 1.0L 1L 1000L 1024L
output:
c a b b d e
result:
ok correct
Test #2:
score: 0
Accepted
time: 1ms
memory: 3764kb
input:
3 0.03L 0.031L 0.03L
output:
a b a
result:
ok correct
Test #3:
score: 0
Accepted
time: 1ms
memory: 3912kb
input:
10 4.770735L 4.770735L 5.92862L 5.92862L 3.425951L 5.92862L 3.425951L 3.425951L 5.92862L 4.770735L
output:
b b c c a c a a c b
result:
ok correct
Test #4:
score: 0
Accepted
time: 1ms
memory: 3772kb
input:
10 7.36436L 6.289289L 2.133974L 4.457658L 4.457658L 7.710847L 7.710847L 7.710847L 0.478477L 0.478477L
output:
e d b c c f f f a a
result:
ok correct
Test #5:
score: 0
Accepted
time: 1ms
memory: 3924kb
input:
100 5.05522L 8.862544L 6.172678L 6.172678L 8.862544L 0.841998L 2.638153L 6.172678L 9.411611L 9.411611L 2.638153L 0.697531L 0.841998L 2.638153L 9.411611L 0.697531L 3.927525L 8.862544L 6.172678L 0.697531L 2.638153L 3.576146L 5.795909L 2.638153L 9.411611L 5.795909L 0.697531L 8.862544L 0.841998L 0.69753...
output:
f i h h i b c h j j c a b c j a e i h a c d g c j g a i b a b j e b a c i g d c i e a h a h e e f d i d a a e f i h d f a a c h i f b e h f c f a a e d g g h b i d c b b b h c f f b h d a a f h f c j
result:
ok correct
Test #6:
score: 0
Accepted
time: 1ms
memory: 4052kb
input:
1000 5.538973L 8.168853L 7.756989L 5.187158L 8.566494L 5.161256L 4.365565L 9.83514L 0.451117L 5.434878L 6.587507L 6.353477L 3.955333L 7.158839L 7.034269L 9.979945L 8.273649L 6.964936L 7.512418L 2.749434L 1.005619L 9.550021L 8.982797L 7.800609L 6.353477L 8.273649L 3.325318L 2.544549L 5.538973L 3.4033...
output:
ac kd dd ub md tb jb ud d wb kc ic eb tc sc vd ld rc zc s j sd od ed ic ld y q ac ab o zc rb qb fc uc xb bd uc bc nc xc md qd kb fd sb ob mb kb lb o wc d jb s m gb h lb bd fc hd sb l t xc ud xb id n fc gd bd fb ac oc oc l oc ub mb sb t wc oc ib pb kb pd bb cd bb yb zc pd ld mb cc vc j cc p lc md d d...
result:
ok correct
Test #7:
score: 0
Accepted
time: 4ms
memory: 4200kb
input:
10000 2.587081L 7.950315L 0.50137L 8.130996L 8.258044L 6.360881L 7.972785L 8.785474L 7.329022L 5.585725L 1.273491L 8.446212L 2.148699L 0.464245L 0.668281L 5.106325L 1.803361L 8.130996L 5.936396L 5.585725L 1.762492L 8.126972L 7.329022L 4.021037L 7.950315L 7.51875L 8.785474L 5.106325L 0.668281L 0.4642...
output:
z zc h dd ed kc ad kd uc ec p gd u f k vb r dd hc ec q cd uc mb zc xc kd vb k f pb zb fd i dc gb tb cb v c vb m sc cc id sd yb eb od jc kd a td ec kd bb q lc ib b id j pc qd lb oc d pc d lb ob nc b hd vc db s vb q b m ic jd k m fd p sd d pb ld ub td b pd mc m dc nc qd kc nb od wc v rd zb hc r a db u...
result:
ok correct
Test #8:
score: 0
Accepted
time: 3ms
memory: 4792kb
input:
10000 1.93645L 8.537884L 1.285027L 6.410685L 3.528163L 0.926381L 7.718155L 0.811629L 8.951888L 7.56814L 9.379188L 2.199272L 5.680321L 7.277497L 3.698285L 3.728882L 2.998746L 2.750217L 5.037808L 7.405915L 1.290851L 3.946109L 1.770729L 9.99265L 8.156179L 9.414128L 8.481497L 3.308084L 0.382196L 6.10429...
output:
iub qzh beb pyf oid xu igh ms wii wbh eti zac rhf nug ymd snd bvc hpc wse fxg geb ltd eqb shj orh zti ryh jdd gj frf smf bg aae tvd zhd hsb ieh pve qab uff ehf aaf kcj adj sti cqb ssh jac vbe wg yzb udh anh nri hci ikf fff vad muf tdd ckc hre coh osi tle jyg dch zc sfh jfb ubh yoi egh xid ulb wyh zt...
result:
ok correct
Test #9:
score: 0
Accepted
time: 1ms
memory: 3912kb
input:
11 9999.0000000000L 9999.0000000001L 9999.0000000002L 9999.0000000003L 9999.0000000004L 9999.0000000005L 9999.0000000006L 9999.0000000007L 9999.0000000008L 9999.0000000009L 9999.0000000010L
output:
a b c d e f g h i j k
result:
ok correct