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
| /* The Computer Language Benchmarks Game | |
| https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ | |
| Contributed by Michael Ganss, derived from | |
| Regex-Redux by Josh Goldfoot | |
| order variants by execution time by Anthony Lloyd | |
| */ | |
| using System; | |
| using System.Threading.Tasks; |
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 java.util.Map; | |
| import java.util.SortedMap; | |
| import java.util.TreeMap; | |
| class Solution { | |
| public static class Range { | |
| public final int start; | |
| public final int end; |
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
| #include <Adafruit_NeoPixel.h> | |
| #include "nerf_teensy.h" | |
| Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NEOPIXEL_COUNT, PIN_LED_NEOPIXEL, NEOPIXEL_MODE); | |
| uint16_t curDispVal; | |
| uint32_t lastUpdateMillis; | |
| void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b) { |
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
| #define PIN_LED_STATUS 13 | |
| #define PIN_LED_NEOPIXEL 23 | |
| #define NEOPIXEL_COUNT 8 | |
| #define NEOPIXEL_MODE NEO_GRB+NEO_KHZ800 | |
| #define PIN_VOLTAGE_SENSOR A0 | |
| #define PIN_JUDGE_SENSOR 12 | |
| const uint8_t GAMMAS[] = { |
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 java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class Regexp { | |
| public static void main(String[] args) { | |
| final String[] strings = new String[] { | |
| "word 123 123 asd 123", | |
| "word !@#asdj asd 123 123 asd 123", | |
| "word asd -123 123 asd 123", |
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 java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class Regexp { | |
| public static void main(String[] args) { | |
| final String[] strings = new String[] { | |
| "word 123 123 asd 123", | |
| "word !@#asdj asd 123 123 asd 123", | |
| "word asd -123 123 asd 123", |
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
| 1. Первый, твой, вариант - медленный | |
| public static int sumOfDivisors(int c) { | |
| int sum = 0; | |
| for (int i = 1; i <= c - 1; i++) { | |
| if (c % i == 0) { | |
| sum = sum + i; | |
| } | |
| } |
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 java.util.*; | |
| import java.lang.*; | |
| class Main | |
| { | |
| public static void main (String[] args) throws java.lang.Exception | |
| { for(int m=0;m<=100;m++);{ | |
| isSimple(m); | |
| System.out.println(m);} | |