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 <iostream> | |
| template<std::size_t T> | |
| struct FixedPoint { | |
| static constexpr int Size = T; | |
| int value; | |
| static_assert(Size < sizeof(value) * 8); | |
| }; | |
| constexpr FixedPoint test(double d) { |
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
| int main() { | |
| auto a = new int[1000]; | |
| a[500] = 33; | |
| auto b = new(a) int[1000]; | |
| std::cout << b[500] << std::endl; | |
| return 0; | |
| } |
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
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "math/rand" | |
| "os" | |
| "time" | |
| sdk "github.com/TinkoffCreditSystems/invest-openapi-go-sdk" |
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 <stdio.h> | |
| #include <stdlib.h> | |
| #include <fcntl.h> | |
| #include <stdbool.h> | |
| #include <sys/stat.h> | |
| #include <sys/mman.h> | |
| typedef struct freq { | |
| int freq; | |
| char* word; |
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
| package main | |
| import "fmt" | |
| type connection struct { | |
| closed bool | |
| usage int | |
| } | |
| type state func(*connection) state |
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
| #!/bin/bash | |
| while : | |
| do | |
| echo "Starting Goland..."; | |
| /Applications/GoLand.app/Contents/MacOS/goland; | |
| done |
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 <stdio.h> | |
| #include <stdint.h> | |
| int main() { | |
| int x = 10; | |
| int* y = &x; | |
| printf("Hey! %p (size=%zu)\n", y, sizeof(y)); | |
| uint64_t mask = 0; | |
| for (int j = 63; j > 55; j--) { |
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 <bits/stdc++.h> | |
| using namespace std; | |
| #define ALL(X) begin(X), end(X) | |
| int main() { | |
| // solution comes here | |
| } |
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
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "time" | |
| ) | |
| func init() { | |
| rand.Seed(time.Now().UnixNano()) |
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
| package main | |
| import ( | |
| "fmt" | |
| "runtime" | |
| "sync" | |
| "time" | |
| ) | |
| func main() { |