This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import stdin | |
class segmenttree(object): | |
def __init__(self, arr): | |
self.arr = arr | |
self.tree = [(float('-inf'), 0)]*(8*len(arr)) | |
for x in xrange(len(arr)): | |
self.setval = arr[x] | |
self.setind = x | |
self.set(0, len(arr), 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import stdin | |
class segmenttree(object): | |
def __init__(self, arr): | |
self.arr = arr | |
self.tree = [(float('-inf'), 0)]*(8*len(arr)) | |
for x in xrange(len(arr)): | |
self.setval = arr[x] | |
self.setind = x | |
self.set(0, len(arr), 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#ifdef __mr__ | |
#include "prettyprint.hpp" | |
#endif | |
#ifndef __mr__ | |
#define endl '\n' | |
#endif | |
#define ulong unsigned long | |
#define uint unsigned int | |
#define uset unordered_set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import stdin | |
def main(): | |
nextint = iter(map(int, stdin.read().split())).next | |
positions = [[] for _ in xrange(100000)] | |
for x in xrange(2): | |
positions[x].append(x) | |
a, b = 0, 1 | |
for x in xrange(2, 150000): | |
a, b = b, ((a + b) % 100000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Gudea"> | |
<link rel="shortcut icon" href="http://faviconist.com/icons/f9294cc2281f1004e846adbea5f4b316/favicon.ico" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<title>Srinivas Devaki</title> | |
<meta charset="utf-8"> | |
<!-- <link href="main.css" media="screen" rel="stylesheet" type="text/css" /> --> | |
<style type="text/css"> | |
body { | |
background-color: white; | |
font-family: 'Gudea', sans-serif; | |
margin: 5% 15% 5% 15%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#ifdef __lucy__ | |
#include "prettyprint.hpp" | |
#endif | |
#define endl ('\n') | |
using namespace std; | |
int32_t* arr = new int32_t[1001]; | |
int32_t* dp = new int32_t[1001]; | |
uint32_t n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#ifdef __lucy__ | |
#include "prettyprint.hpp" | |
#endif | |
#define endl ('\n') | |
#define len(x) ((uint32_t)(x).size()) | |
#define umap unordered_map | |
#define uset unordered_set | |
using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#ifdef __lucy__ | |
#include "prettyprint.hpp" | |
#endif | |
#define endl ('\n') | |
#define i32max (0x7fffffff) | |
#define i32min (-0x7fffffff-1) | |
#define i64max (0x7fffffffffffffff) | |
#define i64min (-0x7fffffffffffffff-1) | |
#define ui32max (0xffffffffu) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- encoding: utf-8 -*- | |
# pylint: disable=invalid-name,missing-docstring,bad-builtin | |
from sys import stdin | |
def main(): | |
dstream = iter(stdin.read().split()) | |
for _ in xrange(int(next(dstream))): | |
n, k, play = next(dstream), next(dstream), next(dstream) | |
play, turns = bytearray(play), int(n) - int(k) |