Skip to content

Instantly share code, notes, and snippets.

View viliml's full-sized avatar

Vilim Lendvaj viliml

  • Popovača, Hrvatska
View GitHub Profile
@viliml
viliml / next_combination.cpp
Last active April 23, 2024 18:53
Generates all k-combinations of a range that may contain equal elements
// [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;
@viliml
viliml / YUNO_Switch_BG_viewer_GUI.py
Last active May 24, 2019 20:02
With much code copying from Nimms <nimms@ya.ru> and anon
#!/usr/bin/env python3
import sys
import glob
import os
import struct
import codecs
from PIL import Image, ImageTk
from itertools import product
#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
{
#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};
#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];
#include <bits/stdc++.h>
using namespace std;
using llint = long long;
const int MAXN = 1<<19;
const llint INF = 1ll<<60;
struct fair
#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)
#include "horses.h"
#include <set>
#include <iostream>
using namespace std;
typedef long long llint;
const int MAXN = 1<<19;
const llint MAX = 1<<30;
#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[])
#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)
{