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 <stdio.h> | |
class Temp { | |
public: | |
static int a; | |
}; | |
int main() { | |
printf("a: %d\n", Temp::a); | |
return 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
#include <stdio.h> | |
class Temp { | |
public: | |
static int a; | |
}; | |
int Temp::a = 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
for i in range(1, 101): | |
s = "%s%s" % ('Fizz' if i % 3 == 0 else '', 'Buzz' if i % 5 == 0 else '') | |
print s if len(s) > 0 else i |
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; | |
public class Test | |
{ | |
private static bool IsPrime(int num) | |
{ | |
if (num == 0 || num == 1) return false; | |
if (num == 2) return true; | |
for (int i = 2; i < num; ++i) { |
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 <vector> | |
int main() { | |
std::vector<int> v {1, 2, 3}; | |
for (auto& i : v) { | |
std::cout << i; | |
} | |
std::cout << std::endl; | |
return 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
#include <iostream> | |
using namespace std; | |
int main() { | |
float a = 999999999999999999; | |
float b = 1000000000000000000; | |
cout << (a == b) << endl; | |
return 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
#include <stdio.h> | |
typedef struct { | |
double t; | |
} temp; | |
int main() { | |
temp a, b; | |
a.t = 999999999999999999; | |
b.t = 1000000000000000000; |
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 <stdio.h> | |
#include <stdbool.h> | |
int main() { | |
const char *A = "powerful"; | |
const int sizeA = 8; | |
const char *B = "fulewopr"; | |
const int sizeB = 8; | |
int lettersA[26]; |
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 random import randint | |
size = 7 | |
# 1 - 9 just so that monospace fonts look nice | |
min_dist = 1 | |
max_dist = 9 | |
with open('out.inp', 'w') as f: | |
f.write(str(size) + '\n') | |
for i in xrange(size): |
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 <stack> | |
#include <string> | |
#include <queue> | |
#include <vector> | |
using namespace std; | |
bool is_valid_parens(const string &parens) { | |
stack<char> s; | |
for (size_t i = 0; i < parens.length(); ++i) { |
OlderNewer