Submission #305597


Source Code Expand

#include <iostream>
#include <cstdio>
#include <complex>
#include <set>
#include <vector>
#include <stack>
#include <tuple>
#include <algorithm>
#include <cassert>
#include <cstring>
#include <queue>
#include <string>
#include <map>

using namespace std;
typedef long long ll;
const int MD = 10100;
int c[6][MD];

int main() {
    int n;
    cin >> n;
    int d = 1;
    for (int i = 0; i < n; i++) {
        d *= 10;
    }
    int r = d;
    cout << r-1 << endl;
    int b = 1;
    int y = 0;
    for (int k = 0; k < n; k++) {
        for (int i = 0; i < d; i++) {
            for (int j = 0; j < 10; j++) {
                for (int x = 0; x < b; x++) {
                    c[k][i*b*10+j*b+x] = (y+j)%10;
                }
            }
            y = (y+9)+10;
        }
        d /= 10;
        b *= 10;
    }
    for (int i = 0; i < r; i++) {
        string s = "";
        for (int j = 0; j < n; j++) {
            s += '0'+c[j][i];
        }
        cout << s << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task A - Lock
User yosupo
Language C++11 (GCC 4.8.1)
Score 0
Code Size 1047 Byte
Status RE
Exec Time 303 ms
Memory 1008 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
AC × 2
AC × 3
RE × 2
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 24 ms 796 KB
subtask0_sample_02.txt AC 23 ms 796 KB
subtask1_01.txt AC 27 ms 792 KB
subtask1_02.txt RE 303 ms 928 KB
subtask1_03.txt RE 267 ms 1008 KB