Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#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 */ |
This file contains 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
/** | |
* 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 |
This file contains 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
#include <iostream> | |
#include <iterator> | |
#include <numeric> | |
#include <queue> | |
#include <string> | |
#include <vector> | |
bool notblocked(const std::string& str, char c) { | |
int L = str.size(); | |
if (L < 2) return true; |
This file contains 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
#include <chrono> | |
#include <iostream> | |
#include <numeric> | |
#include <ranges> | |
#include <vector> | |
const int N = 10000000; | |
int main() { | |
auto t1 = std::chrono::steady_clock::now(); |
This file contains 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
/****************************************************************************** | |
* File: towers.cpp | |
* | |
* Author: Raziman T V | |
* Created: 04/09/20 | |
* Description: Solving the Towers puzzle | |
*****************************************************************************/ | |
#include <algorithm> | |
#include <cassert> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#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 |
NewerOlder