Submission #2163051


Source Code Expand

import math
import random

n,m=[int(i) for i in input().split()]
pp=[[0 for i in range(3)] for j in range(m)]
for i in range(m) :
    pp[i] =[int(i) for i in input().split()]

n2,m2=[int(i) for i in input().split()]
nn=int(math.sqrt(n2))
size=0

while size**2<n:
    size=size+1
#print(size)

k=1
l=0
pppp=[]
while k<=n:
   p=1
   for j in range(size):
#    print(k,p+l)
    pppp.append(p+l)
    k=k+1
    p=p+1
    
    if k>n:
       break
   l=l+nn

random.shuffle(pppp)
for i in range(n):
    print(i+1,pppp[i])

Submission Info

Submission Time
Task A - Problem 1
User Yuki_Utaai
Language Python (3.4.3)
Score 52348
Code Size 550 Byte
Status AC
Exec Time 90 ms
Memory 6768 KB

Judge Result

Set Name sample_00 sample_01 random_00 random_01 random_02 random_03 random_04 random_05 random_06 random_07 random_08 full_00 full_01 full_02 full_03 full_04 full_05 full_06 full_07 full_08 sparse_00 sparse_01 sparse_02 sparse_03 sparse_04 sparse_05 sparse_06 sparse_07 random_max full_max
Score / Max Score 7 / 1000000 112 / 1000000 813 / 1000000 4097 / 1000000 1649 / 1000000 3388 / 1000000 289 / 1000000 2338 / 1000000 2597 / 1000000 3152 / 1000000 3259 / 1000000 4193 / 1000000 2736 / 1000000 87 / 1000000 1150 / 1000000 2763 / 1000000 5044 / 1000000 1161 / 1000000 2380 / 1000000 2542 / 1000000 82 / 1000000 163 / 1000000 86 / 1000000 39 / 1000000 206 / 1000000 87 / 1000000 119 / 1000000 129 / 1000000 2409 / 1000000 5271 / 1000000
Status
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
Set Name Test Cases
sample_00 00_sample_00
sample_01 00_sample_01
random_00 10_random_00
random_01 10_random_01
random_02 10_random_02
random_03 10_random_03
random_04 10_random_04
random_05 10_random_05
random_06 10_random_06
random_07 10_random_07
random_08 10_random_08
full_00 20_full_00
full_01 20_full_01
full_02 20_full_02
full_03 20_full_03
full_04 20_full_04
full_05 20_full_05
full_06 20_full_06
full_07 20_full_07
full_08 20_full_08
sparse_00 30_sparse_00
sparse_01 30_sparse_01
sparse_02 30_sparse_02
sparse_03 30_sparse_03
sparse_04 30_sparse_04
sparse_05 30_sparse_05
sparse_06 30_sparse_06
sparse_07 30_sparse_07
random_max 60_random_max_00
full_max 70_full_max_00
Case Name Status Exec Time Memory
00_sample_00 AC 48 ms 5096 KB
00_sample_01 AC 21 ms 3316 KB
10_random_00 AC 23 ms 3444 KB
10_random_01 AC 73 ms 5364 KB
10_random_02 AC 76 ms 6252 KB
10_random_03 AC 53 ms 4596 KB
10_random_04 AC 22 ms 3444 KB
10_random_05 AC 64 ms 5232 KB
10_random_06 AC 65 ms 5108 KB
10_random_07 AC 48 ms 4468 KB
10_random_08 AC 53 ms 4596 KB
20_full_00 AC 67 ms 5108 KB
20_full_01 AC 40 ms 4084 KB
20_full_02 AC 21 ms 3316 KB
20_full_03 AC 28 ms 3572 KB
20_full_04 AC 39 ms 4084 KB
20_full_05 AC 81 ms 5620 KB
20_full_06 AC 24 ms 3572 KB
20_full_07 AC 35 ms 3956 KB
20_full_08 AC 36 ms 3956 KB
30_sparse_00 AC 26 ms 3700 KB
30_sparse_01 AC 22 ms 3444 KB
30_sparse_02 AC 25 ms 3700 KB
30_sparse_03 AC 24 ms 3700 KB
30_sparse_04 AC 28 ms 3828 KB
30_sparse_05 AC 23 ms 3572 KB
30_sparse_06 AC 24 ms 3700 KB
30_sparse_07 AC 22 ms 3444 KB
60_random_max_00 AC 90 ms 6768 KB
70_full_max_00 AC 88 ms 5876 KB