QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#818808#7853. Naming Wine Bottlesucup-team3723#AC ✓8ms4248kbC++201.3kb2024-12-18 09:17:402024-12-18 09:17:40

Judging History

This is the latest submission verdict.

  • [2024-12-18 09:17:40]
  • Judged
  • Verdict: AC
  • Time: 8ms
  • Memory: 4248kb
  • [2024-12-18 09:17:40]
  • Submitted

answer

#include <bits/stdc++.h>
#define dbg(x) cerr << #x << ':' << (x) << endl;
#define ALL(x) x.begin(),x.end()
using ll = long long;
using ld = long double;
using namespace std;

int main()
{
    int n;
    cin >> n;
    auto gen = [](int x) -> string
    {
        string ret;
        while (x > 0)
        {
            ret.push_back('a' + x % 26);
            x /= 26;
        }
        return ret;
    };
    int cnt = 1;
    map<long long, string> mp;
    for (int i = 0; i < n; ++i)
    {
        string s;
        cin >> s;
        if (s.back() == 'L') s.pop_back();
        int id = s.find('.');
        if (id == -1) id = s.size();
        long long val = 0;
        for (int j = 0; j < id; ++j)
        {
            val *= 10;
            val += s[j] - '0';
        }
        if (id < s.size())
        {
            int nok = s.size() - id - 1;
            for (int j = id + 1; j < s.size(); ++j)
            {
                val *= 10;
                val += s[j] - '0';
            }
            nok = 10 - nok;
            while (nok--) val *= 10;
        }
        else
        {
            val *= 10000000000LL;
        }
        // cout << val << endl;
        if (mp.find(val) == mp.end())
        {
            mp[val] = gen(cnt);
            ++cnt;
        }
        cout << mp[val] << endl;
    }
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3560kb

input:

6
15L
0.88L
1.0L
1L
1000L
1024L

output:

b
c
d
d
e
f

result:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

3
0.03L
0.031L
0.03L

output:

b
c
b

result:

ok correct

Test #3:

score: 0
Accepted
time: 0ms
memory: 3704kb

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
d
c
d
d
c
b

result:

ok correct

Test #4:

score: 0
Accepted
time: 0ms
memory: 3440kb

input:

10
7.36436L
6.289289L
2.133974L
4.457658L
4.457658L
7.710847L
7.710847L
7.710847L
0.478477L
0.478477L

output:

b
c
d
e
e
f
f
f
g
g

result:

ok correct

Test #5:

score: 0
Accepted
time: 1ms
memory: 3708kb

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:

b
c
d
d
c
e
f
d
g
g
f
h
e
f
g
h
i
c
d
h
f
j
k
f
g
k
h
c
e
h
e
g
i
e
h
f
c
k
j
f
c
i
h
d
h
d
i
i
b
j
c
j
h
h
i
b
c
d
j
b
h
h
f
d
c
b
e
i
d
b
f
b
h
h
i
j
k
k
d
e
c
j
f
e
e
e
d
f
b
b
e
d
j
h
h
b
d
b
f
g

result:

ok correct

Test #6:

score: 0
Accepted
time: 2ms
memory: 3560kb

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:

b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
m
r
z
ab
b
bb
cb
t
db
eb
fb
gb
hb
ib
gb
jb
kb
lb
f
mb
nb
ob
pb
qb
rb
nb
sb
cb
tb
j
h
u
ub
vb
wb
sb
ib
fb
xb
pb
yb
zb
lb
i
hb
ac
bc
fb
cc
ib
dc
b
ec
ec
yb
ec
e
rb
pb
zb
tb
ec
fc
gc
nb
hc
ic
jc
ic
kc
t
hc
r
rb
lc
mc
v
lc
nc
oc
f
j
j
kc
dc
t
pc
bb
qc
yb
p...

result:

ok correct

Test #7:

score: 0
Accepted
time: 4ms
memory: 3772kb

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:

b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
e
s
k
t
u
j
v
c
w
i
q
p
o
x
y
z
ab
bb
cb
db
eb
fb
gb
q
hb
ib
jb
kb
lb
mb
nb
ob
pb
i
qb
rb
k
i
sb
t
tb
ub
vb
kb
wb
xb
yb
zb
ac
bc
xb
bc
zb
cc
dc
vb
ec
fc
gc
hc
q
t
vb
hb
ic
jc
p
hb
z
l
lb
bc
x
kc
lc
rb
vb
mc
nc
hb
bb
dc
yb
g
oc
ob
pc
fb
qc
y
s
r
qb
gc
j
m
fc
l
ob
rc
...

result:

ok correct

Test #8:

score: 0
Accepted
time: 8ms
memory: 4248kb

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:

b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
ab
bb
cb
db
eb
fb
gb
hb
ib
jb
kb
lb
mb
nb
ob
pb
qb
rb
sb
tb
ub
vb
wb
xb
yb
zb
ac
bc
cc
dc
ec
fc
gc
hc
ic
jc
kc
lc
mc
nc
oc
pc
qc
rc
sc
tc
uc
vc
wc
xc
yc
zc
ad
bd
cd
dd
ed
fd
gd
hd
id
jd
kd
ld
md
nd
od
pd
qd
rd
sd
td
ud
vd
wd
xd
yd
zd
ae
be
ce
de
ee
f...

result:

ok correct

Test #9:

score: 0
Accepted
time: 0ms
memory: 3548kb

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:

b
c
d
e
f
g
h
i
j
k
l

result:

ok correct