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
// [first, from) and [to, last) are non-overlapping ranges | |
template<class Iter> | |
void reverse_gapped(Iter first, Iter from, Iter to, Iter last) { | |
if (from == to) { | |
std::reverse(first, last); | |
return; | |
} | |
if (first == from) { | |
std::reverse(to, last); | |
return; |
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/env python3 | |
import sys | |
import glob | |
import os | |
import struct | |
import codecs | |
from PIL import Image, ImageTk | |
from itertools import product |
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 "grader.h" | |
#include "encoder.h" | |
#include "decoder.h" | |
#include <algorithm> | |
#include <vector> | |
#include <iostream> | |
// No communication/shared data between two namespaces please. | |
namespace Encoder | |
{ |
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 "question.h" | |
using namespace std; | |
// Dummy implmenentation. | |
// No communication between two namespaces please. | |
namespace PlayerA | |
{ | |
int arr[13] = {1, 1, 2, 3, 6, 10, 20, 35, 70, 126, 252, 462, 924}; |
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; | |
using llint = long long; | |
const int MAXN = 100100; | |
const llint MOD = 1e9; | |
int n; | |
pair<int, int> points[MAXN]; |
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; | |
using llint = long long; | |
const int MAXN = 1<<19; | |
const llint INF = 1ll<<60; | |
struct fair |
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; | |
const int INF = 1<<20; | |
string s; | |
template<typename T1, typename T2> | |
inline ostream& operator<<(ostream& in, const pair<T1, T2>& x) |
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 "horses.h" | |
#include <set> | |
#include <iostream> | |
using namespace std; | |
typedef long long llint; | |
const int MAXN = 1<<19; | |
const llint MAX = 1<<30; |
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 "boxes.h" | |
#include <algorithm> | |
using namespace std; | |
const int MAXN = 5<<22; | |
long long pref[MAXN], suff[MAXN]; | |
long long delivery(int n, int k, int l, int p[]) |
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 "scales.h" | |
#include <map> | |
#include <set> | |
#include <cassert> | |
#include <algorithm> | |
using namespace std; | |
inline int _getMedian(int arr[6], int a, int b, int c) | |
{ |
NewerOlder