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
const int base = 1000000000; const int base_digits = 9; | |
struct bigint { | |
vector<int> a; int sign; | |
bigint() : | |
sign(1) { | |
} | |
bigint(long long v) { | |
*this = v; |
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" | |
#else | |
#define endl '\n' | |
#endif | |
#define len(x) (uint)(x).size() | |
#define int int32_t | |
#define uint uint32_t | |
#define ulong uint64_t |
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 | |
from heapq import heappop, heappush, heapify | |
from collections import defaultdict | |
class unionfind(object): | |
def __init__(self, n): | |
self._number_of_nodes, self._count = n, n | |
self.roots, self.weights = list(xrange(n)), [1]*n | |
def union(self, a, b): |
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> | |
using namespace std; | |
#define DIM 1024 | |
#define _sq(x) ((x) * (x)) // square | |
unsigned char RD(int i, int j) { | |
return (char)(_sq(cos(atan2(j-256, i-256)/2))*255); |
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
## ☐ ☑ ☒ | |
☐ enable partner repositories | |
☐ install y-ppa-manager | |
☐ % sudo add-apt-repository -y ppa:webupd8team/y-ppa-manager | |
☐ % sudo apt-get update | |
☐ % sudo apt-get install y-ppa-manager | |
☐ media | |
☐ install vlc |
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
print '<html>hey</html>' |
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
import webbrowser | |
try: | |
1 / 0 | |
except Exception as e: | |
webbrowser.open( | |
'http://stackoverflow.com/search?q=[python]+' + \ | |
'+'.join(e.args + (type(e).__name__,))) |
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
n = int(raw_input()) | |
d = map(int, raw_input().split()) | |
dist, coun, cdis, corn = [0]*(n + 1), [1]*(n + 1), [0]*(n + 1), [0]*(n + 1) | |
for x in xrange(1, n + 1): | |
dist[x] = (4 * dist[x - 1] + coun[x - 1] * (16 * coun[x - 1] * d[x - 1] + 12 * cdis[x - 1]) + 8 * cdis[x - 1] + 12 * coun[x - 1] * d[x - 1] + d[x - 1]) % 1000000007 | |
coun[x] = (4 * coun[x - 1] + 2) % 1000000007 | |
cdis[x] = (4 * cdis[x - 1] + coun[x - 1] * 8 * d[x - 1] + 3 * coun[x - 1] * corn[x - 1] + 3 * d[x - 1] + 2 * corn[x - 1]) % 1000000007 | |
corn[x] = (2 * corn[x - 1] + 3 * d[x - 1]) % 1000000007 |
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 <stdio.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <netinet/in.h> | |
#include <sys/time.h> | |
#include <sys/types.h> |
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 | |
#define endl ('\n') | |
#define i32inf (0x7fffffff) | |
#define i32_inf (-0x7fffffff-1) | |
#define i64inf (0x7fffffffffffffff) | |
#define i64_inf (-0x7fffffffffffffff-1) | |
#define ui32inf (0xffffffffu) |