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 "message.h" | |
#include "winning_move.h" | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <numeric> | |
#include <map> | |
using namespace std; |
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 <vector> | |
#include <map> | |
#include <functional> | |
#include <algorithm> | |
using namespace std; | |
// BEGIN CUT HERE | |
#include <iostream> | |
#include <sstream> |
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 <vector> | |
#include <algorithm> | |
using namespace std; | |
class MultiplicationTable2{public: | |
int minimalGoodSet( vector <int> table ) | |
{ | |
int n = 0; | |
while (n*n < int(table.size())) | |
n++; |
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
long long a, b; | |
long long next_(long long x) | |
{ | |
return ((x^a)+b) & ((1LL<<50)-1); | |
} | |
long long back_(long long x) | |
{ | |
return ((x+(1LL<<50)-b)^a) & ((1LL<<50)-1); |
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 <vector> | |
#include <map> | |
#include <utility> | |
using namespace std; | |
// Binary Indexed Tree | |
class BIT | |
{ | |
int n; | |
vector<int> v; |
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万人) | |
■クール | |
■パッション |
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 <string> | |
using namespace std; | |
class BalancedSubstrings{public: | |
int countSubstrings( string s ) | |
{ | |
int n = (int)s.size(); | |
int ans = 0; | |
for (int i=0; i<n; 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
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main() | |
{ | |
int L; cin>>L; | |
int N; cin>>N; | |
vector<int> a(N); |
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
// コメントX | |
A; | |
B; | |
C; | |
// コメントを書くまでもない処理だけど、コメントXがDまで対象にしていると | |
// 思われると困るので、ここにもコメントを書きたくなる | |
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
#coding: utf-8 | |
# マイナンバーの最下位桁の出現頻度を調べる | |
# http://law.e-gov.go.jp/announce/H26F11001000085.html | |
import random | |
def check(number): | |
P = map(int, ("%011d"%number)[::-1]) | |
Q = [n+1 if n<=6 else n-5 for n in range(1,12)] | |
r = sum(p*q for p,q in zip(P,Q)) % 11 |