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
| /* Segment Tree */ | |
| template <class S, S (*op)(S, S), S (*e)()> | |
| struct segtree { | |
| int _n; | |
| vector<S> d; | |
| segtree() : segtree(0) {} | |
| explicit segtree(int n) : segtree(vector<S>(n, e())) {} | |
| explicit segtree(vector<S> v) : _n(int(v.size())), d(4 * _n, e()) { | |
| build(v); | |
| } |
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 { useState, useEffect } from "react"; | |
| export default function BackToTop() { | |
| const [isHidden, setIsHidden] = useState(true); | |
| useEffect(() => { | |
| const handleScroll = () => { | |
| if (window.pageYOffset > 100) { | |
| setIsHidden(false); | |
| } else { |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Minesweeper</title> | |
| </head> | |
| <body> | |
| <style> |
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
| /* Copyright (c) 2021 veehz | |
| * | |
| * Vote counter | |
| * Based on Microsoft Form's Ranking Problems | |
| * The first [count] available votes will be counted for each person. | |
| * People who are selected will not be reselected | |
| * Priority will be based on the list "selections" | |
| */ | |
| const csv = require('csv-parser'); | |
| const fs = require('fs'); |