Skip to content

Instantly share code, notes, and snippets.

View tsych0's full-sized avatar
🎯
Focusing

Ayush Biswas tsych0

🎯
Focusing
View GitHub Profile
@tsych0
tsych0 / template.rs
Last active September 6, 2025 05:56
Rust code template for competitve programming
use cpio::*;
sol_n! {
fn solution(
n: usize,
a: [usize]
) -> usize {
let b = a.iter().min().unwrap();
let c = a.iter().max().unwrap();
(c - b) * (n - 1)
@tsych0
tsych0 / codeforces_template.hs
Last active May 10, 2025 09:20 — forked from mihassan/codeforces_template.hs
Haskell code template for competitive programming
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import Data.Array (Array, listArray, (!))
import Data.Array qualified as Array
import Data.Bool
@tsych0
tsych0 / gentokenjson.py
Last active July 13, 2023 10:55 — forked from proffapt/gentokenjson.py
Script to generate `token.json` from `credentials.json` file for gmail enabled google api
import sys
from google_auth_oauthlib.flow import InstalledAppFlow
scopes = [f"https://www.googleapis.com/auth/gmail.{sys.argv[1]}"]
flow = InstalledAppFlow.from_client_secrets_file("credentials.json", scopes)
creds = flow.run_local_server(port=0)
with open("token.json", "w") as token:
token.write(creds.to_json())