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
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
namespace Rotate | |
{ | |
class Program | |
{ |
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<map> | |
using namespace std; | |
map<char, int> t9; | |
void solve() { | |
char prev = -1, cur; | |
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
# Analysis: | |
# | |
# Let's try to find the optimal range. We know that | |
# 1. 918273645 is a 1-9 pandigital & is a concatenated product, which means that this number is either the largest or | |
# below it, so we search from this number up | |
# 2. Then we find that the number we're trying to search for should start with 9, e.g. 9, 91, 945, etc | |
# 3. len(concat_product(x=90, n=3)) = 8, len(concat_product(x=90, n=4)) = 11. This range won't work. | |
# 4. len(concat_product(x=9000, n=2)) = 9. This is where we should start. | |
# 5. Taking #1 in consideration, we will start from 9182 till 9999 | |
# 6. To get the pandigital number from a this range, we can multiply by n * 100000 + n * 2 => n * 100002 |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
namespace pandigital | |
{ | |
class Program | |
{ |
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
from bottle import route, run, template, request | |
index_template = '''<table width=100% height=100% border=1> | |
<tr> | |
<td width=50%> | |
<textarea style="width: 100%; height: 100%"></textarea> | |
</td> | |
<td> | |
<div id="result"> | |
</div> |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
namespace sqr | |
{ | |
class result |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Diagnostics; | |
namespace sqr | |
{ | |
class Program | |
{ |
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
public class t { | |
public static void main(String[] args) { | |
int current_val = 0, counter = 0; | |
for (int i = 1; i < 10000000; i++) { | |
current_val = i; | |
while (current_val != 1) { | |
current_val = calculateSquares(current_val); | |
if (current_val == 89) { |
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
int resualt=GetSquareDigitChains(2,10000000); | |
static int GetSquareDigitChains(int strt, int end) | |
{ | |
int i = 0; | |
for (; strt < end; strt++) | |
{ | |
int nextstrt = 0; | |
int strtTemp = strt; |