QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#106255#4237. Word Ladderzaxwellmen#AC ✓12ms3396kbC++201.5kb2023-05-17 03:07:422023-05-17 03:07:45

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-17 03:07:45]
  • 评测
  • 测评结果:AC
  • 用时:12ms
  • 内存:3396kb
  • [2023-05-17 03:07:42]
  • 提交

answer

#include <string>
#include <vector>
#include <iostream>

using namespace std;

int N;
string arr[51];

int main(){
    cin >> N;
    int w = 0;
    for(int k = 0; k < 51; k++){
        arr[k] = (char) ('a' + k/2);
        arr[k] += (char) ('a' + (k+1)/2);
        //cout << arr[k] << endl;
    }
    string first;
    string second;
    string third;
    for(int i = 0; i < 25; i++){
        first = arr[2*i];
        for(int j = 0; j < 26; j++){
            if(i % 2 == 0)
                second = arr[2*j];
            else
                second = arr[50 - 2*j];
            for(int k = 0; k < 51; k++){
                if(j % 2 == 0)
                    third = arr[k];
                else{
                    third = arr[50 - k];
                }
                cout << first << second << third << endl;
                w++;
                if ( w == N )
                    break;
            }
            if ( w == N )
                    break;
            if(j < 25){
                if(i % 2 == 0)
                    second = arr[2*j + 1];
                else
                    second = arr[49 - 2*j];
                cout << first << second << third << endl;
                w++;
            }
            if ( w == N )
                    break;
        }
        if ( w == N )
            break;
        first = arr[2*i + 1];
        cout << first << second << third << endl;
        w++;
        if ( w == N )
            break;
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3324kb

input:

5

output:

aaaaaa
aaaaab
aaaabb
aaaabc
aaaacc

result:

ok good solution

Test #2:

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

input:

3

output:

aaaaaa
aaaaab
aaaabb

result:

ok good solution

Test #3:

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

input:

4

output:

aaaaaa
aaaaab
aaaabb
aaaabc

result:

ok good solution

Test #4:

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

input:

6

output:

aaaaaa
aaaaab
aaaabb
aaaabc
aaaacc
aaaacd

result:

ok good solution

Test #5:

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

input:

7

output:

aaaaaa
aaaaab
aaaabb
aaaabc
aaaacc
aaaacd
aaaadd

result:

ok good solution

Test #6:

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

input:

8

output:

aaaaaa
aaaaab
aaaabb
aaaabc
aaaacc
aaaacd
aaaadd
aaaade

result:

ok good solution

Test #7:

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

input:

9

output:

aaaaaa
aaaaab
aaaabb
aaaabc
aaaacc
aaaacd
aaaadd
aaaade
aaaaee

result:

ok good solution

Test #8:

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

input:

10

output:

aaaaaa
aaaaab
aaaabb
aaaabc
aaaacc
aaaacd
aaaadd
aaaade
aaaaee
aaaaef

result:

ok good solution

Test #9:

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

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: 3ms
memory: 3384kb

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: 2ms
memory: 3316kb

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: 3ms
memory: 3316kb

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: 0ms
memory: 3308kb

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: 3ms
memory: 3276kb

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: 11ms
memory: 3380kb

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: 0ms
memory: 3316kb

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: 4ms
memory: 3348kb

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: 10ms
memory: 3388kb

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: 6ms
memory: 3320kb

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: 12ms
memory: 3396kb

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: 3ms
memory: 3388kb

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: 5ms
memory: 3380kb

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