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
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) |
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
{-# 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 |
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
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()) |