Skip to content

Instantly share code, notes, and snippets.

View razimantv's full-sized avatar

Raziman T V razimantv

  • Imperial College London
  • London, United Kingdom
  • X @razimantv
View GitHub Profile
@razimantv
razimantv / strikerates.ipynb
Created November 16, 2023 00:04
Strike rate statistics
View strikerates.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / superman.cpp
Last active November 12, 2023 14:35
Superman Diwali solution
View superman.cpp
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
@razimantv
razimantv / splitgame.cpp
Created September 25, 2023 09:50
Split game solver
View splitgame.cpp
/**
* Two-Player Split Game Solver
*
* This C++ program solves a two-player game played with two hands
*
* - Two players take turns, starting with two fingers out on each hand
* - Each turn, a player can add the number of fingers on one of their hands to
* that of their opponent (addition wraps around after 5)
* - If the numbers on a hand become 5, it resets to 0
* - If one hand is empty and the other has an even number, it can be split
@razimantv
razimantv / primes.cpp
Last active October 12, 2020 02:50
Comparing prime generation the old way and the C++20 way
View primes.cpp
#include <chrono>
#include <iostream>
#include <numeric>
#include <ranges>
#include <vector>
const int N = 10000000;
int main() {
auto t1 = std::chrono::steady_clock::now();
@razimantv
razimantv / towers.cpp
Created April 9, 2020 20:04
Solution to the towers puzzle
View towers.cpp
/******************************************************************************
* File: towers.cpp
*
* Author: Raziman T V
* Created: 04/09/20
* Description: Solving the Towers puzzle
*****************************************************************************/
#include <algorithm>
#include <cassert>
@razimantv
razimantv / Randomstrip.ipynb
Created February 18, 2019 19:05
Generate random points in an angle range around a given latitude and longitude
View Randomstrip.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View IqbalPuzzle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / population_evolution.cpp
Last active November 20, 2018 21:50
Dependence of population evolution on age of giving birth
View population_evolution.cpp
#include <fstream>
#include <iostream>
#include <random>
#include <set>
#include <string>
#include <tuple>
// Birth/death events
// If birth: time, +1, 0
// If death: time, -1, birthday
@razimantv
razimantv / Pi_MC.ipynb
Created October 4, 2018 12:37
Monte Carlo estimation of Pi
View Pi_MC.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@razimantv
razimantv / ImpossiblePuzzle.ipynb
Last active October 4, 2018 00:50
Programmatic solution to the "Impossible puzzle"
View ImpossiblePuzzle.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.