Submission #305575


Source Code Expand

#include<stdio.h>
#include<algorithm>
using namespace std;
int p10[7];
int main(){
	int a;
	p10[0]=1;
	for(int i=1;i<7;i++)p10[i]=p10[i-1]*10;
	scanf("%d",&a);
	int val=1;
	for(int i=0;i<a;i++)val*=10;
	val--;
	printf("%d\n",val);
	for(int i=0;i<=val;i++){
		for(int j=0;j<a;j++){
			if(i/p10[a-j]%2)printf("%d",9-i%p10[a-j]/p10[a-j-1]);
			else printf("%d",i%p10[a-j]/p10[a-j-1]);
		}
		printf("\n");
	}
}

Submission Info

Submission Time
Task A - Lock
User tozangezan
Language C++ (G++ 4.6.4)
Score 100
Code Size 426 Byte
Status AC
Exec Time 95 ms
Memory 800 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:16: 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 20 ms 708 KB
subtask0_sample_02.txt AC 21 ms 704 KB
subtask1_01.txt AC 21 ms 800 KB
subtask1_02.txt AC 30 ms 792 KB
subtask1_03.txt AC 95 ms 672 KB