Skip to content

Instantly share code, notes, and snippets.

from itertools import count, takewhile, accumulate
import operator
from pprint import pprint
def to_task_name(n):
return chr(ord('A') + n)
def create_tasks_iter(first_time, last_time):
from functools import reduce
from itertools import count, permutations
from pprint import pprint
def to_task_name(n):
return chr(ord('A') + n)
def name_time_cost_to_task(t):
<!DOCTYPE html>
<!-- saved from url=(0072)http://planfact.ru/project.html?executedFunction=article&articleId=24126 -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Статья</title>
<link href="http://planfact.ru/custom.css" rel="stylesheet">
<link href="http://planfact.ru/osans.css" rel="stylesheet">
@soon
soon / MapTest
Last active August 29, 2015 14:14
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SampleAi;
namespace Tests
{
[TestClass]
public class MapTests
{
#region Tests
@soon
soon / Program.cs
Last active August 29, 2015 14:14
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace SampleAi
{
[DebuggerDisplay("Pont({X}, {Y})")]
public class Point
{
var username = document.getElementsByTagName('h1')[0].innerText;
var gameTable = document.getElementsByClassName('gamesTable')[0];
for(var i = 1, row; row = gameTable.rows[i]; ++i) {
winner = row.cells[4].children[0].children[0];
winnerPlace = row.cells[7].children[0].innerText;
loserPlace = row.cells[7].children[2].innerText;
if(winner.title == username && winnerPlace != loserPlace) {
row.hidden = true;
import os
with open('original', 'r') as o:
original = set(o.readlines())
with open('report.txt', 'w') as report:
for subdir, _, files in os.walk('submissions_462'):
for f in files:
with open(os.path.join(subdir, f), 'r') as file:
s = set(file.readlines())
#!/usr/bin/env python3
from itertools import islice
from bs4 import BeautifulSoup
from codeforces import CodeforcesAPI, VerdictType
from urllib import request
import sys
def load_source_code_from_submission(submission):