akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	/** 入力される数値の数 */
	private static final int NUMBER_OF_INPUT = 2;

	/** 入力される数値のインデックス（小） */
	private static final int INDEX_LITTLE = 0;

	/** 入力される数値のインデックス（大） */
	private static final int INDEX_GREAT = 1;

	/**
	 * 空白区切りの2つの数字を受け取り、その2つの数字の最大公約数と最小公倍数を出力する。
	 *
	 * @param args
	 */
	public static void main(String[] args) throws IOException {

		// 入力がある限り処理を行う
		String line = null;
		BufferedReader reader = new BufferedReader(new InputStreamReader(
				System.in));
		while ((line = reader.readLine()) != null) {

			// 入力文字列を数値配列に変換する
			int[] input = convertStringToIntArray(line);

			// 合計値の桁数を取得する
			Arrays.sort(input);
			int greatestCommonDivisor = calculateGreatestCommonDivisor(input);
			int leastCommonMultiplyer = calculateLeastCommonMultiplyer(input, greatestCommonDivisor);

			// 結果を出力する
			System.out.print(greatestCommonDivisor);
			System.out.print(" ");
			System.out.println(leastCommonMultiplyer);
		}

		if (reader != null) {
			reader.close();
		}
	}

	/**
	 * 空白区切りの数値を取得し、整数の配列として返却する。
	 *
	 * @param line
	 *            空白区切りの数値文字列
	 * @return 整数の配列
	 */
	protected static int[] convertStringToIntArray(String line) {
		int[] result = new int[NUMBER_OF_INPUT];

		String[] splittedLine = line.split(" ");
		for (int i = 0; i < splittedLine.length; i++) {
			result[i] = Integer.parseInt(splittedLine[i]);
		}

		return result;
	}

	/**
	 * 引数で渡された整数配列の最大公約数を返す。
	 *
	 * @param input
	 *            整数の配列
	 * @return 最大公約数
	 */
	protected static int calculateGreatestCommonDivisor(int[] input) {

		// ユークリッドの互除法
		int greater = input[INDEX_GREAT];
		int less = input[INDEX_LITTLE];
		int divisor = greater - less;

		while (divisor != 0) {

			// 大きい方の値を greater に、小さい方の値を less に設定する
			if (less >= divisor) {
				greater = less;
				less = divisor;
			} else {
				greater = divisor;
			}
			divisor = greater - less;
		}

		// 最後のひとつ前の値が最大公約数
		return less;
	}

	/**
	 * 引数で渡された整数配列と最大公約数から最小公倍数を返す。
	 *
	 * @param input
	 *            整数の配列
	 * @param greatestCommonDivisor
	 * 			  最大公約数
	 *
	 * @return 最小公倍数
	 */
	protected static int calculateLeastCommonMultiplyer(int[] input, int greatestCommonDivisor) {

		// 最小公倍数 = 入力値A × 入力値B / 最大公約数
		// 最終結果は int の範囲に収まるが、先に割り算しておかないと int の範囲を超える可能性がある
		int leastCommonMultiplyer = input[INDEX_LITTLE] * (input[INDEX_GREAT]
				/ greatestCommonDivisor);
		return leastCommonMultiplyer;

	}

}

Measured memory_bytes: 16932
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = (1e+9)+7;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
int main() {
	int n; cin >> n;
	cout << n * 800 - (n / 15) * 200 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 100000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
 
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

/*---------------------------------------------------*/

int main(){
  ll ryuka[100];
  int n;
  cin>>n;
  ryuka[0]=2;ryuka[1]=1;
  REP(i,2,n+1){
    ryuka[i]=ryuka[i-1]+ryuka[i-2];
    //cout<<i<<" "<<ryuka[i]<<endl;
  }
  cout<<ryuka[n]<<endl;
  return 0;
}


Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        l: f64,
    }
    println!("{:.6}", (l / 3.0).powf(3.0));
}

Measured memory_bytes: 4352
#include<algorithm>
#include<bitset>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> as(n);
    int targ = 0;
    for(int i = 0; i < n; i++){
        cin >> as[i];
        targ += as[i];
    }
    targ = (targ + 1) / 2;
    bitset<(int)4e6 + 1> bs;
    bs[0] = 1;
    for(int i = 0; i < n; i++){
        bs |= bs << as[i];
    }
    for(int i = targ; i <= 4e6; i++){
        if(bs[i]){
            cout << i << '\n';
            return 0;
        }
    }
}


Measured memory_bytes: 1408
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
//#include <random>
#include <map>
//#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <time.h>
//#include <chrono>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <iostream>
#include <limits>
#include <numeric>
//#include <type_traits>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define MOD 1000000007
#define SORT(s) sort(s.begin(), s.end());
#define REVERSE(s) reverse(s.begin(), s.end());
#define SUM(s) accumulate(s.begin(), s.end(), 0LL);
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
//#define int ll
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int ndx[8] = { 0,1,0,-1, 1,1,-1,-1 };
int ndy[8] = { 1,0,-1,0, 1,-1,-1,1 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }




int main() {
	int n;
	cin >> n;
	vector<int> a(n), dp(n+1);

	rep(i, n) {
		cin >> a[i];
		dp[i + 1] = INF;
	}


	dp[0] = -1;
	int ans = 0;

	rep(i, n) {
		int t = a[i];

		vector<int>::iterator it = lower_bound(dp.begin(), dp.end(), t);
		if (it == dp.begin()) {
			continue;
		}
		it--;
		int index = it - dp.begin();

		if (index + 1 < n+1) {
			dp[index + 1] = min(t, dp[index + 1]);
			ans = max(ans, index + 1);
		}

	}


	cout << ans << endl;




}





Measured memory_bytes: 3596
#include <iostream>

using namespace std;

bool f(int a, int b, int c) {
    return a + b == c || a + c == b || b + c == a;
}

int main() {

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

    if (f(a, b, c)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
from itertools import chain

nv, ne, r = map(int, input().split())

in_edges = defaultdict(set)
out_edges = defaultdict(set)
while ne:
    s, t, w = map(int, input().split())
    in_edges[t].add((w, s))
    out_edges[s].add((w, t))
    ne -= 1


def chu_liu_edmond(vertices, cycle_cost):
    global in_edges, out_edges, nv, r

    total_cost = cycle_cost
    prev_v = {v: None for v in vertices}
    next_vs = {v: set() for v in vertices}

    for t in vertices:
        if t == r:
            continue
        min_in_w, min_in_s = min(in_edges[t])
        total_cost += min_in_w
        prev_v[t] = min_in_s
        next_vs[min_in_s].add(t)

    visited = {r}
    queue = set(next_vs[r])
    while queue:
        t = queue.pop()
        visited.add(t)
        queue.update(next_vs[t])

    cycles = []
    for i in vertices:
        if i in visited:
            continue

        cycle_vertices = set()
        while i not in visited:
            visited.add(i)
            cycle_vertices.add(i)
            i = prev_v[i]

        # Branched single path from cycle
        if i not in cycle_vertices:
            continue

        # Current cycle_vertices are not necessarily cycle (may contain branch from cycle)
        cycle_vertices, j = {i}, prev_v[i]
        while j != i:
            cycle_vertices.add(j)
            j = prev_v[j]

        cycles.append(cycle_vertices)

    if not cycles:
        return total_cost

    for cycle in cycles:
        vertices.difference_update(cycle)
        vertices.add(nv)

        for v in cycle:
            prev_e_cost = min(in_edges[v])[0]
            cycle_cost += prev_e_cost
            for w, t in out_edges[v]:
                if t in vertices:
                    out_edges[nv].add((w, t))
                    in_edges[t].remove((w, v))
                    in_edges[t].add((w, nv))
            for w, s in in_edges[v]:
                if s in vertices:
                    new_w = w - prev_e_cost
                    in_edges[nv].add((new_w, s))
                    out_edges[s].remove((w, v))
                    out_edges[s].add((new_w, nv))
            del in_edges[v]
            del out_edges[v]

        nv += 1

    return chu_liu_edmond(vertices, cycle_cost)


print(chu_liu_edmond(set(range(nv)), 0))

Measured memory_bytes: 8920
#!/usr/bin/ruby
# -*- coding: utf-8 -*-

class Main
  def initialize()
    #    fh = open("ALDS1_1_D_in.txt")
    fh = STDIN
    n = fh.gets.chomp.to_i
    count=0
    fl = fh.gets.chomp.split.map{|x| x.to_i}
    abort if fl.length != n

    ans = bubble(fl)
    n = ans.shift
    puts ans.map{|x|x.to_s}.join(" ")
    puts n
  end

  def bubble(a)
    n = 0
    0.upto(a.length-1).each{|i|
      (a.length-1).downto(i+1).each{|j|
        if a[j] < a[j-1] then
          tmp = a[j]
          a[j] = a[j-1]
          a[j-1] = tmp
          n += 1
        end
      }
    }
    a.unshift(n)
  end
end

if $0==__FILE__ then
  Main.new()
end

Measured memory_bytes: 8676
import bisect
n=int(input())
a=[int(x) for x in input().split()]
a.sort()

ma=max(a)
half=ma//2
mi=float('inf')
for i in range(n):
  if abs(half-a[i])<=abs((half-mi)) and ma!=a[i]:
    mi=a[i]

print(ma,mi)


Measured memory_bytes: 20136
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return true; } return false; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll h,w;
  cin>>h>>w;
  vvc t(h,vc(w));
  rep(i,h){
    rep(j,w){
      cin>>t[i][j];
    }
  }
  vvll dp(h,vll(w,0));
  dp[0][0]=1;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(i+1<h&&t[i+1][j]=='.'){
        dp[i+1][j]+=dp[i][j];
        dp[i+1][j]%=MOD;
      }
      if(j+1<w&&t[i][j+1]=='.'){
        dp[i][j+1]+=dp[i][j];
        dp[i][j+1]%=MOD;
      }
    }
  }
  COUT(dp[h-1][w-1]);
}


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

int main(){
  string S;
  cin >> S;
  
  if (S == "MON"){ cout << 6 << endl;}
    if (S == "TUE"){ cout << 5 << endl;}
    if (S == "WED"){ cout << 4 << endl;}
    if (S == "THU"){ cout << 3 << endl;}
    if (S == "FRI"){ cout << 2 << endl;}
    if (S == "SAT"){ cout << 1 << endl;}
    if (S == "SUN"){ cout << 7 << endl;}
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 5005;

int a[MAX_N];
bool dp[MAX_N];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, K;
    cin >> n >> K;
    rep(i,n){
        cin >> a[i];
    }
    vl sm(n+1,0);
    sort(a, a+n, greater<int>());
    rrep(i,n){
        sm[i] = sm[i+1] + a[i];
    }
    int ans = 0;
    dp[0] = true;
    rep(i,n){
        if(K+a[i]-sm[i] > 0){
            bool flag = true;
            srep(j,max(0LL, K-sm[i]),K+a[i]-sm[i]){
                if(dp[j]) flag = false;
            }
            ans += flag;
        }
        rrep(j,K-a[i]+1){
            if(dp[j]) dp[j+a[i]] = true;
        }
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;             
int main()
{
    int n,m,X,Y,a[105],b[105];
    scanf("%d %d %d %d",&n,&m,&X,&Y);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    for(int i=1;i<=m;i++)scanf("%d",&b[i]);
    sort(a+1,a+n+1);
    sort(b+1,b+m+1);
    for(int i=-100;i<=100;i++)if(X<i&&i<=Y&&a[n]<i&&b[1]>=i){printf("No War");return 0;}
    printf("War");
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include<cstdio>
#include <vector>
#include<queue>
#include<limits.h>
#include<string.h>
#include<functional>
#include<map>
#include<set>
#include<list>
#define int long long
using namespace std;

int b[100];
signed main() {
	int a; cin >> a;
	for (int c = 0; c < a; c++) {
		cin >> b[c];
	}
	int ans = 0;
	for (int i = 1; i < a; i++) {
		for (int j = 0; j < i; j++) {
			if (b[j] > b[i])ans++;
		}
	}
	sort(b, b + a);
	for (int i = 0; i < a; i++) {
		if (i)cout << " ";
		cout << b[i];
	}
	cout << endl;
	cout << ans << endl;
}

Measured memory_bytes: 3144
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
  int h, w;
  cin >> h >> w;
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> m;
  m.reserve(h * w);
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    while(a[i] > 0) {
      a[i]--;
      m.push_back(i + 1);
    }
  }
  int cnt = 0;
  for(int i = 0; i < h; i++) {
    if(i % 2 == 0) {
      for(int j = 0; j < w; j++) {
        cout << m[cnt] << " ";
        cnt++;
      }
      cout << endl;
    } else {
      vector<int> p;
      for(int j = w - 1; j >= 0; j--) {
        p.push_back(m[cnt]);
        cnt++;
      }
      reverse(p.begin(), p.end());
      for(int j = 0; j < w; j++) {
        cout << p[j] << " ";
      }
      cout << endl;
    }
  }
  return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1e18+7;
#define rep(i,N) for(ll i=0; i<(N); i++)
#define rep1(i,N) for(ll i=1; i<(N); i++)
#define pb push_back

ll N;
map<ll,ll> mp;

int main(){

cin.tie(0);
ios::sync_with_stdio(false);

cin>>N;

rep(i,N){
	ll a;
	cin>>a;
	mp[a]++;
}

ll square_max=0;
for(auto x:mp) {
	if(x.second>=4) square_max=max(square_max,x.first);
}
ll rec1_max=0;
for(auto x:mp) {
	if(x.second>=2) rec1_max=max(rec1_max,x.first);
}
mp[rec1_max]=0;
ll rec2_max=0;
for(auto x:mp) {
	if(x.second>=2) rec2_max=max(rec2_max,x.first);
}

cout<<max(square_max*square_max,rec1_max*rec2_max)<<endl;

}
	


Measured memory_bytes: 6528
import java.util.*;

class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	
	Scanner in = new Scanner(System.in);

	void solve(){
		while(in.hasNext()){
			int n = in.nextInt();
			if(n == 0) return;
			Map<Integer,Long> m = new LinkedHashMap<Integer,Long>();
			for(int i = 0; i < n; i++){
				int k = in.nextInt();
				long p = in.nextInt(), l = in.nextInt();
				if(m.get(k) == null) m.put(k,p*l);
				else m.put(k,m.get(k)+p*l);
			}
			boolean f = true;
			for(Map.Entry<Integer,Long> entry : m.entrySet()){
				if(entry.getValue() >= 1000000l) {
					System.out.println(entry.getKey());
					f = false;
				}
			}
			if(f) System.out.println("NA");
		}
	}

}

Measured memory_bytes: 35460
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 c = sc.nextInt();
    int d;
    d = a;
    a = b;
    b = d;
    d = c;
    c = a;
    a = d;
    System.out.println(a);
    System.out.println(b);
    System.out.println(c);
    
}
}


Measured memory_bytes: 23764
A = int(input()) #500
B = int(input()) #100
C = int(input()) #50
X = int(input()) #合計金額

count = 0

for s in range(A + 1):
  for t in range(B + 1):
    for u in range(C + 1):
      if s * 500 + t * 100 + u * 50 == X:
        count = count + 1

print(count)

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

int main() {
	vector<int> a(26, 0);
	string s;
	cin >> s;
	for (auto c : s) {
		int i = c - 'a';
		if (a[i] != 0) {
			cout << "no" << endl;
			return 0;
		}
		else {
			++a[i];
		}
	}
	cout << "yes\n";
	return 0;
}

Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;

#define rep(i,N) for(int i=0;i<(int)N;++i)

ll GCD(ll x, ll y) {
    if (y == 0) return x;
    else return GCD(y, x % y);
}

int main()
{
    int N;
    cin >> N;

    cout << 800 * N - 200 * (N / 15) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef complex<double> P;
const double EPS = 1e-8;

int main() {
  int n;
  while(cin>>n,n) {
    vector<P> v;
    REP(i,n) {
      double x,y;
      cin >> x >> y;
      v.push_back(P(x,y));
    }
    int ans = 1;
    REP(i,n-1) {
      for (int j=i+1;j<n;j++) {
        P m = (v[i]+v[j])*P(0.5,0);
        //cout << "m "<< m << endl;
        P a = v[i]-v[j];
        double dis = abs(a);
        if (1-dis*dis/4<0) continue;
        double d = sqrt(1-dis*dis/4);
        int hoge[]={1,-1};
        REP(k,2) {
          P un = (a * P(0, hoge[k])) / dis;
          P o1 = m + un*d;
          //cout << o1 << endl;
          int sum = 0;
          REP(l,n) {
            if (norm(v[l]-o1)<1+EPS) sum++;
          }
          ans = max(ans,sum);
        }
      }
    }
    cout << ans << endl;
    
  }
}

Measured memory_bytes: 992
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  string s, t;
  cin >> s >> t;
  if (t.substr(0, s.size()) == s) cout << "Yes" << endl;
  else cout << "No" << endl;


  return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<stack>
#include<iostream>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define vec(a) vector<int>a
using namespace std;


int main()
{
#ifndef ONLINE_JUDGE
	freopen("output.txt", "w", stdout);
	freopen("input.txt", "r", stdin);
#endif
	fastio
	string str;
	ll n,i,j,k,l,m;
	cin>>str;
	k=0;
	for(i=0;i<str.length();i++)
	{
		k+=(int(str[i])-48);
	}
	if(k%9==0)
		cout<<"Yes\n";
	else
		cout<<"No\n";
	return 0;
}
	

Measured memory_bytes: 3776
#include <stdio.h>

using namespace std;

#define REP(i, n) for (int i = 0; i < n; ++i)

int abs(int l, int r) { return (l > r) ? l - r : r - l; }
int max(int l, int r) { return (l > r) ? l : r; }

int main() {
    int N, Z, W;
    scanf("%d %d %d", &N, &Z, &W);

    int a[N];
    REP(i, N) {
        scanf("%d", &a[i]);
    }

    if (N == 1) {
        printf("%d\n", abs(W, a[N - 1]));
    } else {
        printf("%d\n", max(abs(W, a[N - 1]), abs(a[N - 2], a[N - 1])));
    }

    return 0;
}


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

int main(){
 unsigned long long N;
  cin>>N;
   unsigned long long  A[N];
   unsigned long long  sum=0;
  for( unsigned long long  i=0;i<N;i++){
    cin>>A[i];
  }
  for( unsigned long long  i=1;i<N;i++){
    if(A[i-1]>A[i]){
      sum+=A[i-1]-A[i];
      A[i]=A[i-1];
    }
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 5104
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdbool.h>
#include<math.h>
#include<sstream>
#include<math.h>
#include<vector>
#include<functional>
#include<queue>
#include<utility>
#include<bitset>
typedef long long ll;
#define N (1000000000+7)
#define INF 1e16
using namespace std;
typedef pair<ll, ll> P;

int boardh[2020][2010],boardw[2010][2010];

int main(void) {
	int h, w;
	char s;
	for (int i = 1;i <= 2000;i++) {
		for (int j = 1;j <= 2000;j++) {
			boardh[i][j] = 1;
			boardw[i][j] = 1;
		}
	}
	cin >> h >> w;
	for (int i = 1;i <= h;i++) {
		for (int j = 1;j <= w;j++) {
			cin >> s;
			if (s == '#') {
				boardh[i][j] = 0;
				boardw[i][j] = 0;
			}
		}
	}
	int ans = 0;
	for (int i = 1;i <= h;i++) {
		for (int j = 2;j <= w;j++) {
			if (boardh[i][j] == 0)continue;
			else boardh[i][j] += boardh[i][j - 1];
		}
	}
	for (int i = 1;i <= h;i++) {
		for (int j = w;j >= 2;j--) {
			if (boardh[i][j] == 0)continue;
			else {
				if (boardh[i][j - 1] == 0)continue;
				else boardh[i][j - 1] = boardh[i][j];
			}
		}
	}
	for (int i = 1;i <= w;i++) {
		for (int j = 2;j <= h;j++) {
			if (boardw[j][i] == 0)continue;
			else boardw[j][i] += boardw[j - 1][i];
		}
	}
	
	for (int i = 1;i <= w;i++) {
		for (int j = h;j >= 2;j--) {
			if (boardw[j][i] == 0)continue;
			else {
				if (boardw[j - 1][i] == 0)continue;
				else boardw[j - 1][i] = boardw[j][i];
			}
		}
	}
	/*for (int i = 1;i <= h;i++) {
		for (int j = 1;j <= w;j++) {
			cout << boardw[i][j];
		}
		cout << endl;
	}*/
	for (int i = 1;i <= h;i++) {
		for (int j = 1;j <= w;j++) {
			if (boardh[i][j] != 0) {
				ans = max(ans, boardh[i][j] + boardw[i][j] - 1);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 31744
num = int(input())
a_list = []
for i in range(num):
    a_list.append(int(input()))
M = max(a_list)
M_num = a_list.index(M)
a_list.pop(M_num)
for i in range(num):
    if i != M_num:
        print(M)
    else:
        print(max(a_list))


Measured memory_bytes: 68568
#include "bits/stdc++.h"
using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define MP(a, b) make_pair(a, b)
#define F first
#define S second
#define INF 1 << 30

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;
using namespace std;
int main(){
  int n,a[30];
  while(1){
    cin >> n;
    if(n==0)break;
    for(int i=0;i<n;i++){
      cin >> a[i];
    }

    int r=32;
    for(int i=0;;i++){
      r -= (r-1) % 5;
      printf("%d\n", r);

      r -= a[i%n];
      if(r<0) r=0;
      printf("%d\n", r);

      if(r==0) break;
    }
  }
}

Measured memory_bytes: 3132
/*************************************************************************
	> File Name: 4.cpp
	> Author: Knowledge_llz
	> Mail: 925538513@qq.com 
	> Blog: https://blog.csdn.net/Pig_cfbsl 
	> Created Time: 2020/9/19 19:59:20
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define LL long long
using namespace std;
int read(){
	char x=getchar(); int u=0,fg=0;
	while(!isdigit(x)){ if(x=='-') fg=1; x=getchar(); }
	while(isdigit(x)){ u=(u<<3)+(u<<1)+(x^48); x=getchar(); }
	return fg?-u:u;
}
char s[100000];
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
#endif
	scanf("%s",s);
	printf("%s",s);
	int len=strlen(s);
	if(s[len-1]=='s') printf("es");
	else printf("s");
	return 0;
}


Measured memory_bytes: 3748
#include <bits/stdc++.h>
 
#define REP(i, a, b) for (int i = (int)a; i <= (int)b; i++)
#define fi first
#define sc second
#define pb push_back
#define all(x) x.begin(), x.end()
 
using namespace std;
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pair<int, int>> vpii;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<int, int> pii;
typedef pair<i64, i64> pi64;
typedef vector<pi64> vpi64;
 
const i64 MOD = 1000000007;
const int INF = 2000000000;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
 
    int n;
    cin >> n;

    vi a(n);
    int ans = 0;
    REP(i, 0, n-1) {
		cin >> a[i];    	
    }

    REP(i, 1, n-2) {
    	if ( (a[i-1] <= a[i] && a[i] <= a[i+1]) || (a[i-1] >= a[i] && a[i] >= a[i+1]) ) ans++;
    }

    cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();	
		int B = sc.nextInt();
		int AB = sc.nextInt();
		long Amax = sc.nextInt();
		long Bmax = sc.nextInt();
		
		long ans = 0;
		
		ans = A*Amax + B*Bmax;
		
		if(ans>Amax*AB*2+Math.max(Bmax-Amax, 0)*B)
			ans = Amax*AB*2+Math.max(Bmax-Amax, 0)*B;
		
		if(ans>Bmax*AB*2+Math.max(Amax-Bmax, 0)*A)
			ans = Bmax*AB*2+Math.max(Amax-Bmax, 0)*A;
		
		System.out.println(ans);

	}

}


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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

signed main()
{
    int n, i;
    cin >> n >> i;

    cout << (n - i + 1) << endl;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
a=[1 for i in range(n+2)]
for i in range(m):
    a[int(input())]=0
dp=[0 for i in range(n+1)]
dp[0]=1
for i in range(n):
    if i+1<n+1 and a[i+1]:
        dp[i+1]+=dp[i]
    if i+2<n+1 and a[i+2]:
        dp[i+2]+=dp[i]
print(dp[n]%1000000007)


Measured memory_bytes: 463512
#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const int MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

ll fac[1] = {1}, inv[1] = {1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll mp(ll a,ll b){ll ret=1;while(b){if(b&1)ret=ret*a%MOD;a=a*a%MOD;b>>=1;}return ret;}
ll cmb(ll r, ll c) {return (c>r||c<0) ? 0:fac[r] * inv[c] % MOD * inv[r - c] % MOD;}

int main() {
    ll a,b,c,d;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);

    ll mav = -9e18;
    mav = max(mav, a*c);
    mav = max(mav, a*d);
    mav = max(mav, b*c);
    mav = max(mav, b*d);
    printf("%lld", mav);
}


// author: rdd6584


Measured memory_bytes: 3824
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
  A = list(map(abs,A))
  print(sum(A))
else:
  count=0
  min_A =100000000000000000
  for i in range(N):
    if A[i]<0:
      count=count+1
    if abs(A[i])<min_A:
      min_A = abs(A[i])
  A = list(map(abs,A))
  if count%2==0:
    print(sum(A))
  else:
    print(sum(A)-min_A*2)

Measured memory_bytes: 14412
fun main(args: Array<String>) {
  val sc = if (args.size > 1) java.util.Scanner(java.io.File(args[1])) else java.util.Scanner(System.`in`)
  solve(sc)
}

fun solve(sc: java.util.Scanner) {
  val N = sc.nextInt()
  val A = IntArray(N) { sc.nextInt() }
  val odd = A.filter { it % 2 != 0 }.count()
  val even = A.filter { it % 2 == 0 }.count()
  val oddNum = if (odd % 2 == 1) 1 else 0
  val evenNum = if (even > 0 || odd >= 2) 1 else 0
  println(if (oddNum + evenNum != 1) "NO" else "YES")
}


Measured memory_bytes: 57336
#include <stdio.h>

int main(){
    int N, i = 0;

    scanf("%d", &N);
    int a[N], j = 0, k = 0;

    while(i < N){
        scanf("%d", &a[i]);

        if(a[i] == 1){
            k++;
            if(k > j)j = k;
        }
        else k = 0;
        i++;
    }
    printf("%d\n", j+1);
}


Measured memory_bytes: 2104
#include <iostream>

using namespace std;

double line(double x, double y, double ax, double ay, double bx, double by) {
	return (y-ay)*(bx-ax)-(x-ax)*(by-ay);
}

int main(void) {
	double x1, x2, x3, xp, y1, y2, y3, yp;
	while (cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> xp >> yp) {
		if (
				line(x1,y1,x2,y2,x3,y3)*line(xp,yp,x2,y2,x3,y3) > 0.0 &&
				line(x2,y2,x3,y3,x1,y1)*line(xp,yp,x3,y3,x1,y1) > 0.0 &&
				line(x3,y3,x1,y1,x2,y2)*line(xp,yp,x1,y1,x2,y2) > 0.0)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
using ll =long long;

int main()
{
    int n,k;
    cin>>n>>k;
    vector<int>p(n);
    for(int i=0;i<n;i++)cin>>p[i];

    sort(p.begin(),p.end());ll ans=0;
    for(int i=0;i<k;i++){
        ans+=p[i];
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define what_is(x) cerr<<#x <<" is "<<x<<endl;
#define ll long long 
#define gcd(a,b) __gcd(a,b)
#define pi 2*acos(0.0)
//use emplace_back() instead of push_back()
template<typename T>
void print(T t)
{
	for(const auto& e:t)cout<<e<<" ";
	cout<<endl;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);	
	ll n,m;
	cin>>n>>m;
	ll a[m];
	for(ll i=0;i<m;i++)
	{
		cin>>a[i];
	}
	ll sum=0;
	for(ll i=0;i<m;i++)sum+=a[i];
		if(n-sum<0)
			cout<<-1<<"\n";
		else
			cout<<n-sum<<"\n";
	return 0;
}

Measured memory_bytes: 3720
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = decimal.Parse(Console.ReadLine());
            decimal sum = N * (N - 1) / 2;

            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	

  string S,T;
  cin>>S>>T;
  int ans=T.size();
  int s=S.size();
  int t=T.size();
  for(int i=0;i<=s-t;i++)
  {
    int d=0;
    for(int j=0;j<t;j++)
    {
      if(S[i+j]!=T[j])
      {
        d++;
      }
    }
    ans=min(ans,d);
  }
  cout<<ans;



	return 0;
}

Measured memory_bytes: 3600
#include <cstdio>
bool B[30];
int main (int argc, char const* argv[])
{
	int n;
	for(int i=0;i<28;i++) {
		scanf("%d",&n);
		B[n-1]=true;
	}
	for(int i=0;i<30;i++) {
		if(!B[i])printf("%d\n",i+1);
	}
	return 0;
}

Measured memory_bytes: 1024
#include<cstdio>
#include<algorithm>
using namespace std;
#define MOD 1000000007
#define Maxn 200002
int n;
long long inv[Maxn],s[Maxn];
long long Powmod(long long a,int b)
{
	long long ret=1;
	while(b)
	{
		if(b&1)ret=ret*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return ret;
}
void Pre()
{
	s[0]=1;
	for(int i=1;i<=n;i++)
		s[i]=s[i-1]*i%MOD;
	inv[0]=1;
	inv[n]=Powmod(s[n],MOD-2);
	for(int i=n-1;i>0;i--)
		inv[i]=inv[i+1]*(i+1)%MOD;
}
long long C(int a,int b)
{
	if(a<0||b<0)return 1;
	return s[a]*inv[b]%MOD*inv[a-b]%MOD;
}
int main()
{
	int h,w,a,b;
	scanf("%d%d%d%d",&h,&w,&a,&b);
	n=h+w-2;
	Pre();
	long long ans=C(h+w-2,h-1);
	for(int i=1;i<=b;i++)
	{
		ans-=C(h-a+i-2,h-a-1)*C(a-1+w-i,a-1)%MOD;
		ans=(ans%MOD+MOD)%MOD;
	}
	printf("%lld",ans);
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

int main(){
    ll H,W,K;
    cin >> H >> W >> K;
    vector<vector<char>> c(H,vector<char>(W));
    ll a = 0;
    rep(i,H){
        rep(j,W){
            cin >> c[i][j];
            if(c[i][j]=='#')a++;
        }
    }
    ll ans = 0;
    rep(i,(1LL << H)){
        rep(j,(1LL << W)){
            ll cnt = 0;
            if(i==(1LL << H) -1 && j==(1LL << W) - 1)continue;
            rep(h,H){
                rep(w,W){
                    if((i >> h) &1LL) continue;
                    if((j >> w) &1LL) continue;
                    if(c[h][w]=='#')cnt++;
                }
            }
            if(cnt == K) ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3628
# Aizu Problem 0206: The Next Trip

import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def next_trip(L, cashflow):
    saved = 0
    month = 0
    for m, n in cashflow:
        month += 1
        saved += (m - n)
        if saved >= L:
            return month
    return "NA"

    
while True:
    L = int(input())
    if L == 0:
        break
    cashflow = [[int(_) for _ in input().split()] for __ in range(12)]
    print(next_trip(L, cashflow))

Measured memory_bytes: 7732
#include<bits/stdc++.h>
using namespace std;
#define EPS 1e-14
int main()
{
	while(true){
		double X;
		cin >> X;
		if(X==-1.0)break;
		int F[12];
		for(int i=0;i<12;i++){
			F[i]=0;
		}
		double now=128;
		for(int i=0;i<12;i++){
			if(X>=now-EPS){
				F[i]=1;
				X-=now;
			}
			now/=2;
			//printf("%.3f %.3f\n",X,now);
		}
		if(X>EPS){
			printf("NA\n");
		}
		else{
			for(int i=0;i<12;i++){
				printf("%d",F[i]);
				if(i==7)printf(".");
			}
			printf("\n");
		}
	}
	return 0;
}

Measured memory_bytes: 1216
object Main {
  def main(args: Array[String]): Unit = {
    val n = scala.io.StdIn.readInt()
    val list = (for(i <- 1 to n) yield {
      val Array(a, b, _*) = readLine.split(" ")
      f"$a ${b.toInt}"
    }).toList
    for (mark <- "SHCD"; number <- 1 to 13) {
      if (!list.contains(f"$mark $number")) {
        println(f"$mark $number")
      }
    }
  }
}

Measured memory_bytes: 44388
#include <iostream>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <iomanip>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <utility>
using namespace std;
int ky[8] = {-1,1,-2,2,-2,2,-1,1}; 
int kx[8] = {-2,-2,-1,-1,1,1,2,2};
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int ddy[8] = {-1,0,1,-1,1,-1,0,1};
int ddx[8] = {-1,-1,-1,0,0,1,1,1};
typedef long long ll;
#define pi pair
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define rep1(i,a,b) for(int i = a; i < b; i++)
#define rep2(i,a,b) for(int i = a; i <= b; i++) 
#define INF 999999999999
const double PI = acos(-1.0); 
string t,s;
int ts,ss;
int ans;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> s >> t;
    ss = s.size();
    ts = t.size();
    ans = 10000000;
    for(int i = 0; i <= ss - ts; i++){
        int ret = 0;
        for(int j = 0; j < ts; j++)
            if(s[i + j] != t[j]) ret++;
        ans = min(ans, ret);
    }
    cout << ans;
	return 0;
}

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

int main()
{
	char c;
	cin>>c;
	if(c-'A'>=0 && 'Z'-c>=0)
	{
		cout<<'A'<<endl;
	}
	else
	{
		cout<<'a'<<endl;
	}

	return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  if (N % 1000 % 111 == 0) {
    cout << "Yes" << endl;
  }
  else if (N / 10 % 111 == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
typedef long long ll;
const ll longinf=1LL<<60;
using namespace std;

int n,m;
int k[20];
int s[20][20];
int p[20];
int ans=0;

int flag[20];

int check()
{
    for (int i=1; i<=m; ++i)
    {
        int ans2=0;
        for (int j=1; j<=k[i]; ++j)
            ans2+=flag[s[i][j]];
        ans2%=2;
        if (ans2!=p[i]) return 0;
    }
    return 1;
}

void dfs(int now)
{
    if (now==n+1)
    {
        ans += check();
        return;
    }else
    {
        flag[now]=0;
        dfs(now+1);
        flag[now]=1;
        dfs(now+1);
    }
}

int main()
{
    cin>>n>>m;
    for (int i=1; i<=m; ++i)
    {
        cin>>k[i];
        for (int j=1; j<=k[i]; ++j)
            cin>>s[i][j];
    }
    for (int i=1; i<=m; ++i)
        cin>>p[i];
    dfs(1);
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

#define k 10000

int main() {
  int i, j, n;
  scanf("%d", &n);
  int a[n + 1], b[n + 1], c[k + 1] = {0};

  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    c[a[i]]++;
  }

  for (i = 1; i <= k; i++) {
    c[i] += c[i - 1];
  }

  for (j = n; j >= 1; j--) {
    b[c[a[j]]] = a[j];
    c[a[j]]--;
  }

  for (i = 1; i <= n; i++) {
    if (i > 1)  printf(" ");
    printf("%d", b[i]);
  }
  putchar('\n');

  return 0;
}



Measured memory_bytes: 17432
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <fstream>
#define debug(x) cout << #x << " = " << x << endl
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,n) for(int i = (n); i > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;


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

  ll n;
  cin>>n;
  ll a[n], b[n];
  rep(i,n) cin>>a[i]>>b[i];
  ll sum = 0;
  repr(i, n-1) {
    ll t = a[i] + sum;
    if(t % b[i] == 0) continue;
    sum += b[i] - (t % b[i]);
  }
  cout << sum << endl;

  return 0;

}


Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<numeric>
using namespace std;
#define INF (1 << 30) - 1
#define LINF 1LL << 60
const int MOD = 1000000007;
using ll = long long;
using P = pair<int, int>;

int main(){
  string s;
  cin >> s;
  for(int i = 0; i < s.length(); ++i)cout << "x";
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
/*{{{*/
#include <bits/stdc++.h>
#ifdef _GLIBCXX_DEBUG
int c_;
#define cout (c_?cerr:cout)
#define debug(...) {if(!c_)cerr<<"\033[96;1m";++c_;\
__VA_ARGS__;--c_; if(!c_)cerr<<"\033[0m";}
#else
#define debug(...)
#endif
#define st first
#define nd second
#define all(...) (__VA_ARGS__).begin(), (__VA_ARGS__).end()
#define dump(...) debug(print(#__VA_ARGS__, '=',  __VA_ARGS__))
#define dump_range(...) debug(cerr<<#__VA_ARGS__<<": ";print_range(__VA_ARGS__))
using namespace std; using ll = long long; 
template< typename t > using V = vector< t >; void print(){cout<<'\n';}
template< typename t, typename... v > void print(const t& a, v&&... b)
{cout << a << (sizeof...(b)? " " : ""); print(b...);}
template< typename t > void print_range(t a, const t& b)
{while (a!=b) cout << (*a++) << ' '; cout << '\n';}
/*}}}*/

int n, m;
string p, q;

ll lcm(ll a, ll b)
{
    return a * b / __gcd(a, b);
}

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

    cin >> n >> m >> p >> q;

    ll l = lcm(n, m);
    int a = l / n;
    int b = l / m;
    int x = lcm(a, b) / a;
    int y = lcm(a, b) / b;
    
    for (int i = 0; i * x < n and i * y < m; ++i)
        if (p[i * x] != q[i * y]) return print(-1), 0;

    print(l);
}

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

using namespace std;

typedef long long ll;

#define FOR(a, b, i) for(int i=a; i<b; i++)
#define RFOR(a, b, i) for(int i=a; i>=b; i--)
#define PB push_back
#define MP make_pair
#define MOD 1e9+7
#define newline cout<<"\n"

const int nax = 3005;

// vector<vector<double> > dp(nax, vector<double> (nax, 0));
vector<double> dp(nax, 0);

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int n; cin>>n;
    // dp[0][0] = 1;
    dp[0] = 1;

    FOR(1, n+1, i)
    {
        double p; cin>>p;
        RFOR(i, 1, j)
        {
            dp[j] += p*dp[j-1];
            dp[j-1]*=(1-p);
        }
    }

    int k = n/2;
    if(n%2!=0) k++;
    double ans=0;
    FOR(k, n+1, i) ans+=dp[i];

    printf("%0.10lf\n", ans);
    

    return 0;
}

Measured memory_bytes: 384