답안 #95186

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
95186 2019-01-28T10:39:29 Z MohamedAhmed0 Esej (COCI15_esej) C++14
80 / 80
9 ms 1272 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a , b ;
    cin>>a>>b ;
    string ans = "" ;
    for(int i = 0 ; i < 9 ; ++i)
        ans += (char)('a' + i) ;
    int stop = max(a , (b+1)/2);
    int cnt = 0 ;
    do
    {
        cout<<ans<<" ";
        cnt++;
        if(cnt == stop)
            return 0 ;
    }
    while(next_permutation(ans.begin() , ans.end()));
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 3 ms 376 KB Output is correct
7 Correct 5 ms 760 KB Output is correct
8 Correct 8 ms 1144 KB Output is correct
9 Correct 9 ms 1272 KB Output is correct
10 Correct 5 ms 888 KB Output is correct