Submission #214796


Source Code Expand

Copy
#include "stdio.h"
#include "stdlib.h"
#include "algorithm"
#include "utility"
#include "queue"
#include "stack"

using namespace std;


int n,m,d;
int a[200000];

int now = -1;
int loop = 0;

int main(){


	scanf("%d %d %d",&n,&m,&d);
	for(int i=0;i<m;i++){
		scanf("%d",&a[i]);
	}
	for(int k=1;k<=n;k++){
		now = k;
		loop = 0;

		while(loop<d){
			for(int i=0;i<m;i++){
				if(a[i] == now-1){
					now--;
				}else if(a[i] == now){
					now++; 
				}
			}

			loop++;

		}
			printf("%d\n",now);
		
	}






return 0;
}

Submission Info

Submission Time
Task D - 阿弥陀
User YAZAWA
Language C++ (G++ 4.6.4)
Score 0
Code Size 573 Byte
Status TLE
Exec Time 4034 ms
Memory 1708 KB

Compile Error

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

Judge Result

Set Name Subtask1 Subtask2 Subtask3 Subtask4
Score / Max Score 0 / 10 0 / 20 0 / 20 0 / 50
Status
AC × 5
TLE × 4
AC × 15
TLE × 3
AC × 2
TLE × 16
AC × 3
TLE × 26
Set Name Test Cases
Subtask1 sample_1.txt, 01_i.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt
Subtask2 sample_1.txt, sample_2.txt, sample_3.txt, 02_i.txt, 02_p.txt, 02_random01.txt, 02_random02.txt, 02_random03.txt, 02_random04.txt, 02_random05.txt, 02_random06.txt, 02_random07.txt, 02_random08.txt, 02_rp01.txt, 02_rp02.txt, 02_rp03.txt, 02_rp04.txt, 02_rp05.txt
Subtask3 sample_1.txt, sample_2.txt, 03_i.txt, 03_random01.txt, 03_random02.txt, 03_random03.txt, 03_random04.txt, 03_random05.txt, 03_random06.txt, 03_random07.txt, 03_random08.txt, 03_random09.txt, 03_random10.txt, 03_random11.txt, 03_random12.txt, 03_random13.txt, 03_random14.txt, 03_random15.txt
Subtask4 sample_1.txt, sample_2.txt, sample_3.txt, 04_i.txt, 04_p1.txt, 04_p2.txt, 04_random01.txt, 04_random02.txt, 04_random03.txt, 04_random04.txt, 04_random05.txt, 04_random06.txt, 04_random07.txt, 04_random08.txt, 04_random09.txt, 04_random10.txt, 04_random11.txt, 04_random12.txt, 04_random13.txt, 04_rp01.txt, 04_rp02.txt, 04_rp03.txt, 04_rp04.txt, 04_rp05.txt, 04_rp06.txt, 04_rp07.txt, 04_rp08.txt, 04_rp09.txt, 04_rp10.txt
Case Name Status Exec Time Memory
01_i.txt TLE 4031 ms 1708 KB
01_random01.txt AC 23 ms 756 KB
01_random02.txt AC 22 ms 800 KB
01_random03.txt AC 22 ms 744 KB
01_random04.txt AC 66 ms 792 KB
01_random05.txt TLE 4031 ms 1516 KB
01_random06.txt TLE 4032 ms 1512 KB
01_random07.txt TLE 4034 ms 1708 KB
02_i.txt AC 2905 ms 744 KB
02_p.txt AC 1319 ms 776 KB
02_random01.txt AC 21 ms 796 KB
02_random02.txt AC 21 ms 796 KB
02_random03.txt AC 438 ms 792 KB
02_random04.txt AC 22 ms 788 KB
02_random05.txt TLE 4031 ms 880 KB
02_random06.txt AC 471 ms 1068 KB
02_random07.txt TLE 4031 ms 1640 KB
02_random08.txt TLE 4031 ms 1580 KB
02_rp01.txt AC 821 ms 788 KB
02_rp02.txt AC 743 ms 796 KB
02_rp03.txt AC 199 ms 796 KB
02_rp04.txt AC 757 ms 800 KB
02_rp05.txt AC 793 ms 760 KB
03_i.txt TLE 4030 ms 880 KB
03_random01.txt TLE 4031 ms 884 KB
03_random02.txt TLE 4031 ms 1644 KB
03_random03.txt TLE 4031 ms 1508 KB
03_random04.txt TLE 4031 ms 1448 KB
03_random05.txt TLE 4033 ms 940 KB
03_random06.txt TLE 4031 ms 996 KB
03_random07.txt TLE 4030 ms 1008 KB
03_random08.txt TLE 4031 ms 880 KB
03_random09.txt TLE 4031 ms 1124 KB
03_random10.txt TLE 4032 ms 1264 KB
03_random11.txt TLE 4031 ms 1580 KB
03_random12.txt TLE 4031 ms 1624 KB
03_random13.txt TLE 4032 ms 1368 KB
03_random14.txt TLE 4033 ms 1268 KB
03_random15.txt TLE 4031 ms 992 KB
04_i.txt TLE 4032 ms 1636 KB
04_p1.txt TLE 4031 ms 1268 KB
04_p2.txt TLE 4031 ms 1092 KB
04_random01.txt TLE 4032 ms 1256 KB
04_random02.txt TLE 4031 ms 1068 KB
04_random03.txt TLE 4030 ms 1256 KB
04_random04.txt TLE 4031 ms 1652 KB
04_random05.txt TLE 4030 ms 1492 KB
04_random06.txt TLE 4031 ms 1136 KB
04_random07.txt TLE 4031 ms 1648 KB
04_random08.txt TLE 4031 ms 1520 KB
04_random09.txt TLE 4032 ms 1576 KB
04_random10.txt TLE 4031 ms 1124 KB
04_random11.txt TLE 4031 ms 1636 KB
04_random12.txt TLE 4031 ms 1636 KB
04_random13.txt TLE 4032 ms 1640 KB
04_rp01.txt TLE 4031 ms 1264 KB
04_rp02.txt TLE 4031 ms 1196 KB
04_rp03.txt TLE 4031 ms 1264 KB
04_rp04.txt TLE 4031 ms 1260 KB
04_rp05.txt TLE 4031 ms 1260 KB
04_rp06.txt TLE 4030 ms 1188 KB
04_rp07.txt TLE 4031 ms 1256 KB
04_rp08.txt TLE 4031 ms 1192 KB
04_rp09.txt TLE 4031 ms 1156 KB
04_rp10.txt TLE 4031 ms 1248 KB
sample_1.txt AC 22 ms 792 KB
sample_2.txt AC 21 ms 792 KB
sample_3.txt AC 22 ms 796 KB