Skip to content

Instantly share code, notes, and snippets.

View Acarus's full-sized avatar

Oleh Klishch Acarus

View GitHub Profile
@Acarus
Acarus / Main.java
Created December 31, 2018 21:27
Execute me
public class Main {
public static void main(String[] args) {
int[] msg = {73, 110, 32, 84, 104, 101, 32, 78, 101, 119, 32, 89, 101, 97, 114, 44, 10, 119, 101, 32, 119, 105, 115, 104, 32, 121, 111, 117, 32, 116, 104, 101, 32, 98, 101, 115, 116, 32, 121, 101, 97, 114, 32, 121, 111, 117, -30, -128, -103, 118, 101, 32, 101, 118, 101, 114, 32, 104, 97, 100, 44, 10, 97, 110, 100, 32, 116, 104, 97, 116, 32, 101, 97, 99, 104, 32, 78, 101, 119, 32, 89, 101, 97, 114, 10, 119, 105, 108, 108, 32, 98, 101, 32, 98, 101, 116, 116, 101, 114, 32, 116, 104, 97, 110, 32, 116, 104, 101, 32, 108, 97, 115, 116, 46, 10, 77, 97, 121, 32, 121, 111, 117, 32, 114, 101, 97, 108, 105, 122, 101, 32, 121, 111, 117, 114, 32, 102, 111, 110, 100, 101, 115, 116, 32, 100, 114, 101, 97, 109, 115, 10, 97, 110, 100, 32, 116, 97, 107, 101, 32, 116, 105, 109, 101, 32, 116, 111, 32, 114, 101, 99, 111, 103, 110, 105, 122, 101, 32, 97, 110, 100, 32, 101, 110, 106, 111, 121, 10, 101, 97, 99, 104, 32, 97, 110, 100, 32, 101, 118, 101, 114, 121
@Acarus
Acarus / main.cc
Last active December 31, 2018 21:16
Execute me
#include <vector>
#include <iostream>
using namespace std;
int main () {
vector<int> msg{73, 110, 32, 84, 104, 101, 32, 78, 101, 119, 32, 89, 101, 97, 114, 44, 10, 119, 101, 32, 119, 105, 115, 104, 32, 121, 111, 117, 32, 116, 104, 101, 32, 98, 101, 115, 116, 32, 121, 101, 97, 114, 32, 121, 111, 117, -30, -128, -103, 118, 101, 32, 101, 118, 101, 114, 32, 104, 97, 100, 44, 10, 97, 110, 100, 32, 116, 104, 97, 116, 32, 101, 97, 99, 104, 32, 78, 101, 119, 32, 89, 101, 97, 114, 10, 119, 105, 108, 108, 32, 98, 101, 32, 98, 101, 116, 116, 101, 114, 32, 116, 104, 97, 110, 32, 116, 104, 101, 32, 108, 97, 115, 116, 46, 10, 77, 97, 121, 32, 121, 111, 117, 32, 114, 101, 97, 108, 105, 122, 101, 32, 121, 111, 117, 114, 32, 102, 111, 110, 100, 101, 115, 116, 32, 100, 114, 101, 97, 109, 115, 10, 97, 110, 100, 32, 116, 97, 107, 101, 32, 116, 105, 109, 101, 32, 116, 111, 32, 114, 101, 99, 111, 103, 110, 105, 122, 101, 32, 97, 110, 100, 32, 101, 110, 106, 111, 121, 10, 101, 97, 99, 104, 32, 97, 110, 100, 32, 101, 118, 101, 1
@Acarus
Acarus / main.cc
Created December 10, 2018 23:17
Total destruction
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
int get(vector<int>& parent, int v) {
if (parent[v] == v) return v;
return parent[v] = get(parent, parent[v]);
}
@Acarus
Acarus / main.cpp
Created May 9, 2017 17:04
Шифрування через XOR
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
string encrypt(string text) {
char key = 15;
for (int i = 0; i < text.size(); ++i) {
#include <iostream>
#include <string>
using namespace std;
string solve(int num, string rem, int n) {
if (n == 0) {
if (rem[0] >= '5') return to_string(num + 1);
else return to_string(num);
} else {
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll solve(int v, vector<ll>& arr, vector<vector<int>>& tree, bool f) {
ll ans = arr[v];
for (int to: tree[v]) {
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main(int argc, char **argv) {
ios::sync_with_stdio(false);
srand(time(0));
public class Quine
{
public static void main(String[] args)
{
char q = 34; // Quotation mark character
String[] l = { // Array of source code
"public class Quine",
"{",
" public static void main(String[] args)",
" {",
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
inline bool eq(vector<int>& a, vector<int>& b, int l, int r) {
for (int i = l; i <= r; ++i) {
if (a[i] != b[i])return false;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int kSize = 101;
int main() {
#ifdef HOME