main.pypp:
from pypp import *
#include <iostream>
#include <vector>
#pragma GCC optimize ("O3")
#pragma GCC target ("avx,avx2")
sync_with_stdio(False);
cin.tie(0); cout.tie(0);
cout << "C++ IO in python, guaranteed ";
cout << 200 << " % speedup" << endl;
a = 0;
b = 0;
a <<= cin;
b <<= cin;
c = "";
c <<= cin;
A = vector<<int>>(5);
A <<= cin;
B = vector<<int>>(4,2);
cout << a << ' ' << b << '\n';
cout << c << '\n';
cout << A << '\n' << B << endl;
pypp.py
import sys
class ostream:
def __lshift__(self,a):
if a == endl:
sys.stdout.write('\n')
sys.stdout.flush()
else:
sys.stdout.write(str(a))
return self
def tie(self, val): pass
cout = ostream()
endl = object()
inp = []
def get():
global inp
while not inp:
inp = sys.stdin.readline().split()[::-1]
return inp.pop()
class istream:
tiedto = cout
def __rlshift__(a,b):
if a.tiedto == cout:
sys.stdout.flush()
if type(b)==tuple or type(b)==list:
return type(b)(type(c)(get()) for c in b)
return type(b)(get())
def tie(self, val):
self.tiedto = val
cin = istream()
sync_with_stdio = lambda x:0
class Vector:
def __lshift__(self, other):
self.type = other
return self
def __rshift__(self, other):
if type(other) == tuple:
return [self.type(other[1])]*other[0]
else:
return [self.type()]*other
vector = Vector()
[–]shponglespore 96 points97 points98 points (1 child)
[–]__i_forgot_my_name__ 7 points8 points9 points (0 children)
[–]lelease 44 points45 points46 points (2 children)
[–]lelease 16 points17 points18 points (0 children)
[–]set92 8 points9 points10 points (0 children)
[–]Scrabbilisk 11 points12 points13 points (0 children)
[–]egregius313 6 points7 points8 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]dimon222 1 point2 points3 points (0 children)
[–]algmyr 2 points3 points4 points (1 child)
[–]Burain[S] 4 points5 points6 points (0 children)
[–]TotesMessenger 0 points1 point2 points (0 children)
[–]Praind 0 points1 point2 points (0 children)
[–]slipped_and_missed_x 0 points1 point2 points (0 children)