Submission #305669


Source Code Expand

#include <stdio.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    int n;
    scanf("%d", &n);
    int k = 1;
    rep (i, n) k *= 10;
    printf("%d\n", k-1);
    char buf[10];
    sprintf(buf, "%%0%dd\n", n);
    rep (i, k) {
        int x = i;
        if (i / 10 % 2) x = x - x%10 + (9 - x%10);
        if (i / 100 % 2) x = x - x/10%10*10 + (9 - x/10%10)*10;
        if (i / 1000 % 2) x = x - x/100%10*100 + (9 - x/100%10)*100;
        if (i / 10000 % 2) x = x - x/1000%10*1000 + (9 - x/1000%10)*1000;
        printf(buf, x);
    }
    return 0;
}

Submission Info

Submission Time
Task A - Lock
User kohyatoh
Language C++ (G++ 4.6.4)
Score 100
Code Size 611 Byte
Status AC
Exec Time 74 ms
Memory 796 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:20: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 5
Set Name Test Cases
Sample subtask0_sample_01.txt, subtask0_sample_02.txt
All subtask0_sample_01.txt, subtask0_sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt AC 22 ms 796 KB
subtask0_sample_02.txt AC 23 ms 792 KB
subtask1_01.txt AC 24 ms 672 KB
subtask1_02.txt AC 27 ms 796 KB
subtask1_03.txt AC 74 ms 672 KB