<s> '''<STR_LIT>''' <EOL> from time import clock <EOL> from runtime import * <EOL> def main ( ) : <EOL> times = test ( <NUM_LIT:3> ) <EOL> avg = sum ( times ) / len ( times ) <EOL> print ( avg ) <EOL> UID = <NUM_LIT:0> <EOL> class Vector : <EOL> def __init__ ( self , x , y , z ) : <EOL> global UID <EOL> UID += <NUM_LIT:1> <EOL> self . id = UID <EOL> self . x = x <EOL> self . y = y <EOL> self . z = z <EOL> def add ( self , other ) : <EOL> return Vector ( self . x + other . x , self . y + other . y , self . z + other . z ) <EOL> def mul ( self , other ) : <EOL> return Vector ( self . x * other . x , self . y * other . y , self . z * other . z ) <EOL> def call ( self ) : <EOL> return self . id <EOL> def benchmark ( n ) : <EOL> a = [ Vector ( i * <NUM_LIT> , i * <NUM_LIT> , i * <NUM_LIT> ) for i in range ( n ) ] <EOL> b = [ Vector ( i * <NUM_LIT> , i * <NUM_LIT> , i * <NUM_LIT> ) for i in range ( n ) ] <EOL> c = { } <EOL> for j in range ( n ) : <EOL> u = a [ j ] <EOL> v = b [ j ] <EOL> c [ u . call ( ) ] = u . add ( v ) <EOL> c [ v . call ( ) ] = u . mul ( v ) <EOL> return c <EOL> POINTS = <NUM_LIT> <EOL> def test ( arg ) : <EOL> times = [ ] <EOL> for i in range ( arg ) : <EOL> t0 = clock ( ) <EOL> o = benchmark ( POINTS ) <EOL> tk = clock ( ) <EOL> times . append ( tk - t0 ) <EOL> return times <EOL> main ( ) </s>
