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
#!/usr/bin/env python3 | |
# A perfect number is a number for which the sum of its proper divisors | |
# is exactly equal to the number. For example, the sum of the proper | |
# divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 | |
# is a perfect number. | |
# A number n is called deficient if the sum of its proper divisors is | |
# less than n and it is called abundant if this sum exceeds n. |
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
def solution(A): | |
o = {} | |
for v in A: | |
o[v] = o.get(v, 0) + 1 | |
import operator | |
s = sorted(o.items(), key=operator.itemgetter(1)) | |
s.reverse() | |
return A.index(s[0][0]) |
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
def solution(A): | |
found = [False] * (len(A) + 1) | |
for v in A: | |
found[v-1] = True | |
return found.index(False) + 1 |
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
ENTRY(Reset_Handler) | |
MEMORY | |
{ | |
flash : org = 0x00000d10, len = 128k - 0xd10 | |
ram : org = 0x1FFFE000, len = 16k | |
} | |
__ram_start__ = ORIGIN(ram); | |
__ram_size__ = LENGTH(ram); |
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
#!/usr/bin/env python | |
test_cases = [ | |
# small, no island | |
([ | |
"00", | |
"00", | |
], | |
0 |
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
#!/usr/bin/env python | |
test_cases = [ | |
# small, no island | |
([ | |
"00", | |
"00", | |
], | |
0 |
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
*** ChibiOS/RT test suite | |
*** | |
*** Kernel: 3.0.0 | |
*** Compiled: Jul 28 2015 - 19:33:15 | |
*** Compiler: GCC 4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147] | |
*** Architecture: ARMv6-M | |
*** Core Variant: Cortex-M0 | |
*** Port Info: Preemption through NMI | |
*** Platform: Nordic Semiconductor nRF51822 | |
*** Test Board: WvShare BLE400 |
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
*** ChibiOS/RT test suite | |
*** | |
*** Kernel: 3.0.0 | |
*** Compiled: Jul 26 2015 - 11:05:59 | |
*** Compiler: GCC 4.8.1 | |
*** Architecture: AVR | |
*** Core Variant: MegaAVR | |
*** Port Info: None | |
*** Platform: AVR | |
*** Test Board: Arduino Mega |
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
*** ChibiOS/RT test suite | |
*** | |
*** Kernel: 3.0.0 | |
*** Compiled: Jul 26 2015 - 10:38:20 | |
*** Compiler: GCC 4.8.1 | |
*** Architecture: AVR | |
*** Core Variant: MegaAVR | |
*** Port Info: None | |
*** Platform: AVR | |
*** Test Board: Arduino Mega |
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
Index: os/rt/ports/AVR/chcore.h | |
=================================================================== | |
--- os/rt/ports/AVR/chcore.h (revision 8095) | |
+++ os/rt/ports/AVR/chcore.h (revision 8096) | |
@@ -381,6 +381,10 @@ | |
} | |
#endif | |
+#if CH_CFG_ST_TIMEDELTA > 0 | |
+#include "chcore_timer.h" |