Submission #214430


Source Code Expand

Copy
#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
   int N, M, D;
   int Am[200000];
   int result[100000];
//   cin >> N >> M >> D;
   scanf("%d %d %d", &N, &M, &D );

   for( int k = 0; k < M; k++ )
      scanf("%d", &Am[k] );
//      cin >> Am[k];

   //////
   /////
   int i, col_val, j;
   
   //全ての縦線を試す
   for( col_val = 0; col_val < N; col_val++ ) {
      //Dがあるだけ繰り返す
      for( i = 0; i < D; i++ ) {
	 if( i == 0 ) result[ col_val ] = col_val + 1;
	 //全てのあみだ横線を処理
	 for( j = 0; j < M; j++ ) {
	    //横線左側にかかっていれば
	    if( Am[ j ] == result[ col_val ] ) 
	       result[col_val ]++;
	    else if( ( Am[ j ] + 1 ) == result[ col_val ] )
	       result[ col_val ]--;
	 }
      }
      printf("%d\n", result[ col_val ] );
   }

   /*
   //output
   for( col_val = 0; col_val < N; col_val++ )
      printf("%d\n", result[ col_val ] );
//      cout << result[ col_val ] << endl;
*/
}

Submission Info

Submission Time
Task D - 阿弥陀
User Takayama
Language C++ (G++ 4.6.4)
Score 0
Code Size 1036 Byte
Status TLE
Exec Time 4051 ms
Memory 1824 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:13:27: 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 4032 ms 1812 KB
01_random01.txt AC 22 ms 932 KB
01_random02.txt AC 22 ms 804 KB
01_random03.txt AC 22 ms 916 KB
01_random04.txt AC 68 ms 804 KB
01_random05.txt TLE 4030 ms 1824 KB
01_random06.txt TLE 4031 ms 1648 KB
01_random07.txt TLE 4031 ms 1812 KB
02_i.txt AC 2915 ms 812 KB
02_p.txt AC 1331 ms 744 KB
02_random01.txt AC 23 ms 916 KB
02_random02.txt AC 21 ms 924 KB
02_random03.txt AC 441 ms 920 KB
02_random04.txt AC 24 ms 800 KB
02_random05.txt TLE 4031 ms 896 KB
02_random06.txt AC 474 ms 1184 KB
02_random07.txt TLE 4030 ms 1700 KB
02_random08.txt TLE 4030 ms 1708 KB
02_rp01.txt AC 822 ms 792 KB
02_rp02.txt AC 750 ms 928 KB
02_rp03.txt AC 201 ms 804 KB
02_rp04.txt AC 765 ms 808 KB
02_rp05.txt AC 799 ms 792 KB
03_i.txt TLE 4031 ms 928 KB
03_random01.txt TLE 4030 ms 932 KB
03_random02.txt TLE 4030 ms 1580 KB
03_random03.txt TLE 4028 ms 1448 KB
03_random04.txt TLE 4030 ms 1444 KB
03_random05.txt TLE 4035 ms 932 KB
03_random06.txt TLE 4030 ms 936 KB
03_random07.txt TLE 4030 ms 1052 KB
03_random08.txt TLE 4030 ms 928 KB
03_random09.txt TLE 4031 ms 1064 KB
03_random10.txt TLE 4030 ms 1320 KB
03_random11.txt TLE 4031 ms 1512 KB
03_random12.txt TLE 4030 ms 1576 KB
03_random13.txt TLE 4030 ms 1440 KB
03_random14.txt TLE 4030 ms 1320 KB
03_random15.txt TLE 4030 ms 1056 KB
04_i.txt TLE 4051 ms 240 KB
04_p1.txt TLE 4030 ms 1192 KB
04_p2.txt TLE 4029 ms 1176 KB
04_random01.txt TLE 4035 ms 1316 KB
04_random02.txt TLE 4031 ms 1056 KB
04_random03.txt TLE 4031 ms 1316 KB
04_random04.txt TLE 4031 ms 1572 KB
04_random05.txt TLE 4031 ms 1440 KB
04_random06.txt TLE 4030 ms 1192 KB
04_random07.txt TLE 4032 ms 1560 KB
04_random08.txt TLE 4030 ms 1576 KB
04_random09.txt TLE 4029 ms 1700 KB
04_random10.txt TLE 4030 ms 1064 KB
04_random11.txt TLE 4031 ms 1692 KB
04_random12.txt TLE 4030 ms 1704 KB
04_random13.txt TLE 4030 ms 1700 KB
04_rp01.txt TLE 4030 ms 1320 KB
04_rp02.txt TLE 4030 ms 1312 KB
04_rp03.txt TLE 4030 ms 1312 KB
04_rp04.txt TLE 4031 ms 1196 KB
04_rp05.txt TLE 4031 ms 1312 KB
04_rp06.txt TLE 4030 ms 1320 KB
04_rp07.txt TLE 4030 ms 1312 KB
04_rp08.txt TLE 4030 ms 1320 KB
04_rp09.txt TLE 4031 ms 1192 KB
04_rp10.txt TLE 4030 ms 1308 KB
sample_1.txt AC 22 ms 796 KB
sample_2.txt AC 22 ms 924 KB
sample_3.txt AC 23 ms 920 KB