akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define endl '\n'
#define maxl __LONG_LONG_MAX__
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define rep(i, n) for(int i = 0; i < n; i++)
#define rev(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i=1; i < n; i++)
#define rev1(i, n) for(int i=n ; i > 0; i--)
#define FOR(i, a, b) for(int i=a ; i < b; i++)
#define trace(x)                 cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define n_ones(x) __builtin_popcountll(x)
#define n_trailzero(x) __builtin_ctzll(x)
#define n_leadingzero(x) __builtin_clz(x)
#define sz(a) (ll)(a.size())
#define all(v) v.begin(),v.end()

typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<vector<ll>> vvll;
typedef stack<ll> stk;
typedef queue<ll> que;

typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_setll;
typedef tree<char,null_type,less<char>,rb_tree_tag,
tree_order_statistics_node_update> indexed_setc;

ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);} 
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}

ll mod = 1e9 + 7;

void solve()
{	
	ll n, m;
	cin>>n>>m;
	ll a[m];
	ll sum = 0;
	rep(i, m)
	{
		cin>>a[i];
		sum += a[i];
	}
	if(n-sum<0)
		cout<<-1<<endl;
	else
		cout<<n-sum<<endl;
	return;
}

int main()
{
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    cout.tie(NULL);
	ll t = 1;
	//cin>>t;
	rep(i, t)
		solve();
	return 0;
	
}

Measured memory_bytes: 3720
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	int n;
	while(cin>>n,n){
		vi t(n);
		rep(i,n)cin>>t[i];
		int m;
		cin>>m;
		vi in(110,inf);
		while(m--){
			int a,b;
			cin>>a>>b;a--;
			in[a]=min(in[a],b);
		}
		vvi dp(110,vi(n,inf));
		dp[0][0]=0;
		rep(i,109)rep(j,n){
			dp[i+1][0]=min(dp[i+1][0],dp[i][j]+1);
			if(in[i+1]==inf||t[(j+1)%n]<=in[i+1])
				dp[i+1][(j+1)%n]=min(dp[i+1][(j+1)%n],dp[i][j]);
		}
		int mi=inf;
		rep(i,n)mi=min(mi,dp[109][i]);
		cout<<mi<<endl;
	}
}

Measured memory_bytes: 1228
#include <iostream>
using namespace std;

bool isOdd(int input){
	int a = input /2;
  if(a*2==input){
  	return false;
  }else{
  	return true;
  }
}
int main() {
  int k;
	cin >> k;
  	int a = k/2;
  int answer;
  if(isOdd(k)){
    answer=a*(a+1);
  }else{
  	answer = a*a;
  }
  cout << answer << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	int a,b,c,d;
	scanf("%d %d %d %d", &a, &b, &c, &d);
	if(abs(a-c)<=d)
	{
		printf("Yes");
	}
	else if(abs(a-b)<=d and abs(b-c)<=d)
	{
		printf("Yes");
	}
	else
	{
		printf("No");
	}
}

Measured memory_bytes: 1728
#include <string>
#include <iostream>
using namespace std;
int main() {
	string s;
	cin >> s;
	int cnt = 0; long long ans = 0;
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] == 'W') {
			ans += i - cnt;
			++cnt;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 952
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
diff=600001
ans=0
for i in range(n):
    diff_i=abs(t*1000-h[i]*6-a*1000)
    if diff_i<diff:
        ans=i+1
        diff=diff_i
print(ans)

Measured memory_bytes: 3064
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {

  // input
  int n;
  cin >> n;

  std::vector<int> A;
  for (size_t i = 0; i < n; i++) {
    int a;
    cin >> a;
    A.push_back(a);
  }

  // processing
  for (size_t i = 0; i < A.size(); i++) {
    int v = A[i];
    int j = i - 1;
    while (j >= 0 && A[j] > v) {
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = v;

    int a_last = A.back();
    A.pop_back();

    for (int x : A) {
      cout << x << " ";
    }

    cout << a_last << endl;

    A.push_back(a_last);
  }

  // output
  // for (int x : A) {
  //   cout << x << " ";
  // }
  //
  // cout << endl;

  return 0;
}



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

int main(){

    vector<char>data(1e5);

    string s; cin>>s;

    int ans =0,top =0;

    for(int i=0; i<s.size(); i++){
        if( top==0 || data[top] == s[i]){
            data[++top] = s[i];
        }else{
            ans += 2;
            top--;
        }
    }
    cout<<ans<<endl;

    return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  ll n;
  cin >> n;
  map<ll, ll> mp;
  ll ans = 0;
  rep(i, n) {
    ll a;
    cin >> a;
    ans += mp[i + 1 - a];
    mp[i + 1 + a]++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 26280
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(K: int, X: int):
    n = K * 2 - 1
    ret = []
    x = X - K + 1
    for i in range(n):
        ret.append(x + i)
    print(' '.join([str(r) for r in ret]))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(K, X)

if __name__ == '__main__':
    main()


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

int main() {
  int maxHP, N;
  cin >> maxHP >> N;
  vector<int> MP(maxHP + 1, 1e9);
  MP.at(0) = 0;
  for (int i = 0; i < N; i++) {
    int dmg, mpc;
    cin >> dmg >> mpc;
    for (int nowHP = 0; nowHP < maxHP; nowHP++) {
      MP.at(min(nowHP + dmg, maxHP)) = min(MP.at(min(nowHP + dmg, maxHP)), MP.at(nowHP) + mpc);
    }
  }
  cout << MP.at(maxHP) << "\n";
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

var RESULT = []string{"AC", "WA", "TLE", "RE"}

func next() string {
	sc.Scan()
	return sc.Text()
}

func main() {

	N, err := strconv.Atoi(next())

	if err != nil {
		os.Exit(1)
	}

	result := make(map[string]int)

	for i := 0; i < N; i++ {
		key := next()
		result[key]++
	}

	for _, v := range RESULT {
		fmt.Println(v + " x " + strconv.Itoa(result[v]))

	}
}

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

int main() {
    int64_t N,K;
    cin >> N >> K;
    vector<int64_t> A(N+1,0);
    for ( int64_t i = 1; i <= N; ++i){
        int64_t a;
        cin >> a;
        A[i] = a - 1;
    }
    vector<int64_t> S(N+1,0);
    for ( int64_t i = 1; i <= N; ++i){
        S[i] = S[i-1] + A[i];
    }
    
    map<int64_t,int64_t> m;
    m[0] = m[0] + 1;
    int64_t res = 0;
    for ( int64_t i = 1; i <= N; ++i){
        if ( i - K >= 0 ) {
            m[S[i-K]%K] = m[S[i-K]%K] - 1;
        }
        res = res + m[S[i]%K];
        m[S[i]%K] = m[S[i]%K] + 1;
    }
    
    cout << res << endl;
    
    return 0;
}


Measured memory_bytes: 18832
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const ll MOD = (ll) (1e9 + 7);
const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

void finish() {
    cout << -1 << endl;
    exit(0);
}

//------------------------------------------------------

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20) << setiosflags(ios::fixed);

    string s;
    cin >> s;
    int ans[100010] = {};
    int n = s.length();

    //→

    int cnt = 0;

    rep(i, n) {
        if (s[i] == 'R') {
            cnt++;
        } else {
            ans[i - 1] += CEIL(cnt, 2);
            ans[i] += cnt / 2;
            cnt = 0;
        }
    }

    cnt = 0;

    for (int i = n - 1; i >= 0; --i) {
        if (s[i] == 'L') {
            cnt++;
        } else {
            ans[i + 1] += CEIL(cnt, 2);
            ans[i] += cnt / 2;
            cnt = 0;
        }
    }

    rep(i, n) cout << ans[i] << (i == n - 1 ? "\n" : " ");

    return 0;
}


Measured memory_bytes: 1104
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = getInt(sc.nextLine());
        int count = 0;
        for(int i = 1;i < K;i++){
            for(int j = i+1;j <= K;j+=2){
                count++;
            }
        }
//        int N = getInt(s[0]);
        System.out.println(count);
        sc.close();
    }
    static int getInt(String val) {
        return Integer.parseInt(val);
    }
    static long getLong(String val) {
        return Long.parseLong(val);
    }
}

Measured memory_bytes: 23124
N = gets.strip.to_i
a = gets.strip.split(' ').map(&:to_i)

diff = []
a.each_with_index do |v, index|
  left = a[0..index].inject(&:+)
  right = a[index+1..N].inject(&:+)
  next if right.nil?
  diff << (right - left).abs
end

puts diff.sort!.first

Measured memory_bytes: 1788
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		Main mainObj = new Main();
		mainObj.solve();
	}

	public void solve() throws IOException {
		FastScanner fs = new FastScanner();
		String a = fs.next();
		String b = fs.next();
		
		int val = Integer.parseInt(a+b);
		for(int i = 0; i*i <= val; i++) {
			if(i*i == val) {
				System.out.println("Yes");
				return;
			}
		}
		System.out.println("No");
	}

	

	public class FastScanner {

		BufferedReader reader;
		private StringTokenizer st;

		public FastScanner() {
			st = null;
			reader = new BufferedReader(new InputStreamReader(System.in));
		}

		public String next() throws IOException {
			if (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(reader.readLine());
			}
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			st = null;
			String readLine = null;
			readLine = reader.readLine();
			return readLine;
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public int[] nextIntArr(int n) throws NumberFormatException, IOException {
			int[] retArr = new int[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextInt();
			}
			return retArr;
		}

		public long[] nextLongArr(int n) throws NumberFormatException, IOException {
			long[] retArr = new long[n];
			for (int i = 0; i < n; i++) {
				retArr[i] = nextLong();
			}
			return retArr;
		}

		public void close() throws IOException {
			reader.close();
		}
	}

}


Measured memory_bytes: 24532
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N; cin>>N;
    int ans=0;

    for(int i=1;i<=9;i++) {
        for (int j = 1; j <= 9; j++) {
            ans=i*j;
            if (N == ans) {
                cout << "Yes";
                return 0;
            } else {
                continue;
            }
        }
    }
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define PRECISION std::cout << std::fixed << std::setprecision(20);
  
using namespace std;
 
const ll inf = 1e18;
const ll N = 3e5+100;
const ll bits = 20;
const ld pi = 3.14159265358979323846;
const ll mod = 1e9+9;
const ll p = 29;



int main(){
    FASTIO;
    PRECISION; 

    ll n,k;
    cin>>n>>k;

    n%=k;
    cout<<min(abs(n-k),n)<<"\n";
    
 
}

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

int main(){
  string s;
  int K;
  cin>>s>>K;
  set<vector<char>> a;
  for(int i=0;i<K;i++){
    for(int j=0;j<s.size()-i;j++){
      vector<char> sub(0);
      for(int k=j;k-j<=i;k++)
        sub.push_back(s.at(k));
      a.insert(sub);
    }
  }
  int j=0;
  vector<char> b;
  for(auto &i:a){
    if(j==K-1){
      b=i;
      break;
    }
    j++;
  }
  for(char &c:b)
    cout<<c;
  cout<<endl;
}

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

using namespace std;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int d,m,ans=0;
    cin>>m>>d;
    for (int i=2;i<=9;i++)
        for (int j=2;j<=9;j++) {
            int nm = i*j;
            ans+=(10*i+j<=d && nm<=m);
        }
    cout << ans;

}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**8)

ans = []

def dfs(x, y):
    c[x][y] = 0

    for dx in range(-1, 2):
        for dy in range(-1, 2):
            nx = x + dx
            ny = y + dy

            if 0 <= nx < h and 0 <= ny < w and c[nx][ny] == 1:
                dfs(nx, ny)

while True:
    w, h = map(int, input().split())
    if w == 0 and h ==0:
        break

    count = 0

    c = [[] for _ in range(h)]
    for i in range(h):
        if w == 1:
            c[i] = [int(input())]
        else:
            c[i] = list(map(int, input().split()))

    for x in range(h):
        for y in range(w):
            if c[x][y] == 1:
                dfs(x, y)
                count += 1

    ans.append(count)

for i in ans:
    print(i)



Measured memory_bytes: 8004
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main() {
	int num,a=0,b=0,draw;
	int *line = new int[5];
	for (int w = 0; w < 5; w++) {
		cin>>line[w];
	}
	for (int w = 0; w < 5; w++) {
		for (int q = 0;q < 4; q++) {
			if (line[q] < line[q + 1])swap(line[q], line[q + 1]);
		}
	}
	for (int w = 0; w < 5; w++) {
		cout << line[w];
		if (w < 4)cout << " ";
		else cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3104
#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
#include<cctype>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iomanip>
#include<sstream>
#include<vector>
#include<cstdlib>
#include<ctime>
#include<list>
#include<deque>
#include<bitset>
#include<fstream>
#define ld double
#define ull unsigned long long
#define ll long long
#define pii pair<int,int >
#define iiii pair<int,pii >
#define mp make_pair
#define INF 1000000000
#define MOD 1000000007
#define rep(i,x) for(int (i)=0;(i)<(x);(i)++)
inline int getint(){
	int x=0,p=1;char c=getchar();
	while (c<=32)c=getchar();
	if(c==45)p=-p,c=getchar();
	while (c>32)x=x*10+c-48,c=getchar();
	return x*p;
}
using namespace std;
//purplesun
int res=INF,n,k;
vector<int>v1,v2;
//
int main(){
    n=getint();k=getint();
    rep(i,n){
        int x=getint();
        if(x<0)v1.push_back(x);
        else v2.push_back(x);
    }
    reverse(v1.begin(),v1.end());
    rep(i,(min((int)v1.size(),k)+1)){
        if(k-i>v2.size())continue;
        int ans=0,hh=INF;
        if(i>0)ans-=v1[i-1],hh=min(hh,-v1[i-1]);
        else hh=0;
        if(k-i>0)ans+=v2[k-i-1],hh=min(hh,v2[k-i-1]);
        else hh=0;
        res=min(res,ans+hh);
    }
    cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 1020
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception{
		int num = 998244353;

		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
 		String a  = bf.readLine();
 		out.println(a.substring(0, 3));

 		out.close();
 		
 		
 		
 	}
}
 	
 
//StringJoiner sj = new StringJoiner(" "); 
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is

 		
 		
 		
 		
	




Measured memory_bytes: 25412
#include<bits/stdc++.h>
using namespace std;
#define int long long int

int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t,n,m,i,j,k,sum=0;
    cin>>n>>k;
    j=ceil((float)n/(2*k+1));
    cout<<j<<'\n';



    return 0;
}


Measured memory_bytes: 256
N=input()
A=list(map(int,input().split()))

m=1000

tmp = A[0]
stock=0

for i,ai in enumerate(A):
    if tmp>=ai:
        m+=tmp*stock
        stock=0
        if ai < max(A[i:]):
            stock=m//ai
            m-=ai*stock
    tmp = ai
print(m+stock*A[-1])

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 201

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define print(v) for (auto i: v) cerr << i << " ";

ld dist(pi a, pi b) {
    ld dis = 0;
    dis = sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second));
    return dis;
}

int main() {
    fast
    ll n;
    cin >> n;
    vii pairs(n);
    ld tot = 0;
    REP(i, 0, n)
        cin >> pairs[i].first >> pairs[i].second;
    REP(i, 0, n-1)
        REP(j, i+1, n)
            tot += dist(pairs[i], pairs[j]);
    cout << fixed << setprecision(32) << (2.0 * tot) / n << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		s.next();
		String S = s.next();
		s.next();
		
		S = S.substring(0, 1);
		System.out.println("A"+S+"C");
	}	
}

Measured memory_bytes: 9680
import numpy as np

n, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
a = np.sort(a)

cnt = 0
for a_ in a:
    cnt += 1
    if a_ <= x:
        x -= a_
    elif a_ > x:
        x -= a_
        break
print(cnt if x == 0 else cnt - 1)

Measured memory_bytes: 13452
#include <iostream>
using namespace std;

int min(int a, int b) {
	return a > b ? b : a;
}
int max(int a, int b) {
	return a > b ? a : b;
}

int main(){

	int a,b,c;
	cin >> a >> b >> c;
	cout << min(min(a, b), c) << " " << max(max(a, b), c) << endl;
	return 0;
}


Measured memory_bytes: 3092
#include <iostream>
using namespace std;

void swap(int* A, int p, int q){
    int reserve = A[p];
    A[p] = A[q];
    A[q] = reserve;
}

int main(){
    //input
    int n;
    cin >> n;
    int A[n];
    for(int i=0;i<n;i++){
        cin >> A[i];
    }
    
    //calculation
    int k = 0; //number of swaps
    for(int i=0;i<n;i++){
        for(int j=n-1;j>i;j--){
            if(A[j] < A[j-1]){
                swap(A, j, j-1);
                k++;
            }
        }
    }
    
    //output
    for(int i=0;i<n-1;i++){
        cout << A[i] << " ";
    }
    cout << A[n-1] << endl;
    cout << k << endl;
}

Measured memory_bytes: 1160
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	N, M := getInt(), getInt()
	ac := make([]bool, N)
	wa := make([]int, N)
	ans := 0
	miss := 0
	for i := 0; i < M; i++ {
		p, s := getInt()-1, getString()
		if ac[p] == false {
			if s == "AC" {
				ac[p] = true
				miss += wa[p]
				ans++
			} else {
				wa[p]++
			}
		}
	}
	out(ans, miss)
}


Measured memory_bytes: 3212
def main(argv)
  n = gets.chomp.to_i
  p = gets.chomp.split(' ').map(&:to_i)
  
  counter = 0
  (n - 2).times do |i|
    f1 = p[i + 0] < p[i + 1] && p[i + 1] < p[i + 2]
    f2 = p[i + 0] > p[i + 1] && p[i + 1] > p[i + 2]
    if f1 || f2 then
      counter += 1
    end
  end
  puts counter.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end

Measured memory_bytes: 1788
void main() {
	auto ip = readAs!(int[]), H = ip[0], W = ip[1];
	auto ip2 = readAs!(int[]), h = ip2[0], w = ip2[1];
	writeln((H-h)*(W-w));	
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstring>
#include <set>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <stack>
using namespace std;
#define ll long long
#define pb push_back
#define pp pair<long long,long long>
#define ppp pair<long long, pair<long long,long long> >
#define f first	
#define s second
#define pd pair<double,long long>
void solveTestCase() {
	ll n,i,j,k,l;
	string str;
	cin>>str;
	if (str.back()=='s')
		str+="es";
	else
		str+="s";
	cout<<str<<'\n';
}
int main() {
	ll t,n,i,j,k,l,m;
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll p;
	t=1;
	//cin>>t;
	for (ll T=1;T<=t;T++) {
		solveTestCase();
	}
	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
using namespace std;

int main() {
    size_t n;
    cin >> n;
    size_t ret = 0;
    for (size_t i = 1000; 10 <= i; i = i / 10) {
        size_t const amari = n % i;
        size_t const target = i / 10;
        size_t val = amari / target;
        if (val == 1) {
            val =9;
        } else if (val == 9) {
            val = 1;
        }
        ret += val * target;
    }
    cout << ret << endl;
    return 0;
}



Measured memory_bytes: 256
main = do
  [n, a, b] <- map read . words <$> getLine
  print $ solve n a b

solve :: Integer -> Integer -> Integer -> Integer
solve n a b
  | mod (b - a) 2 == 0 = div (b - a) 2
  | otherwise = div (b - a + 1) 2 + min (n - b) (a - 1)


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

int n;
int m;
int k;
int ls[200];
set<int> ps[200];

int main() {
  while (1) {
    scanf("%d", &n);
    if (n == 0) return 0;
  
    for (int i=0; i<n; i++) {
      scanf("%d", &m);
      ps[i].clear();
      for (int j=0; j<m; j++) {
        int p;
        scanf("%d", &p);
        ps[i].insert(p);
      }
    }
  
    scanf("%d", &k);
    for (int i=0; i<k; i++) {
      scanf("%d", &ls[i]);
    }
  
    int ans = -1;
    for (int i=0; i<n; i++) {
      bool possible = true;
      for (int j=0; j<k; j++) {
        if (!ps[i].count(ls[j])) {
          possible = false;
          break;
        }
      }
  
      if (possible) {
        if (ans == -1) ans = i+1;
        else {
          puts("-1");
          ans = -2;
          break;
        }
      }
    }
  
    if (ans != -2) printf("%d\n", ans);
  }
}

Measured memory_bytes: 3608
fun main(){
    val n = readInt()
    val s = ArrayList<Int>()
    var nAc = 0
    var nWa = 0
    var nTle = 0
    var nRe = 0
    for (i in 1..n){
        when(readLine()){
            "AC" -> nAc++
            "WA" -> nWa++
            "TLE" -> nTle++
            "RE" -> nRe++
        }
    }

    println("AC x $nAc")
    println("WA x $nWa")
    println("TLE x $nTle")
    println("RE x $nRe")
}

fun readInt() : Int{
    return readLine()!!.toInt()
}

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

int main() {
    int n,x,y,b,p;
    cin >> n;
    int s,t;
    for (int i = 0; i < n; i++) {
        cin >> x >> y >> b >> p;
        s = x*b+y*p;
        if (b>=5 && p>=2) {
            s *= 0.8;
        }else if (b>=5 && p<=2) {
            t=(x*b+y*2)*0.8;
            s = min(s,t);
        }else if (b<5 && p>=2) {
            t=(x*5+y*p)*0.8;
            s = min(s,t);
        }else if (b<5 && p<2) {
            t=(x*5+y*2)*0.8;
            s = min(s,t);
        }
        cout << s << endl;
    }
    
    return 0;
}



Measured memory_bytes: 3084
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <climits>
using namespace std;

#define MOD1097 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair((first), (second)))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()
#define reall(X) (X).rbegin(), (X).rend()
#define divcel(a, b) (((a) + ((b) - 1)) / (b))

int main(){

	int a, b, c;
	cin >> a >> b >> c;
	cout << c - min(a - b, c) << endl;

	return 0;
}


Measured memory_bytes: 256
from bisect import bisect_right as br
n=int(input())
s=input()
a=[[]for i in range(10)]
for i in range(n):
    a[int(s[i])].append(i)
c=0
for i in range(10):
    if len(a[int(i)])!=0:
        t=a[int(i)][0]
        for j in range(10):
            u=br(a[int(j)],t)
            if len(a[int(j)])!=0 and len(a[int(j)])!=u:
                for h in range(10):
                    if len(a[int(h)])!=0:
                        if a[int(j)][u]<a[int(h)][-1]:
                            c+=1
print(c)

Measured memory_bytes: 4328
use std::cmp;
use std::collections::*;
use std::i32;
use std::io::{self, Read};
use std::mem;

const MOD: usize = 1000000007;

fn main() {
    let stdin = io::stdin();
    let mut sc = Scanner::new(stdin.lock());

    let n: usize = sc.read().unwrap();
    let m: usize = sc.read().unwrap();
    let a: Vec<usize> = sc.read_vec(m).unwrap();
    let mut a = VecDeque::from(a);

    // t[i] = i 段目に行く登り方のパターン
    let mut t = Vec::with_capacity(n + 1);
    t.push(1 as usize);
    for i in 1..n + 1 {
        // i 段目が壊れていたら 0
        let mut zero = false;
        if let Some(ai) = a.front() {
            if ai == &i {
                zero = true;
            }
        }
        if zero {
            a.pop_front();
            t.push(0);
            // println!("{} = 0", i);
            continue;
        }

        let n: usize;
        if i >= 2 {
            n = (t[i - 1] + t[i - 2]) % MOD;
        } else {
            n = t[i - 1] % MOD;
        }
        // println!("{} = {}", i, n);
        t.push(n);
    }

    println!("{}", t[n]);
}

struct Scanner<R: Read> {
    reader: R,
}

impl<R: Read> Scanner<R> {
    fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader }
    }

    fn read<T: std::str::FromStr>(&mut self) -> Option<T> {
        self.reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse()
            .ok()
    }

    fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Option<Vec<T>> {
        (0..n).map(|_| self.read()).collect()
    }

    fn read_vec2d<T: std::str::FromStr>(&mut self, m: usize, n: usize) -> Option<Vec<Vec<T>>> {
        (0..m).map(|_| self.read_vec(n)).collect()
    }

    fn read_board(&mut self, n: usize) -> Option<Vec<Vec<char>>> {
        (0..n)
            .map(|_| {
                self.read::<String>()
                    .map(|s| s.chars().collect::<Vec<char>>())
            })
            .collect()
    }
}


Measured memory_bytes: 6396
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

#define REP(i,n) for (int i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long ll;

int main ()
{
    int N,A,B;
    cin >> N >> A >> B;
    vector < int > P(N);
    REP(i,N) cin >> P[i];

    int cnt[3] = {};
    REP(i,N) {
        if (P[i] <= A) {
            cnt[0]++;
        } else if (P[i] <= B) {
            cnt[1]++;
        } else {
            cnt[2]++;
        }
    }

    int ans = 1e9;
    REP(i,3) {
        ans = min(ans, cnt[i]);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


using namespace std;
const ll INFLL = 1e18;
const int MAXN = 1e6+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef LOCAL
    freopen("a.in","r",stdin);
    #endif
    int n;
    cin>>n;
    int cnt=1;
    int y;
    cin>>y;
    int mx=y;
    for (int i=1;i<n;i++)
    {
        int x;
        cin>>x;
        if (x<=mx)
            cnt++;
        mx=min(x,mx);
    }
    cout<<cnt;



}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int i, n, a[100];

  scanf("%d", &n);

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

  for(i = n-1; i > 0; i--){
    printf("%d ", a[i]);
  }
  printf("%d\n", a[0]);

  return 0;
}

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

using namespace std;

using ll = long long;

#define ALL(A) A.begin(),A.end()

void ALLIN1_NUMBER(vector<ll>& V)
{
    for(auto& x : V)
    {
        cin >> x;
    }
}

void ALLOUT_NUMBER(vector<ll> V)
{
    ll N = V.size();
    for(ll i=0;i<N;i++)
    {
        cout << V[i];
        if(i<N-1) cout << ' ';
    }
    cout << endl;
}

template<class T>
void OUT0(T N)
{
    cout << N << endl;
}

static const double pi = acos(-1.0);

double Cos(double D)
{
    return cos(pi/180 * D);
}

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

    ll pay = 0;
    while(pay<N)
    {
        pay += 1000;
    }

    cout << pay - N << endl;

    return 0;
}

Measured memory_bytes: 3676
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <bitset>

char ch;
template <typename T>
void read(T& x)
{
    x = 0;
    ch = getchar();
    for (; !isdigit(ch); ch = getchar());
    for (; isdigit(ch); x = x * 10 + (ch ^ 48), ch = getchar());
}

long long n, k, rec, s, ans, szeK;
long long a[100010], tot[100010], cst[100010], f[1010010];
std::bitset <110> b[100010];

void dfs(int dep, long long val, long long cost)
{
    if (dep < 0)
    {
        ans = std::max(ans, val);
        return;
    }
    if (val + f[dep + 1] < ans)
        return;
    if (cst[dep] && cost + cst[dep] <= k)
        dfs(dep - 1, val + tot[dep], cost + cst[dep]);
    dfs(dep - 1, val, cost);
}

int getSize(long long x)
{
    int ret = 0;
    while (x)
        ++ret, x >>= 1;
    return ret;
}

int main()
{
    f[0] = 1;
    for (int i = 1; i <= 60; ++i)
        f[i] = f[i - 1] * 2;
    read(n), read(k);
    for (int i = 1; i <= n; ++i)
        read(a[i]), s += a[i];
    std::sort(a + 1, a + n + 1);
    for (int i = 1; i <= n; ++i)
        b[i] = a[i];
    for (int i = b[n].size() - 1; ~i; --i)
        if (b[n][i])
        {
            rec = i;
            break;
        }
    if (getSize(k) - 1 > rec)
        rec = getSize(k) - 1;
    for (long long i = rec; ~i; --i)
    {
        for (int j = 1; j <= n; ++j)
            tot[i] += b[j][i];
    }
    for (int i = 0; i <= rec; ++i)
    {
        if (tot[i] < n - tot[i])
            tot[i] = f[i] * (n - 2 * tot[i]), cst[i] = f[i];
        else
            tot[i] = 0;
    }
    dfs(rec, 0, 0);
    std::cout << s + ans << std::endl;
    return 0;
}

Measured memory_bytes: 4608
#include <iostream>
#include <cstring>
using namespace std;

long long dp[21][101];

int main() {
    int n,i,j,k;
    cin>>n>>i;
    dp[i][0] = 1;
    for(int k=0; k<n-1; ++k) {
        cin>>i;
        if(k == n-2) {
            cout<<dp[i][k]<<endl;
            goto END;
        }
        for(int j=0; j<=20; ++j) {
            if(dp[j][k] > 0) {
                if(j-i >= 0) dp[j-i][k+1] += dp[j][k];
                if(j+i <= 20) dp[j+i][k+1] += dp[j][k];
            }
        }
    }
END:;
}

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

int main(){
    int A,B,C,D;
    cin>>A>>B>>C>>D;

    int a,b;
    a=A/D;
    if(A%D==0){
        a--;
    }
    b=C/B;
    if(C%B==0){
        b--;
    }

    if(a>=b){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repr(i, n) for(int i=n; i>=0; i--)
#define reps(i, s, e) for(int i=s; i<e; i++)
#define inf 1e18
#define vsort(v) sort(v.begin(), v.end())
#define vsortr(v) sort(v.begin(), v.end(), greater<ll>())
#define sz(x) x.size()
#define ceil(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T &a, T b){ if(a<b){ a=b; return true; } return false; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a){ a=b; return true; } return false; }
template<typename T> T gcd(T a, T b){ if(b==0) return a; return gcd(b, a%b); }
template<typename T> T lcm(T a, T b){ return a*b/gcd(a, b); }
template<typename T> void vdebug(vector<T> v){ for(auto vv : v){ cout << vv << " "; } cout << endl; }
template<typename T> void adebug(T arr[], int n){ rep(i, n){ cout << arr[i] << " "; } cout << endl; }
void ans(bool b){ if(b) cout << "Yes" << endl; else cout << "No" << endl; }
void ans2(bool b){ if(b) cout << "YES" << endl; else cout << "NO" << endl; }
int keta(ll num){ int k=0; while(num>0){ num/=10; k++; } return k; }
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};


ll dp[101][100001];

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

    ll n, W, tmpw, tmpv;
    vector<ll> w, v;
    cin >> n >> W;
    rep(i, n){
        cin >> tmpw >> tmpv;
        w.push_back(tmpw);
        v.push_back(tmpv);
    }

    dp[0][0] = 0;

    rep(i, n){
        rep(ww, W+1){
            if(ww + w[i] <= W) chmax(dp[i+1][ww+w[i]], dp[i][ww] + v[i]);
            chmax(dp[i+1][ww], dp[i][ww]);
        }
    }

    ll res = 0;
    rep(i, W+1){
        res = max(res, dp[n][i]);
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 78336
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using Pt = pair<int, int>;

int main()
{
	string s;
	cin >> s;
	if (s.back() == 's')
	{
		s += "es";
	}
	else
	{
		s += "s";
	}
	cout << s << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
typedef  long long ll;
using namespace std;

int main(void) {
	int N;
	cin >> N;
	bool flag = false;

	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (N == i * j){ 
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007

using namespace std;

int main(){

    ll n;
    cin>>n;

    std::vector<ll> v(n);
    for(ll i=0;i<n;i++) cin>>v[i];

    ll ans = 0;
    for(ll i=0;i<n;i++){
        if(v[i]%2 == 1 && (i+1)%2 == 1){
            ans++;
        }
    }

    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 3624
#include <algorithm>
#include <vector>
#include <iostream>
#include <map>
using namespace std;
struct P{
  int d,m;
  P(int d,int m):d(d),m(m){}
};
bool operator < (const P& a,const P& b){
  return a.m>b.m || (a.m==b.m && a.d<b.d);
}
int input(){int a;cin >> a; return a;}
int main(){
  int n,q;
  while(cin>>n>>q,n||q){
    int tbl[101]={};
    vector<P> sche;
    for(int i=0;i<n;++i){
      int m = input();
      while(m--){
	int a = input();
	tbl[a]++;
      }
    }
    for(int i=1;i<=100;++i)
      sche.push_back(P(i,tbl[i]));
    sort(sche.begin(), sche.end());
    if(sche[0].m < q) cout << 0 << endl;
    else cout << sche[0].d << endl;
  }
  return 0;
}

Measured memory_bytes: 1200
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 c = sc.nextInt();
        boolean ans = false;
        if(a <= b) {
            if(a <= c && c <= b) ans = true;
        } else {
            if(a >= c && c >= b) ans = true;
        }
        System.out.println((ans?"Yes":"No"));
        
    } 
}

Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, m;
    cin >> n >> m;
    int ans = 1;
    
    rrep(i, m / n + 1) {
        if (m % i == 0) {
            ans = i;
            break;
        }
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <assert.h>
#include <sstream>
#include <string>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater <>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
using namespace std;
using ll = long long;
typedef std::pair<int,int> P;
 #include <boost/multiprecision/cpp_int.hpp>

using bint = boost::multiprecision::cpp_int;
 
vector<vector<int>> hw(800,vector<int>(800));
vector<vector<int>> visited(800,vector<int>(800));

int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};
ll ans1 = 0;
ll ans2 = 0;
void dfs(P v, P p, int h, int w){
    rep(i,4){
        int nx = v.first + dx[i];
        int ny = v.second + dy[i];
        if (nx == p.first && ny == p.second) continue;
        if (nx>=0 && nx < h && ny >= 0 && ny < w && visited[nx][ny] == 0){
            if (hw[nx][ny] != hw[v.first][v.second]){
                visited[nx][ny] = 1;
                if(hw[nx][ny] == 0) ans1++;
                else ans2++;
                dfs(mp(nx,ny),v,h,w);
            }
            
        }
    }
}

int main(){
    int h,w;
    cin >> h >> w;
    rep(i,h){
        string s;
        cin >> s;
        rep(j,w){
            if (s[j] == '.') hw[i][j] = 0;
            else hw[i][j] = 1;
        }
    }
    


    ll res = 0;
    rep(i,h)rep(j,w){
        if(hw[i][j] == 1 && visited[i][j] == 0){
            ans1 = 0ll;
            ans2 = 1ll;
            visited[i][j] = 1;
            dfs(mp(i,j),mp(-1,-1),h,w);
            res += (ll) ans1*ans2;
            
        }
    }
    cout << res;
}

Measured memory_bytes: 20352
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ll long long int
const int INF = 2147483647;

using namespace std;

int main()
{
  ll a, b, c, k;
  cin >> a >> b >> c >> k;
  if (k % 2 == 0)
  {
    cout << a - b << endl;
  }
  else
  {
    cout << b - a << endl;
  }
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

var (
	n int
)

type Point struct {
	x float64
	y float64
}

func main() {
	fmt.Scan(&n)

	var a, b Point

	a.x = 0
	a.y = 0
	b.x = 100
	b.y = 0

	fmt.Printf("%.8f %.8f\n", a.x, a.y)
	koch(n, a, b)
	fmt.Printf("%.8f %.8f\n", b.x, b.y)

}

func koch(d int, a, b Point) {
	if d == 0 {
		return
	}

	var s, t, u Point
	th := math.Pi * 60.0 / 180.0

	s.x = (2.0*a.x + 1.0*b.x) / 3.0
	s.y = (2.0*a.y + 1.0*b.y) / 3.0
	t.x = (1.0*a.x + 2.0*b.x) / 3.0
	t.y = (1.0*a.y + 2.0*b.y) / 3.0
	u.x = (t.x-s.x)*math.Cos(th) - (t.y-s.y)*math.Sin(th) + s.x
	u.y = (t.x-s.x)*math.Sin(th) + (t.y-s.y)*math.Cos(th) + s.y

	koch(d-1, a, s)
	fmt.Printf("%.8f %.8f\n", s.x, s.y)
	koch(d-1, s, u)
	fmt.Printf("%.8f %.8f\n", u.x, u.y)
	koch(d-1, u, t)
	fmt.Printf("%.8f %.8f\n", t.x, t.y)
	koch(d-1, t, b)
}



Measured memory_bytes: 1180
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int A = sc.nextInt();
		int B = sc.nextInt();
		int T = sc.nextInt();

		//System.out.println(A);
		//System.out.println(B);
		//System.out.println(T);

		int biscuit = ( T / A ) * B;

		//System.out.println(T / A);
		System.out.println(biscuit);

	}

}

Measured memory_bytes: 22868
#include <algorithm>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

using ll = long long;
using namespace std;

template<typename T, class Compare=std::less<T> >
class SlideMin {
    private :
        std::vector<T> data;
        std::deque<int> dq;
    public :
        SlideMin(std::vector<T> a) : data(a) {};
        T get_min();
        int get_min_index();
        void push(int i);
        void pop(int i);
        int size();
};

template<typename T, class Compare>
T SlideMin<T, Compare>::get_min() {
    return data.at(dq.front());
}

template<typename T, class Compare>
int SlideMin<T, Compare>::get_min_index() {
    return dq.front();
}

template<typename T, class Compare>
void SlideMin<T, Compare>::push(int i) {
    while (!dq.empty() && Compare()(data.at(i), data.at(dq.back()))) {
        dq.pop_back();
    }
    dq.push_back(i);
}

template<typename T, class Compare>
void SlideMin<T, Compare>::pop(int i) {
    if (dq.front() == i) {
        dq.pop_front();
    }
}

template<typename T, class Compare>
int SlideMin<T, Compare>::size() {
    return (int)dq.size();
}

int main() {
    int n = 0, k = 0;
    cin >> n >> k;
    vector<int> p(n);
    for (int i=0; i<n; i++) {
        cin >> p.at(i);
    }
    SlideMin<int> mini(p);
    SlideMin<int, std::greater<int>> maxi(p);
    for (int i=0; i<k; i++) {
        mini.push(i);
        maxi.push(i);
    }
    bool sorted = false;
    int cnt = 0;
    if (mini.size() == k) {
        sorted = true;
    }
    else {
        cnt++;
    }
    for (int i=0; i<n-k; i++) {
        maxi.push(i+k);
        mini.push(i+k);
        int M = maxi.get_min_index(), m = mini.get_min_index();
        mini.pop(i);
        maxi.pop(i);
        if (mini.size() == k) {
            sorted = true;
        }
        else if (M != i+k || m != i) {
            cnt++;
        }
    }
    if (sorted) {
        cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3440
#include <stdio.h>

int main(void) {
  double weight;
  
  while(scanf("%lf", &weight) != EOF) {
    if(weight <= 48 ) {
      printf("light fly");
    }
    else if(weight <= 51) {
      printf("fly");
    }
    else if(weight <= 54) {
      printf("bantam");
    }
    else if(weight <= 57) {
      printf("feather");
    }
    else if(weight <= 60) {
      printf("light");
    }
    else if(weight <= 64) {
      printf("light welter");
    }
    else if(weight <= 69) {
      printf("welter");
    }
    else if(weight <= 75) {
      printf("light middle");
    }
    else if(weight <= 81) {
      printf("middle");
    }
    else if(weight <= 91) {
      printf("light heavy");
    }
    else {
      printf("heavy");
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 1044