Skip to content

Instantly share code, notes, and snippets.

View pranet's full-sized avatar

Pranet Verma pranet

View GitHub Profile
// @flow
import React from 'react';
import ReactList from 'react-list';
type Props = {
messages: Array<string>,
...,
};
export class MessageLog extends React.Component<Props> {
from collections import Counter
MOD, N = 10**9 + 7, 10**5 + 2
fact = [1] + [j for j in [1] for i in xrange(1, N) for j in [(j * i) % MOD]]
n, d = raw_input(), Counter(map(int, raw_input().split())).most_common()
print (reduce(lambda x, y: (x * fact[d[0][1]] * pow(fact[d[0][1] - y[1]], MOD - 2, MOD)) % MOD, d, 1) * pow(fact[d[0][1]], MOD - 2, MOD)) % MOD
@pranet
pranet / .gitignore
Last active August 29, 2015 14:26 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2013 Thoralf Klein
* Written (W) 2013 Soumyajit De
*/
from numpy.random import randn,randint
from numpy.ma.core import reshape, mean
from shogun.Features import RegressionLabels, RealFeatures
from shogun.Regression import LeastAngleRegression, LinearRidgeRegression, LeastSquaresRegression
from shogun.Evaluation import CrossValidation, CrossValidationResult, \
CrossValidationSplitting, MeanSquaredError
import time
n=250
n_class=6