QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#745144 | #4237. Word Ladder | ngpin04# | AC ✓ | 2ms | 4272kb | C++14 | 1.2kb | 2024-11-14 07:03:50 | 2024-11-14 07:03:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
vector<int> a(6, 0);
vector<string> ans;
auto add = [&](vector<int> &x) -> void {
string str;
for (int v : x) {
str += (char) (v + 'a');
}
ans.push_back(str);
};
auto inc = [&](int i) -> void {
a[i]++;
a[i] %= 26;
};
add(a);
for (int i = 0; i < 25; i++) {
for (int j = 0; j < 25; j++) {
for (int k = 0; k < 25; k++) {
inc(5);
add(a);
inc(4);
add(a);
}
inc(3);
add(a);
inc(2);
add(a);
}
inc(1);
add(a);
inc(0);
add(a);
}
int n; cin >> n;
// for (int i = 0; i < n; i++) {
// for (int j = i + 2; j < n; j++) {
// int dif = 0;
// for (int k = 0; k < 6; k++) {
// dif += ans[i][k] != ans[j][k];
// }
// assert(dif > 1);
// }
// }
for (int i = 0; i < n; i++) {
cout << ans[i] << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 4196kb
input:
5
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc
result:
ok good solution
Test #2:
score: 0
Accepted
time: 1ms
memory: 4168kb
input:
3
output:
aaaaaa aaaaab aaaabb
result:
ok good solution
Test #3:
score: 0
Accepted
time: 1ms
memory: 3972kb
input:
4
output:
aaaaaa aaaaab aaaabb aaaabc
result:
ok good solution
Test #4:
score: 0
Accepted
time: 1ms
memory: 4132kb
input:
6
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd
result:
ok good solution
Test #5:
score: 0
Accepted
time: 1ms
memory: 3976kb
input:
7
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd
result:
ok good solution
Test #6:
score: 0
Accepted
time: 1ms
memory: 4244kb
input:
8
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade
result:
ok good solution
Test #7:
score: 0
Accepted
time: 1ms
memory: 4112kb
input:
9
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee
result:
ok good solution
Test #8:
score: 0
Accepted
time: 0ms
memory: 3968kb
input:
10
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef
result:
ok good solution
Test #9:
score: 0
Accepted
time: 1ms
memory: 4248kb
input:
64
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #10:
score: 0
Accepted
time: 1ms
memory: 4184kb
input:
51
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #11:
score: 0
Accepted
time: 1ms
memory: 4000kb
input:
97
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #12:
score: 0
Accepted
time: 0ms
memory: 4132kb
input:
100
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #13:
score: 0
Accepted
time: 1ms
memory: 4004kb
input:
1000
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #14:
score: 0
Accepted
time: 0ms
memory: 4272kb
input:
1001
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #15:
score: 0
Accepted
time: 1ms
memory: 4064kb
input:
1024
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #16:
score: 0
Accepted
time: 1ms
memory: 4068kb
input:
1025
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #17:
score: 0
Accepted
time: 2ms
memory: 4104kb
input:
5000
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #18:
score: 0
Accepted
time: 2ms
memory: 4112kb
input:
4999
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #19:
score: 0
Accepted
time: 0ms
memory: 4064kb
input:
4096
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #20:
score: 0
Accepted
time: 2ms
memory: 4064kb
input:
4097
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #21:
score: 0
Accepted
time: 2ms
memory: 4136kb
input:
4098
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution
Test #22:
score: 0
Accepted
time: 0ms
memory: 4084kb
input:
3751
output:
aaaaaa aaaaab aaaabb aaaabc aaaacc aaaacd aaaadd aaaade aaaaee aaaaef aaaaff aaaafg aaaagg aaaagh aaaahh aaaahi aaaaii aaaaij aaaajj aaaajk aaaakk aaaakl aaaall aaaalm aaaamm aaaamn aaaann aaaano aaaaoo aaaaop aaaapp aaaapq aaaaqq aaaaqr aaaarr aaaars aaaass aaaast aaaatt aaaatu aaaauu aaaauv aaaavv...
result:
ok good solution