-rwxr-xr-x 1099 djbsort-20180710/verif/tryinput
#!/usr/bin/env python3 import sys import hashlib import struct n = int(sys.argv[1]) original = [] for i in range(n): h = hashlib.sha256() h.update(str([n,i]).encode('utf-8')) h = h.digest() h = h[:4] h = struct.unpack('<L',h)[0] original += [h] print('in_%d_32 = [32,%d]' % (i,h)) print(""" def Min(x,y): assert x[0] == y[0] return x[0],min(x[1],y[1]) def Max(x,y): assert x[0] == y[0] return x[0],max(x[1],y[1]) def SLE(x,y): assert x[0] == y[0] return 1,(x[1] <= y[1]) def Extract(x,top,bot): assert x[0] > top assert top > bot assert bot >= 0 return top + 1 - bot,((x[1] & ((2 << top) - 1)) >> bot) def If(c,x,y): assert x[0] == y[0] assert c[0] == 1 if c[1]: return x return y def Concat(a,b,c,d): pos,value = 0,0 pos,value = pos + d[0],value + (d[1] << pos) pos,value = pos + c[0],value + (c[1] << pos) pos,value = pos + b[0],value + (b[1] << pos) pos,value = pos + a[0],value + (a[1] << pos) return pos,value """) print(sys.stdin.read()) original.sort() for i in range(n): print('assert out%d[1] == %d' % (i,original[i]))