akhauriyash/Code-Regression huggingface dataset:
// E - Sum of gcd of Tuples (Hard)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define irp(i,s,e) for(int i=(s);i>(e);--i)
#define MOD 1000000007
// a^n mod m を計算する(繰り返し二乗法,二分累乗法:O(logn)) (再帰版)
ll modpow(ll a,ll n){return n?modpow(a*a%MOD,n/2)*(n%2?a:1)%MOD:1;}

ll cnt_gcd[100001]; // [gcd:[1,K]] gcd 毎の個数

int main(){
	int N,K; cin>>N>>K;
	irp(g, K, 1-1){ // g:[K,1,-1] gcd を固定
		cnt_gcd[g] = modpow(K/g, N); // g の倍数の個数
		for(int n=2; n*g<=K; ++n) cnt_gcd[g] -= cnt_gcd[n*g]; // g*1 以外を除去
	}
	ll ans = 0;
	irp(g, K, 1-1) ans = (ans + (cnt_gcd[g] * g % MOD)) % MOD;
	cout<< (ans<0? ans+MOD: ans) <<endl; // 負数の修正
}

Measured memory_bytes: 4412
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;

int main() {
    int a,b,c,d;
    cin >> a >> b >> c >> d;

    if ((a+d-1)/d >= (c+b-1)/b) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3100
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

const int Maxn = 500;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

bool v[Maxn][Maxn];
string f[Maxn];

int h, w;

P dfs(int i, int j){
    P ret = P(0, 0);
    if (f[i][j] == '#') ret.first++;
    else ret.second++;

    v[i][j] = true;
    for (int k = 0; k < 4; ++k) {
        int nx = i + dx[k], ny = j + dy[k];
        if (0 <= nx && nx < h && 0 <= ny && ny < w && !v[nx][ny]){
            if (f[i][j] != f[nx][ny]){
                P p = dfs(nx, ny);
                ret.first += p.first;
                ret.second += p.second;
            }
        }
    }

    return ret;
}

int main() {
    cin >> h >> w;
    for (int i = 0; i < h; ++i) {
        cin >> f[i];
    }


    ll ans = 0;
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            if (f[i][j] == '#'){
                P p = dfs(i, j);
                ans += p.first * p.second;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 20608
my $s = <STDIN>;
my @dat = split(/ /,$s);
my $N = $dat[0];
my $Q = $dat[1];

my @data;
#頂点情報
for(my $i=1;$i<$N;$i++){
   $s = <STDIN>;
   chomp $s;
   @dat = split(/ /,$s);
   $data[$dat[1]] = $dat[0];
}

my  @add;
my  @ans;
for(my $i=1;$i<=$N;$i++){
  $add[$i] = 0;
  $ans[$i] = 0;
}


#操作情報
for(my $i=0;$i<=$Q;$i++){
   $s = <STDIN>;
   chomp $s;
   @dat = split(/ /,$s);
   #print "@dat\n";
   $add[$dat[0]] = $add[$dat[0]] + $dat[1];
}

$ans[1] = $add[1]; 
for(my $i=2;$i<=$N;$i++){
  $ans[$i] = $add[$i] + $ans[$data[$i]]; 
}

for(my $i=1;$i<=$N;$i++){
  print "$ans[$i] ";
}


Measured memory_bytes: 47136
#include<bits/stdc++.h>
#define LL long long
#define M 1000000
using namespace std;
LL read(){
	LL nm=0,fh=1;char cw=getchar();
	for(;!isdigit(cw);cw=getchar()) if(cw=='-') fh=-fh;
	for(;isdigit(cw);cw=getchar()) nm=nm*10+(cw-'0');
	return nm*fh;
}
map<LL,LL> K;
LL n,m,ans,p[M];
int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	n=read();
	for(int i=1;i<=n;i++) p[i]=read(),K[p[i]]++;
	sort(p+1,p+n+1);
	for(int i=n;i;i--){
		LL k=(1<<30);
		if(!K[p[i]]) continue;
		K[p[i]]--;
		for(;k>p[i];k>>=1){
			LL ned=k-p[i];
			if(!K.count(ned)) continue;
			if(K[ned]>0){K[ned]--,ans++; break;}
		}
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 16384
import scala.io.StdIn._

object Main extends App {
  val k = readInt()

  def solve(): Int = {
    var set = Seq.empty[Int]
    var cnt = 1
    var x = 7%k
    (0 until k).foreach { _ =>
      if(x == 0) return cnt
      set = x +: set
      x = (x * 10 + 7) % k
      cnt += 1
    }
    -1
  }

  println(solve())

}



Measured memory_bytes: 90940
#include<stdio.h>

int main(void)
{
  int n,i;
  char s[100];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%c",&s[i]);
  for(i=0;i<n;i++){
    if(s[i]=='Y'){
      printf("Four\n");
      return 0;
    }
  }
  printf("Three\n");
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> as(n);
    for (auto& a : as) {
        cin >> a;
        --a;
    }

    long long total_sum = 0;
    vector<int> count(n, 0);
    for (auto a : as) {
        total_sum += count[a];
        ++count[a];
    }
    
    for (auto a : as) {
        cout << total_sum - (count[a] - 1) << "\n";
    }
    return 0;
}


Measured memory_bytes: 4224
H,N = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(N)]
INFTY = 10**8
dp = [[INFTY for _ in range(H+1)] for _ in range(N+1)]
for i in range(N+1):
    dp[i][0] = 0
for i in range(1,N+1):
    for j in range(1,H+1):
        dp[i][j] = dp[i-1][j]
        if j>=A[i-1][0]:
            dp[i][j] = min(dp[i][j],dp[i][j-A[i-1][0]]+A[i-1][1])
        else:
            dp[i][j] = min(dp[i][j],A[i-1][1])
print(dp[N][H])

Measured memory_bytes: 161064
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int[] hand = new int[5];
		while(true){
			boolean[] IS = new boolean[]{false, false, false};
			
			for(int i = 0; i < 5; i++){
				hand[i] = sc.nextInt();
				if(hand[i] == 0){
					System.exit(0);
				}
				if(hand[i] == 1)IS[0] = true;
				if(hand[i] == 2)IS[1] = true;
				if(hand[i] == 3)IS[2] = true;
			}
			boolean is = false;
			int count = 0;
			for(int i = 0; i < 4; i++)
				if(hand[i] == hand[i+1])
				count++;
			
			if(count == 4)is = true;
			if(IS[0]&&IS[1]&&IS[2] || is)
				for(int x = 0; x < 5; x++)
					System.out.println(3);
			else{
				if(IS[0]&&IS[1])
					for(int i = 0; i < 5; i++)
						System.out.println(hand[i]);
				if(IS[1]&&IS[2])
					for(int i = 0; i < 5; i++)
						if(hand[i] == 2)System.out.println(1);
						else System.out.println(2);
				if(IS[2]&&IS[0])
					for(int i = 0; i < 5; i++)
						if(hand[i] == 3)System.out.println(1);
						else System.out.println(2);
			}
		}
	}
}

Measured memory_bytes: 18964
# https://atcoder.jp/contests/abc106/tasks/abc106_d
# どうやったら高速に区間[p,q]に完全に入っている区間の数を取得できるか？
# p,qを二次元座標として捉えると電車1本の線は二次元平面上の1点として表せる
# このときp,qの区間に完全に入っている電車の本数というのは、x軸、y軸の両方において[p,q]となる四角形内にある電車の本数
# queryに高速に答えるために二次元累積和を構築する
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


import numpy as np

N, M, Q = read_ints()

# numpy使わずに再実装 #入れるときはpythonのほうが速いので
LR2d = [[0] * (N + 1) for _ in range(N + 1)]
for _ in range(M):
    L, R = read_ints()
    LR2d[L][R] += 1

LR2d = np.array(LR2d)

LR2d_accum = np.zeros((N + 2, N + 2), np.int64)
LR2d_accum[1:, 1:] = LR2d.cumsum(axis=0).cumsum(axis=1)  # 1次元累積和同様半開区間で考える
# つまりインデックスi,jとはもとの配列においてi,jを含まない四角形の領域の合計を出す

# pq = read_tuple(Q)

for _ in range(Q):
    p, q = read_ints()
    print(LR2d_accum[q + 1, q + 1] - LR2d_accum[q + 1, p] -
          LR2d_accum[p, q + 1] + LR2d_accum[p, p])


'''
以下numpyを使わずに実装してみる
'''


Measured memory_bytes: 20656
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(10**8)
from bisect import bisect_left


def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()

    # 愚直に行うとO(N^2)となる
    # エラトステネスの篩を真似ると、NlogNで済む
    # 同じ数字が存在している場合は、注意する

    table = [False]*(A[-1]+1)
    ans = 0
    for i in range(N):
        # すでに何かの倍数ならば、考える必要なし
        if table[A[i]]:
            continue
        # 最大値まで見ていく
        for j in range(2, A[-1]//A[i]+1):
            table[A[i]*j] = True

    ans = 0
    for i in range(N):
        if table[A[i]] is False:
            ans += 1
            if i == 0:
                if len(A) == 1:
                    break
                if A[0] == A[1]:
                    ans -= 1
            elif i == N-1:
                if A[N-1] == A[N-2]:
                    ans -= 1
            else:
                if A[i] == A[i-1] or A[i] == A[i+1]:
                    ans -= 1
    print(ans)

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 98088
import qualified Data.List as List
import qualified Data.Char as Char
import qualified Data.Maybe as Maybe

main :: IO ()
main = getContents >>=
  print . (\(n:_:dislike_digits) -> Maybe.maybe 0 id . List.find (null . List.intersect dislike_digits . map Char.digitToInt . show) $ iterate succ n) . map (read :: String -> Int) . words

Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 100005;

int T[MAXN], n, m, a, b;

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m;
	for (int i = 1; i <= m; i++) {
		cin >> a >> b;
		T[a]++, T[b]++;
	}
	for (int i = 1; i <= n; i++)
		if (T[i]&1){
			cout << "NO"<< endl;
			return 0;
		}
	cout <<"YES"<<endl;
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
//#pragma GCC optimize "-O3"
typedef unsigned long long ull;
typedef unsigned int ui;
typedef unsigned short us;
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll infll=9223372036854775806;
const int inf=2147483646;
int n,a[10][10],ans=0,d;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(0);cout.precision(18);
	cin>>n>>d;
	for (int i=0;i<n;i++)
		for (int j=0;j<d;j++)
			cin>>a[i][j];
	for (int i=0;i<n;i++){
		for (int j=i+1;j<n;j++){
			int s=0;
			for (int k=0;k<d;k++){
				s+=(a[i][k]-a[j][k])*(a[i][k]-a[j][k]);
			}
			int t=sqrt(s);
			if (t*t==s)
				ans++;
		}
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <bitset>
#include <queue>

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define sqr(x) (x)*(x)
typedef long long ll;

int main() {
    double x;
    cin >> x;
    double num = x/3;
    printf("%lf", num*num*num);
}

Measured memory_bytes: 888
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

const LL MOD = 1e9 + 7;
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    LL n;
    cin>>n;
    VL a(n);
    REP(i,n)cin>>a[i];
    VL sum(n+1);
    sum[0] = 0;
    REP(i,n)sum[i+1] = (sum[i] + a[i]);
    LL ans = 0;
    REP(i,n-1){
        ans += (a[i] * ((sum[n] - sum[i+1] + MOD) % MOD)) % MOD;
        ans %= MOD;
    }
    PUTS(ans);
}

Measured memory_bytes: 6344
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main() {
  string N; cin >> N;
  bool all9 = true;
  for(int i = 1; i < N.size(); ++i) {
    if(N[i] != '9') {
      all9 = false;
    }
  }
  if(all9) {
    cout << (N[0] - '0') + 9*(N.size()-1) << endl;
  } else {
    cout << (N[0] - '0') + 9*(N.size()-1) - 1 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
using static System.Math;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System;

class Program
{
    #region Reader
    static string ReadStr => Console.ReadLine();
    static string[] ReadStrs => Console.ReadLine().Split(' ');
    static int ReadInt => Convert.ToInt32(Console.ReadLine().Trim());
    static int[] ReadInts => Console.ReadLine().Trim().Split(' ').Select(s => Convert.ToInt32(s)).ToArray();
    static long ReadLong => Convert.ToInt64(Console.ReadLine().Trim());
    static long[] ReadLongs => Console.ReadLine().Trim().Split(' ').Select(s => Convert.ToInt64(s)).ToArray();
    #endregion
    #region Method
    const int mod = 1000000007;
    public static int Mod(int a, int mod) { return a % mod >= 0 ? a % mod : a % mod + mod; }
    public static long Mod(long a, long mod = mod) { return a % mod >= 0 ? a % mod : a % mod + mod; }
    #endregion





    /// <summary>
    /// 最大公約数
    /// </summary>
    /// <param name="a"></param>
    /// <param name="b"></param>
    /// <returns></returns>
    public static long Gcd(long a, long b)
    {
        if (a < b)
            // 引数を入替えて自分を呼び出す
            return Gcd(b, a);
        while (b != 0)
        {
            var remainder = a % b;
            a = b;
            b = remainder;
        }
        return a;
    }



    public static Dictionary<int, int> PrimeFactors(int n)
    {
        int i = 2;
        int tmp = n;
        Dictionary<int, int> d = new Dictionary<int, int>();

        while (i * i <= n) //※1
        {
            if (tmp % i == 0)
            {
                tmp /= i;
                if (d.ContainsKey(i)) d[i]++;
                else d.Add(i, 1);
            }
            else
            {
                i++;
            }
        }
        if (tmp != 1)
        {
            if (d.ContainsKey(tmp)) d[tmp]++;
            else d.Add(tmp, 1);
        }
        return d;
    }

    static void Main()
    {

        int[] As = ReadInts;
        long a = As[0];
        long b = As[1];
        long c = As[2];
        long d = As[3];

        List<long> s = new List<long> { a * c, a * d, b * c, b * d };



        WriteLine(s.Max());
    }
}



Measured memory_bytes: 28396
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner nc = new Scanner(System.in);
        int a = nc.nextInt();
        int b = nc.nextInt();
        if(a < b){
            System.out.println("a < b");
        }else if(a > b){
            System.out.println("a > b");
        }else{
            System.out.println("a == b");
        }
    }
}


Measured memory_bytes: 26212
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef vector<int> VI;

const int SIZE = 1000001;

VI memo( SIZE, -2 );

int dfs ( int num )
{
	if ( memo[num] != -2 ) {
		return memo[num];
	}
	if ( num < 10 ) {
		return memo[num] = 0;
	}
	int m = 10,
		next = 0,
		res = -1;
	memo[num] = -1;
	while ( num >= m ) {
		next = max( next, ( num / m ) * ( num % m ) );
		m *= 10;
	}
	res = dfs( next );
	if ( res != -1 ) {
		++res;
	}
	return memo[num] = res;
}

int main ( void )
{
	int q;
	while ( cin >> q ) {
		for ( int i = 0; i < q; ++i ) {
			int n;
			cin >> n;

			cout << dfs( n ) << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 4968
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

a,b,c = inm()
print('bust' if a+b+c>=22 else 'win')


Measured memory_bytes: 3316
// AGC009_A
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <tuple>  // std::tuple std::get
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>  // std::setprecision()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (ll i=0; i < n; i++)  // 0 ~ n-1
#define REPN(i, n) for (ll i=1; i <= n; i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0LL)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
#define zero_pad(num) setfill('0') << std::right << setw(num)
#define space_pad(num) setfill(' ') << std::right << setw(num)

typedef long long ll;

const ll MOD7 = 1000000007;  // 1 000 000 007
const ll MOD9 = 1000000009;  // 1 000 000 009

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    // input
    ll N;
    cin >> N;
    vector<ll> A(N), B(N);
    REP(i, N) {
        cin >> A[i] >> B[i];
    }
    
    // calculation
    // 何回押さないといけないか
    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    
    ll res = 0, now;
    for (ll i = 0; i < N; ++i) {
        now = A[i] + res;
        if (now%B[i] == 0) {
            continue;
        } else if (now <= B[i]) {
            res += B[i] - now;
        } else {
            // 一番近くのB[i]の倍数
            // 9, 4 -> 4 - 9%4 = 3: 3 増やせば良い
            res += B[i] - now%B[i];
        }
    }
    
    cout << res << "\n";
    
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll             long long int
#define lb             lower_bound
#define ub             upper_bound
#define fi             first
#define  mp            make_pair
#define   vll          vector<ll>
#define se             second
#define sz             size()
#define mod            1000000007
#define endl           "\n"
#define fast           ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb             push_back
#define all(v)         v.begin(),v.end()
#define allr(v)        v.rbegin(),v.rend()
#define inp(V,n)      for(int i=0;i<n;i++){cin >> V[i];}
#define oup(V,n)     {for(int i=0;i<n;i++){cout <<  V[i] << " "  ;} cout << endl;}
using namespace std;
ll factorial(ll n)
{
    return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
}
ll gcd(ll a, ll b)
{
    if (a == 0)
      return b;
    return gcd(b % a, a);
}
ll lcm(ll a, ll b)
{
   return (a*b)/gcd(a, b);
}
bool sortByVal(const pair<double,double> &a,
               const pair<double,double> &b)
{
    if(a.fi==b.fi)
    {
    return (a.second >b.second);
    }
    else
        return (a.fi<b.fi);
}

int main()
{
     fast;
     int q=1;
     //cin>>q;
     while(q--)
     {

         ll x=0,y,m,n,s,t,a,b,e,p,d=0,sum1=0,sum2=0,i=1,j,k,l,c=0,ans=0;
          cin>>a>>b;




          cout<<a*b<<endl;

     }

   return 0;
}



Measured memory_bytes: 3648
#!/user/bin/env python
#pythonプログラムであることを示している

# -*- coding: utf-8 -*-
"""
このプログラムはPythonを書く際のテンプレとなっています。これをコピペしてコーディングを行なってください。
なお字下げしないこと！！
"""

__author_ = 'Maruta Yuzuha'
__version_ = '1.0.0'
__date__ = '2019/12/25'

def main():
    """
    ここでプログラムの解説を行う
     >>main()
    Hello world.
    0
    """
    s = input().split()
    a = 0
    b = int(s[0])
    c = int(s[1])
    while b > 0:
        b = b - c
        a += 1
    print(a)
    return 0

if __name__ == '__main__':
    #上記のifの記述によってこのスクリプトファイルが起動された時だけ実行する部分になる。
    #ちなみにスクリプトが "モジュールとして"インポートされた時には実行されない、

    #単体テスト:モジュールのdocstring(ドキュメンテーション文字列)に記載された全ての対話実行例が書かれている通りに動作するかを確認
    #python ファイル名 -v
    import doctest
    doctest.testmod()

    #実際にmain()を呼び出して、結果を得て、その結果でPythonシステムを終える
    import sys
    sys.exit(main())

Measured memory_bytes: 8408
#include<iostream>
#include<vector>
#include<queue>
#include<deque>

using namespace std;

int n;
int u[102], k[102], t[102][102];
queue<int>Q;
vector<int>V;
int color[102];
int d[102];

void bfs(int s){
  for(int i = 1; i <= n; ++i){
    if(u[i] != s){
      color[u[i]] = 0;
      d[u[i]] = 150;
    }
  }
  d[s] = 0;
  int pi = 0;
  Q.push(s);
  while(!Q.empty()){
    int m = Q.front();
    Q.pop();
    for(int i = 1; i <= k[m]; ++i){
      if(color[t[m][i]] == 0){
        color[t[m][i]] = 2;
        d[t[m][i]] = d[m] + 1;
        pi = t[m][i];
        Q.push(t[m][i]);
      }
    }
    color[m] = 1;
  }
  for(int i = 1; i <= n; ++i){
    if(d[i] == 150){
      cout << i << " " << -1 << endl;
    }else{
      cout << i << " " << d[i] << endl;
    }
  }
  
}

int main(){
  cin >> n;
  for(int i = 1; i <= n; ++i){
    cin >> u[i] >> k[i];
    for(int j = 1; j <= k[i]; ++j){
      cin >> t[i][j];
    }
  }
  bfs(1);
}


Measured memory_bytes: 3156
#include<bits/stdc++.h>
#define slowanddetermined ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;


int main()
{
    slowanddetermined

    long long n,a,b;
    cin>>n>>a>>b;

    if(a==0){cout<<0; return 0;}
    //else cout<<(a+)
    if((n/(a+b))*(a+b)+a<n){
        cout<<(n/(a+b)+1)*a;
    }
    else
    cout<<(n-(n/(a+b))*b);
   // cout<<((n/(a+b))*a )


    return 0;

}


Measured memory_bytes: 256
import heapq

N = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x * (-1), A))

heapq.heapify(A)

ans = 0
N -= 2
ans += heapq.heappop(A) * (-1)

if N == 0:
    print(ans)
    exit()
elif N == 1:
    ans += A[0]
    print(ans)
    exit()
elif N >= 2:
    q = N // 2
    r = N % 2
    for i in range(1, q + 1):
        ans += 2 * heapq.heappop(A) * (-1)
    if r == 1:
        ans += heapq.heappop(A) * (-1)
    print(ans)


Measured memory_bytes: 33040
#include <bits/stdc++.h>
using namespace std;
using namespace __detail;

typedef long long ll;
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define fork(i, n) for (ll i = 0; i < (n); i++)
#define forn for (ll i = 0; i < (n); i++)
#define fori(i, k, n) for (ll i = k; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define en '\n'
#define FILL(x, v) memset(x, v, sizeof(x))
#define pb push_back
#define fast                     \
	ios::sync_with_stdio(false); \
	cin.tie(NULL);               \
	cout.tie(NULL);

template <typename A, typename B>
inline void chmin(A &a, B b)
{
	if (a > b)
		a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b)
{
	if (a < b)
		a = b;
}
template <typename T>
void print(vector<T> &a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}
template <typename T>
void print(deque<T> &a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}
template <typename T>
void print(vector<vector<T>> &a)
{
	for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < a[i].size(); j++)
			cout << a[i][j] << ' ';
		cout << en;
	}
}
const int mxN = 1e7;
ll a[mxN + 1];

void findDivisors(int n)
{
	memset(a, 0, sizeof a);
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j * i <= n; j++)
			a[i * j]++;
	}
}

int main()
{
	fast;
	ll n, ans = 0;
	cin >> n;
	findDivisors(n);
	for (ll i = 1; i <= n; i++)
	{
		ans += i * a[i];
	}
	cout << ans << en;
}

Measured memory_bytes: 81760
import bisect, collections
 
 
 
def solution():
    n, m = [int(x) for x in input().strip().split(" ")]
    print(n*(n-1)//2+m*(m-1)//2)
                

def main():    
    # T = int(input().strip())
    for _ in range(1):
        solution()

if __name__ == "__main__":
    main()

Measured memory_bytes: 38256
from bisect import *
N = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 0
min_a = min(a)
max_a = max(a)
for x in range(min_a , max_a + 1):
    r = bisect_right(a , x + 1)
    l = bisect_left(a , x - 1)
    tmp_max = r - l
    if tmp_max > ans:
        ans = tmp_max
print(ans)


Measured memory_bytes: 13964
import numpy as np
import collections

H, W = map(int, input().split())
N = int(input())
A = collections.deque(list(map(int, input().split())))

Graph = np.array([[0]*W]*H)

Currentx = 0
Currenty = 0
colour = 0

while A:
	D = A.popleft()
	colour+=1
	for i in range (0, D):
		if Currentx == W-1 and Currenty%2 == 0:
			Graph[Currenty][Currentx] = colour
			Currenty+= 1
		elif Currentx == 0 and Currenty%2 == 1:
			Graph[Currenty][Currentx] = colour
			Currenty+= 1
		elif Currenty%2 == 0:
			Graph[Currenty][Currentx] = colour
			Currentx+= 1			
		else:
			Graph[Currenty][Currentx] = colour
			Currentx-= 1				

for i in range (0, H):
	print(*Graph[i], sep = " ")

Measured memory_bytes: 27164
n = int(raw_input())

card = {"S":[0]*13, "H":[0]*13, "C":[0]*13, "D":[0]*13} 
 
for i in range(n):
  mark, nums = raw_input().split()
  card[mark][int(nums)-1] = 1
 
for i in ["S", "H", "C", "D"]:
  for j in range(13):
    if card[i][j] == 0:
      print "%s %d" % (i, j+1)

Measured memory_bytes: 6300
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long power = 1;
		for(int i = 1; i <= N; i++){
			power = (power * i) % 1000000007; 
		}
		System.out.println(power);
	} 
}

Measured memory_bytes: 21588
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<list>
#include<stack>
#include<cstring>
#include<string>
#include<cmath>
using namespace std;

struct Point{
	double x,y;
	Point(){}
	Point(double _x,double _y){
		x=_x; y=_y;
	}
};

struct Line{
	double x[2],y[2];
	Line(){}
	Line(Point p,Point q){
		x[0]=p.x; x[1]=q.x;
		y[0]=p.y; y[1]=q.y;
	}
};

void RevXY(Point &p){
	swap(p.x,p.y);
}

void RevXY(Line &l){
	for(int i=0;i<2;i++) swap(l.x[i],l.y[i]);
}

bool Is_SameSide(Line l,Point p,Point q){
	//printf("%lf,%lf - %lf,%lf\np(%lf,%lf),q(%lf,%lf)\n",l.x[0],l.y[0],l.x[1],l.y[1],p.x,p.y,q.x,q.y);
	if(l.x[1]==l.x[0]){
		RevXY(l); RevXY(p); RevXY(q);
	}
	double a,b;
	a = (l.y[1]-l.y[0])/(l.x[1]-l.x[0]);
	b = l.y[0]-a*l.x[0];
	//printf("%lf,%lf - %lf,%lf : y = %lfx+(%lf)\np(%lf,%lf),q(%lf,%lf)\n",l.x[0],l.y[0],l.x[1],l.y[1],a,b,p.x,p.y,q.x,q.y);
	if((p.y-(a*p.x+b))*(q.y-(a*q.x+b))>0) return true;
	else return false;
}

int main(){
	/*Line l;
	Point p,q;
	cin>>l.x[0]>>l.y[0]>>l.x[1]>>l.y[1]>>p.x>>p.y>>q.x>>q.y;
	printf("%lf,%lf - %lf,%lf\np(%lf,%lf),q(%lf,%lf)\n",l.x[0],l.y[0],l.x[1],l.y[1],p.x,p.y,q.x,q.y);
	if(Is_SameSide(l,p,q)==true) puts("YES");
	else puts("NO");*/
	Point t[3],p;
	while(cin>>t[0].x>>t[0].y){
		for(int i=1;i<3;i++) cin>>t[i].x>>t[i].y;
		cin>>p.x>>p.y;
		Point q = Point((t[0].x+t[1].x+t[2].x)/3,(t[0].y+t[1].y+t[2].y)/3);
		bool ans=true;
		for(int i=0;i<3;i++){
			if(Is_SameSide(Line(t[i],t[(i+1)%3]),p,q)==false){
				ans = false;
			}
		}
		if(ans) puts("YES");
		else puts("NO");
	}
}

Measured memory_bytes: 1184
N = int(input())
MOD = 1e9+7

#都度MODで割らないと値がoverflowする
def powmod(x, y):
    res = 1
    for p in range(y):
        res = res*x%MOD
    return res

ans = powmod(10,N)-powmod(9,N)-powmod(9,N)+powmod(8,N)
print(int(ans%MOD))

Measured memory_bytes: 9188
#include <bits/stdc++.h>
 
#define int long long
 
// loop
#define FOR(i, a, b) for (int i = (a); i < (b); i++) 	// a ~ b-1	(ascending)
#define REP(i, n) FOR(i, 0, n)							// 0 ~ n-1
#define NREP(i, n) FOR(i, 1, n + 1)						// 1 ~ n
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)	// a ~ b	(descending)
#define RREP(i, n) RFOR(i, n, 0)						// n ~ 0
#define RNREP(i, n) RFOR(i, n, 1)						// n ~ 1
 
// container operation
#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define ASORT(c) std::sort((c).begin(), (c).end())
#define DSORT(c) std::sort((c).begin(), (c).end(), std::greater<typeof((c).front())>())
#define SIZE(x) ((int)(x).size())
 
// debug
#define check(x) std::cout << #x << " = " << x << '\n'
 
// print
#define cout(x) std::cout << x << '\n'
 
// type alias
using VI = std::vector<int>;
using VII = std::vector<VI>;
using VB = std::vector<bool>;
using VBB = std::vector<VB>;
using VS = std::vector<std::string>;
using PII = std::pair<int, int>;

std::string yes = "Yes\n";
std::string no = "No\n";

void solve();

signed main() {
  solve();
  return 0;
}

void solve() {
  int n, a, b;
  std::cin >> n >> a >> b;
  cout(std::min(n*a, b));
}



Measured memory_bytes: 256
S = str(input())
#kumiにブロックが入ってるこれを足してく
#それぞれの区切りで+を入れるかどうか見ればいい　それでも可能
#+を入れる個数を固定した後どこに入れるかを考える
"""解説：実際に+を入れたのを作ってく 文字列作って＋区切り文字にして足してけば良い
幅優先探索？"""
#文字列のままのやつのストック
from collections import deque
bcal = []
que = deque()
que.append(S[0])
s = ''.join([S[0],'+'])
que.append(s)
while len(que)>0:
    a = que.popleft()
    pn = a.count('+')
    if len(a)-pn == len(S):
        if a[-1]=='+':
            b = a.strip(a[-1])
            bcal.append(b)
        else:
            bcal.append(a)
    else:
        ai = len(a)-pn
        an1 =''.join([a,S[ai]])
        an2 =''.join([a,S[ai],'+'])
        que.append(an1)
        que.append(an2)
        
ans = 0
bcal= set(bcal)
for item in bcal:
    ee = item.split('+')
    for item2 in ee:
        ans += int(item2)

print(ans)



Measured memory_bytes: 3436
n,k = map(int,input().split())
s = input()
a = []
c = 1
for i in range(n-1):
    if s[i]==s[i+1]:
        c+=1
    else:
        a.append(c)
        c = 1
a.append(c)
b = [0]
for i in range(len(a)):
    b.append(b[-1]+a[i])
b.append(b[-1])
n = len(b)
l = 2*k+1
st=int(s[0])
ans = 0
for i in range(st,n,2):
    ans = max(ans,b[i]-b[max(0,i-l)])
print(ans)


Measured memory_bytes: 7924
#include <iostream>
#include <vector>
#include <set>
using namespace std;
typedef long long ll;
int main(){
  ll n;
  cin>>n;
  vector<ll> a(n);
  for(int i=0;i<n;i++) cin>>a[i];

  set<ll> st;
  bool flag = true;
  for(int i=0;i<n;i++){
    if(st.count(a[i]) == 1){
      flag = false;
      break;
    }else{
      st.insert(a[i]);
    }
  }
  if(flag) cout << "YES" << endl;
  else cout << "NO" << endl;
}


Measured memory_bytes: 11136
#include<iostream>
using namespace std;
int main()
{

    int x;
    cin>>x;

    if(x>=400 && x<=599)
    {
        cout<<8;
    }
    else if (x>=600 && x<=799)
    {
        cout<<7;
    }
      else if (x>=800 && x<=999)
    {
        cout<<6;
    }
      else if (x>=1000 && x<=1199)
    {
        cout<<5;
    }

      else if (x>=1200 && x<=1399)
    {
        cout<<4;
    }

      else if (x>=1400 && x<=1599)
    {
        cout<<3;
    }
      else if (x>=1600 && x<=1799)
    {
        cout<<2;
    }  else
    {
        cout<<1;
    }

}


Measured memory_bytes: 3548
#define rep(i, n) for(int i = 0; i < (int)(n); i++) //定番のn回繰り返しを省略
#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
 
using namespace std;
 

//ここから書き始める
int main(int argc, char const *argv[])
{
	int x[3];
	cin >> x[0] >> x[1] >> x[2];

	sort(x, x+3);

	cout << x[2] * 10 + x[1] + x[0] << endl;


    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
int main(){
    int n, k, ans = 1e9; sc(n),sc(k);
    vector<int> h(n);
    for (int i = 0; i < n; i++) sc(h[i]);
    sort(h.begin(), h.end(), greater<int>());
    for (int i = 0; i < n - k + 1; i++){
        ans = min(ans, h[i] - h[i + k - 1]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        int cnt = 0;

        for(int i = 0; i<n;i++){
            num[i]=sc.nextInt();
        }

        for(int i = 0;i<n-1;i++){
            for(int j = i+1;j<n;j++){
                cnt +=num[i]*num[j];
                //System.out.println(i+" ,"+j);
            }
        }
        System.out.println(cnt);
    }
}


Measured memory_bytes: 23508
#include<stdio.h>
int F(int n,int s,int dep,int count,int sum){
    if(dep==10){
    if(count==n&&sum==s) return 1;
     return 0;
    }
    return F(n,s,dep+1,count+1,sum+dep)+F(n,s,dep+1,count,sum);
}
int main(void){
    int n,s,dep,count,sum;
    dep=0;
    count=0;
    sum=0;
    while(1){
scanf("%d%d",&n,&s);
if(n==0&&s==0)break;
printf("%d\n",F(n,s,dep,count,sum));
    }
return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;

#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   //0-origin昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-origin昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  //0-origin降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   //1-origin降順
//rep2 -> 第二引数 m から n 回繰り返し ex) m=5 n=3 なら i=5,i=6,i=7 まで
#define rep2(i,m,n) for(int i = ((int)(m)); i < ((int)(n))+((int)(m)); i++)
#define SIZE(x) ((int)((x).size()))
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;
template<typename T> bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1;} return 0;}
template<typename T> bool chmin(T &a, const T &b){ if(a>b){ a=b; return 1;} return 0;}


/*FUNCs=================================================*/


/*MAIN==================================================*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化

    ll n; cin >> n;
    map<string, ll> str;
    rep(i,n){
        string s; cin >> s;
        sort(all(s));
        if(str.find(s) != str.end()) str[s]++;
        else str.insert(make_pair(s, 1LL));
    }
    ll cnt = 0;
    for(auto itr = str.begin(); itr != str.end(); itr++){
        ll m = itr->second;
        cnt += ((m*(m-1))/2);
    }
    cout << cnt << '\n';
}

Measured memory_bytes: 11264
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))

def main():
  n, T = na()
  t = na()

  cnt = T
  for i in range(n - 1):
    cnt += min(T, t[i + 1] - t[i])
  print(cnt)

main()

Measured memory_bytes: 25744
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a, b, c;
    cin >> a >> b >> c;
    cout << max(0LL, c - (a - b)) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<ll,ll,ll> T;
const long long INF = 1LL<<60;
const int MOD = 1000000000+7;
#define rev(s) (string((s).rbegin(), (s).rend()))
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
// cout << fixed << setprecision(10) << ans << endl; 有効桁数指定
// *min_element(c + l, c + r) *max_element(c + l, c + r) 配列の中のmin-max
// int dx[8]={1,1,0,-1,-1,-1,0,1};
// int dy[8]={0,1,1,1,0,-1,-1,-1};
// int dx[4]={1,0,-1,0};
// int dy[4]={0,1,0,-1};
// ~ は、-1の時だけfalse

int a[200010];

int main () {

    int k,n;cin>>k>>n;

    rep(i,n) cin>>a[i];


    int mi=0;

    rep(i,n-1) {
        mi=max(mi,a[i+1]-a[i]);
    }

    mi=max(mi,k-a[n-1]+a[0]);

    cout<<k-mi<<endl;

    

}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define int long long
#define fo(i, n) for(int i = 1; i <= (n); i ++)
#define out(x) cerr << #x << " = " << x << "\n"
#define type(x) __typeof((x).begin())
#define foreach(it, x) for(type(x) it = (x).begin(); it != (x).end(); ++ it)
using namespace std;
// by piano
template<typename tp> inline void read(tp &x) {
  x = 0;char c = getchar(); bool f = 0;
  for(; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
  for(; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if(f) x = -x;
}
const int N = 3e5 + 233;
int c[N], n, x[N], sum[N], ans = 1e16;
pair<int, int> a[N], b[N];
main(void) {
  cin >> n; fo(i, n) cin >> x[i], sum[i] = sum[i - 1] + x[i];
  for(int cut = 3; cut <= n - 1; cut ++) {
    int t = sum[cut - 1] / 2;
    int p = upper_bound(sum + 1, sum + cut - 1 + 1, t) - sum - 1;
    pair<int, int> it(-1, -1); a[1] = a[2] = b[1] = b[2] = it;
    if(p > 0) a[1] = make_pair(sum[p], sum[cut - 1] - sum[p]);
    if(p + 1 < cut) a[2] = make_pair(sum[p + 1], sum[cut - 1] - sum[p + 1]);
    t = (sum[n] - sum[cut - 1]) / 2 + sum[cut - 1];
    p = upper_bound(sum + cut + 1, sum + n + 1, t) - sum - 1;
    if(p > cut - 1) b[1] = make_pair(sum[p] - sum[cut - 1], sum[n] - sum[p]);
    if(p + 1 < n) b[2] = make_pair(sum[p + 1] - sum[cut - 1], sum[n] - sum[p + 1]);
//    out(p); cout << b[2].first << " " << b[2].second << "\n";
    fo(t1, 2) fo(t2, 2) {
      int q = a[t1].first, w = a[t1].second;
      int e = b[t2].first, r = b[t2].second;
      if(q == -1 || w == -1 || e == -1 || r == -1) continue;
//      cout << q << " " << w << " " << e << " " << r << "\n";
      c[1] = q; c[2] = w; c[3] = e; c[4] = r; sort(c + 1, c + 4 + 1);
      ans = min(ans, c[4] - c[1]);
    }
  }
  cout << ans << "\n";
}
// 81 117 101 116

Measured memory_bytes: 8576
#include <bits/stdc++.h>
using namespace std;

int main() {
    int a, b;
    string s;
    cin >> a >> b >> s;

    string ans = "Yes";
    if (s.at(a) != '-') {
        ans = "No";
    }
    for (int i = 0; i < a+b+1; i++) {
        if (i == a) continue;
        if (s.at(i) == '-') ans = "No";
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
using ll = long long;
 
int main() {
	ll n;
	cin >> n ;
	vector <ll> a(n);
	for (ll i=0;i<n;i++) {
		cin >>a[i];
	}
	sort(a.begin(),a.end());
	for (ll i=1;i<n;i++) {
		if (a[i] == a[i-1]) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}



Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define vl vector<ll>

int main(){
    int n,k;cin>>n>>k;

    if(n<=k)cout<<0<<endl;
    
    else{vl h(n);rep(i,n)cin>>h.at(i);

    sort(h.begin(),h.end());

    ll sum=0;
    rep(i,n-k)sum+=h.at(i);

    cout<<sum<<endl;}
}


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int sum = 0;

		for (int i = 1; i <= b - a; i++) {
			sum += i;
		}

		System.out.println(sum - b);

	}
}

Measured memory_bytes: 23892
#include<iostream>
#include<string>
#include<algorithm>
#include<utility>
#include<numeric>
#include<vector>
#include<map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<functional>
#include<iterator>
#include<cmath>

using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	int a,b;
	cin >> a >> b;

	if(a + b == 15) cout << "+\n";
	else if(a*b == 15) cout << "*\n";
	else			cout << "x\n";

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep_3(i, initial, n) for (int i = (int)(initial); i < (int)(n); ++i)
#define repeat(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int i = (int)(n); i > 0; i--)
#define rep_r_3(i, initial, n) for (int i = (int)(initial); i > (int)(n); i--)
#define repeat_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define variable
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;
const double EPS = numeric_limits<double>::epsilon();
// 最大公約数
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
// 最小公倍数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }
// 素因数分解
vector< pair<ll, ll> > prime_factorize(ll n) {
	vector< pair<ll, ll> > p;
	for(ll i = 2; i*i <= n; i++) {
		if ((n % i) != 0) continue;
		p.push_back(make_pair(i, 0));
		while((n % i) == 0) {
			n /= i;
			p[i].second += 1;
		}
		p.push_back(make_pair(n, 0));
	}

	if (n != 1) p.push_back(make_pair(n, 1));
	return p;
}

int main() {
	ll N, K;
	cin >> N >> K;
	
	ll a = N % K;
	ll min = 1e18;
	while (true) {
		a = abs(a - K);
		if (min == a) break;
		if (min > a) min = a;
	}

	cout << a << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

typedef enum {
	S = 0,
	N,
	W,
	E
} cmd;


void showdice(int dice[7]) {
	int i;

	for (i = 1; i <= 6; ++i) {
		printf("%d ", dice[i]);
	}
	printf("\n");
	return;
}

void rotation(cmd command, int dice[7]) {
	int tmp;
	switch (command) {
	case S:
		tmp = dice[1];
		dice[1] = dice[5];
		dice[5] = dice[6];
		dice[6] = dice[2];
		dice[2] = tmp;
		break;
	case N:
		tmp = dice[1];
		dice[1] = dice[2];
		dice[2] = dice[6];
		dice[6] = dice[5];
		dice[5] = tmp;
		break;
	case W:
		tmp = dice[1];
		dice[1] = dice[3];
		dice[3] = dice[6];
		dice[6] = dice[4];
		dice[4] = tmp;
		break;
	case E:
		tmp = dice[1];
		dice[1] = dice[4];
		dice[4] = dice[6];
		dice[6] = dice[3];
		dice[3] = tmp;
	}
//	showdice(dice);
	return;
}

void toFront(int front, int dice[7]) {

	 if (front == dice[1]) {
		rotation(S, dice);
	} else if(front == dice[2]) {
		;
	} else if (front == dice[3]) {
		rotation(E, dice);
		rotation(N, dice);
	} else if (front == dice[4]) {
		rotation(W, dice);
		rotation(N, dice);
	} else if (front == dice[5]) {
		rotation(S, dice);
		rotation(S, dice);
	} else {
		rotation(N, dice);
	}
//	 showdice(dice);
	return;
}

int isMatch(int dice1[7], int dice2[7]) {
	int i;
	
	toFront(dice1[2], dice2);
//	showdice(dice2);
	for (i = 0; (i < 3) && dice1[1] != dice2[1] ; ++i) {
//		showdice(dice2) ;
		rotation(W, dice2);
	}
	if (dice1[1] != dice2[1]) return 0;
	for (i = 3; i <= 6; ++i) {
		if (dice1[i] != dice2[i]) return 0;
	}
	return 1;
}

int main(void) {
	int i;
	int dice1[7], dice2[7];
	
	for (i = 1; i <= 6; ++i) {
		scanf("%d", &dice1[i]);
	}
	for (i = 1; i <= 6; ++i) {
		scanf("%d", &dice2[i]);
	}
	if (isMatch(dice1, dice2)) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 2688
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

#define MAX_N 14
ll dp[1<<MAX_N][MAX_N];
void init(){
    fill(*dp,*dp + (1<<MAX_N)*MAX_N,LINF);
}

void comp(vector<string>& S){
    ll N = S.size();
    vector<int> f(N,0);
    for(int i = 0; i < N;i++){
        for(int j = 0; j < N;j++){
            if(i == j) continue;
            if(S[j].find(S[i]) != string::npos){
                f[i] = true;
            }
        }
    }
    
    for(ll i = N-1; i >= 0;i--){
        if(f[i]){
            S.erase(S.begin()+i);
        }
    }
}
ll solve(ll N){
    ll res = LINF;
    vector<string> S(N);
    for(auto& in:S) cin >> in;
    comp(S);
    N = S.size();
    vector<vector<ll>> minCost(N,vector<ll>(N,LINF));
    for(int i = 0; i < N;i++){
        for(int j = 0; j < N;j++){
            if(i==j) continue;
            string& s1 = S[i];
            string& s2 = S[j];
            minCost[i][j] = s2.length();
            for(int k = 0; k <s1.length();k++){
                if(s1.substr(k) == s2.substr(0,s1.length()-k)){
                    minCost[i][j] = min(minCost[i][j],(ll)(s2.length() - (s1.length()-k)));
                }
            }
        }
    }
    
    for(int i = 0; i < N;i++){
        dp[1<<i][i] = S[i].length();
    }
    
    //cout << minCost << endl;
    
    for(int i = 0; i < (1<<N);i++){
        for(int j = 0; j < N;j++){
            if(dp[i][j] == LINF) continue;
            for(int k = 0; k < N;k++){
                if((i>>k)&1) continue;
                dp[i|(1<<k)][k] = min(dp[i|(1<<k)][k],dp[i][j]+minCost[j][k]);
                
                //cout << bitset<5>(i) << ' ' << j << ' ' << k << ' ' << minCost[j][k] << endl;
            }
        }
    }
    for(int i = 0; i < N;i++){
        res = min(res,dp[(1<<N)-1][i]);
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    ll N;
    while(cin>>N,N){
        init();
        cout << solve(N) << endl;
    }
    return 0;
}



Measured memory_bytes: 4944
#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<map>
#include<numeric>
#include<queue>
#include<functional>
#include<cassert>
#include<set>
#define rep(a,b) for(int a=0;a<b;++a)
#define REP(a,b,c,d) for(int a=b;a<c;a+=d)
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl
#define mod 1000000007
using namespace std;
using ll = long long;
using p_i = pair<int, int>;
int main() {
	string S; cin >> S;
	bool c = false;
	rep(i, S.size()) {
		if (S[i] == 'C')c = true;
		if (S[i] == 'F'&&c) {
			yes;
			return 0;
		}
	}
	no;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int h,w,i;
string d;
char c='#';
int main(){
  cin>>h>>w;
  for(;i<w+2;i++,cout)cout<<c;
  cout<<endl;
  for(i=0;i<h;i++,cout<<endl)cin>>d,cout<<c<<d<<c;
  for(i=0;i<w+2;i++)cout<<c;
  cout<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
using namespace std;

int main(){

	int N,tmp,table[101];
	scanf("%d",&N);

	for(int i = 0; i <= 100; i++)table[i] = 0;

	for(int i = 0; i < N; i++){
		scanf("%d",&tmp);
		table[tmp]++;
	}

	if(table[100] == N){
		printf("%d\n",N);
		return 0;
	}

	for(int i = 99; i >= 1; i--){
		table[i] += table[i+1];
		if(i <= table[i]){
			printf("%d\n",i);
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 2680