You are viewing a single comment's thread. Return to all comments →
import os import sys
def process_queue(n, q, queue): # your solution here
def read_input(): return input().strip().split(' ')
def prepare(): n,q = tuple(map(int, read_input()))
preprocess_query = lambda query: [query[0]] + list(map(int, query[1:])) queries = [preprocess_query(read_input()) for _ in range(q)] return n,q,queries
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n, q, queue = prepare() solution = process_queue(n, q, queue)
fptr.write(' '.join(map(str, solution))) fptr.write('\n')
fptr.close()
Seems like cookies are disabled on this browser, please enable them to open this website
Merging Communities
You are viewing a single comment's thread. Return to all comments →
Enter your code here. Read input from STDIN. Print output to STDOUT
import os import sys
def process_queue(n, q, queue): # your solution here
def read_input(): return input().strip().split(' ')
def prepare(): n,q = tuple(map(int, read_input()))
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n, q, queue = prepare() solution = process_queue(n, q, queue)
fptr.write(' '.join(map(str, solution))) fptr.write('\n')
fptr.close()