akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
using ll =long long;
using db = double;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
const int mod = 1e9 + 7;

//ここから書き始める
int main()
{
	cout << setprecision(10);
	string s;
	cin >> s;
	int n = s.size();
	int fora, forz;

	rep(i,n){
		if(s[i] == 'A'){
			fora = i;
			break;
		}
	}

	for(int i = n - 1; i >= 0 ; i -- ){
		if(s[i] == 'Z'){
			forz = i;
			break;
		}
	}
	cout << forz - fora + 1 <<endl;


}


Measured memory_bytes: 640
/*input

*/
#include <iostream>
#include <cstdio>
#include <vector>
#include <functional>
#include <cmath>
#include <cstring>
#include <utility>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <list>
#include <cstdlib>
#include <list>
#include <cassert>
#include <ctime>
#include <fstream>
#include <sstream>
using namespace std;
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define mp make_pair
#define ll long long
#define N
// const int INF = 1e18;
int n;
int cnt = 0;
int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		int t; cin >> t;
		cnt += t % 2;
	}
	if (cnt % 2) {
		if (cnt == n) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	else cout << "YES" << endl;
}

Measured memory_bytes: 256
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy
import heapq
import decimal
import statistics
import queue

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

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


# ===CODE===
def main():
    k = ni()

    que = queue.Queue()

    if k < 11:
        print(k)
        exit(0)

    for i in range(1, 10):
        que.put(i)

    cnt = 9
    flg = True
    while flg:
        tmp = que.get()
        grade1 = tmp % 10

        for i in (-1, 0, 1):
            if -1 < grade1 + i < 10:
                que.put(tmp * 10 + grade1 + i)
                cnt += 1
                if cnt == k:
                    print(tmp * 10 + grade1 + i)
                    exit(0)


if __name__ == '__main__':
    main()


Measured memory_bytes: 76028
#include <bits/stdc++.h>
using namespace std;
#define anuj ios_base::sync_with_stdio(false);cin.tie(NULL)
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)
#define ll long long int
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%I64d",&x)
#define ss(s)	scanf("%s",s)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define clr(x) memset(x, 0, sizeof(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define endl '\n'
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pll;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pll>		vpll;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
const int mod = 1000000007;
const int N = 2e5;
const int LG = 20;
ll a[N],dp[N];

int main(){
	anuj;

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

	Fo(i,1,n+1) cin >> a[i], dp[i]=1e9;
	dp[1]=0;dp[2]=abs(a[2]-a[1]);

	Fo(i,3,n+1) {
		for(int j=1;j<=k && (i-j)>=1;j++)
			dp[i]=min(dp[i],dp[i-j]+abs(a[i]-a[i-j]));
	}
	

	cout << dp[n];



}


Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#define ll long long

using namespace std;

long long MOD = 1000000007;

int main(){
    int K;
    cin >> K;
    deque<ll> que;
    for(int i=1; i<10; i++){
        que.push_back(i);
    }
    K--;
    while((int) que.size()>0 && K>0){
        ll x = que.front();
        //cout << que.front() << endl;
        if(x%10>0){
            que.push_back(x*10+x%10-1);
        }
        que.push_back(x*10+x%10);
        if(x%10<9){
            que.push_back(x*10+x%10+1);
        }
        que.pop_front();
        K--;
    }
    cout << que.front() << endl;
}

Measured memory_bytes: 1792
package main

import (
    "fmt"
    "sort"
)

var n, k int
var vs []int

func main() {
    fmt.Scan(&n, &k)
    vs = make([]int, n)
    for i := 0; i < n; i++ {
        var v int
        fmt.Scan(&v)
        vs[i] = v
    }

    var max int
    for l := 0; l <= min(n, k); l++ {
        for r := 0; r <= min(n-l, k-l); r++ {
            for d := 0; d <= min(l+r, k-l-r); d++ {
                s := calc(l, r, d)
                if s > max {
                    max = s
                }
            }
        }
    }

    fmt.Println(max)
}

func calc(l, r, d int) int {
    var s []int
    s = append(s, vs[:l]...)
    s = append(s, vs[n-r:]...)
    sort.Sort(sort.Reverse(sort.IntSlice(s)))
    var v int
    for i := 0; i < l+r-d; i++ {
        v += s[i]
    }
    return v
}

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


Measured memory_bytes: 7684
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end(), greater<ll>());
    ll ans = A[0];
    int idx = 1;
    for (int i = 2; i < N; i++) {
        ans += A[idx];
        if (i % 2 == 1) idx++;
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 4840
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def judge(bit):
    # i人目の証言を検証する
    for i in range(N):
        # i人目が正直でなければその証言は無視する
        if not (bit & (1<<i)):
            continue
        for v in V[i]:
            x = v[0]
            y = v[1] # y = 1: 正直 y = 0: 不親切
            # y = 1なのに不親切はダメ
            if y == 1 and not(bit & (1<<x)):
                return False
            # y = 0なのに正直者はダメ
            if y == 0 and (bit & (1<<x)):
                return False
    return True

N = int(input())
V = {}
for i in range(N):
    A = int(input())
    V[i] = []
    for j in range(A):
        x, y = input_nums()
        V[i].append((x-1, y)) # 0-index

res = 0
for bit in range(1 << N):
    if judge(bit):
        count = 0
        for i in range(N):
            if bit & (1 << i):
                count += 1
        res = max(res, count)

print(res)

Measured memory_bytes: 3064
#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<algorithm>

using namespace std;

void odd(int n, int k)
{
    long long count = 0;
    for (int i = 1; i <= n; i++) {
        if (i % k == 0) {
            count++;
        }
    }
    count = count * count * count;
    cout << count << endl;
}

void even(int n, int k)
{
    long long count1 = 0;
    long long count2 = 0;
    for (int i = 1; i <= n; i++) {
        if (i % k == 0) {
            count1++;
        } else if (i % k == k / 2) {
            count2++;
        }
    }
    count1 = count1 * count1 * count1;
    count2 = count2 * count2 * count2;
    cout << count1 + count2 << endl;
}

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

    if (k % 2) {
        odd(n, k);
    } else {
        even(n, k);
    }

    return 0;
}


Measured memory_bytes: 256
n = int(input())
list_ = []
for _ in range(n):
    x, l = map(int, input().split())
    list_.append([x-l, x+l])

list_.sort(key=lambda x: x[1])

res = n
pos = -float('inf')
for l, r in list_:
    if l < pos:
        res -= 1
    else:
        pos = r

print(res)

Measured memory_bytes: 92508
import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        int a[][]=new int[n][2],i;
        for(i=0;i<n;i++)
        {
            String s[]=bu.readLine().split(" ");
            a[i][0]=Integer.parseInt(s[0]);
            a[i][1]=Integer.parseInt(s[1]);
        }

        long max=Long.MIN_VALUE; int pp[]={1,-1},qq[]={1,-1};
        for(int p:pp)
        for(int q:qq)
        {
            long sm=p*a[0][0]+q*a[0][1];
            for(i=1;i<n;i++)
            {
                long cur=p*a[i][0]+q*a[i][1];
                max=Math.max(max,cur-sm);
                sm=Math.min(sm,cur);
            }
        }
        System.out.print(max);
    }
}


Measured memory_bytes: 62252
local x, y = io.read("*n", "*n")
local a, b, c = io.read("*n", "*n", "*n")
local p, q, r = {}, {}, {}
for i = 1, a do
  p[i] = io.read("*n")
end
for i = 1, b do
  q[i] = io.read("*n")
end
for i = 1, c do
  r[i] = io.read("*n")
end
table.sort(p, function(x, y) return x > y end)
table.sort(q, function(x, y) return x > y end)
table.sort(r, function(x, y) return x > y end)
local redsum = 0LL
for i = 1, x do
  redsum = redsum + p[i]
end
local greensum = 0LL
for i = 1, y do
  greensum = greensum + q[i]
end
local redpos, greenpos = x, y
local totsum = redsum + greensum
for i = 1, c do
  local changed = false
  local cv = r[i]
  if 0 < redpos and 0 < greenpos then
    if p[redpos] < q[greenpos] then
      if p[redpos] < cv then
        totsum = totsum - p[redpos] + cv
        redpos = redpos - 1
        changed = true
      end
    else
      if q[greenpos] < cv then
        totsum = totsum - q[greenpos] + cv
        greenpos = greenpos - 1
        changed = true
      end
    end
  elseif 0 < redpos then
    if p[redpos] < cv then
      totsum = totsum - p[redpos] + cv
      redpos = redpos - 1
      changed = true
    end
  elseif 0 < greenpos then
    if q[greenpos] < cv then
      totsum = totsum - q[greenpos] + cv
      greenpos = greenpos - 1
      changed = true
    end
  end
  if not changed then break end
end
local str = tostring(totsum):gsub("LL", "")
print(str)


Measured memory_bytes: 4736
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(A: int, B: int, T: int):
    print(B*int(T/A))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(A, B, T)


if __name__ == '__main__':
    main()


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


int main() {
	int x,y;
 	cin >> x >> y;
   vector<int> v; 
 	v ={0,1,3,1,2,1,2,1,1,2,1,2,1};
 	if(v[x]==v[y]){
     cout << "Yes" << endl;
   }
 	else{
     cout << "No" <<  endl;
   }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(){
  while(1){
    int dp[17][17], cond[17][17], x, y, i, j;
    int ans = 0;
    scanf("%d%d", &x, &y);
    if(x == 0 && y == 0)return 0;
    memset(dp, 0, sizeof(dp));
    for(i = 0;i < y;i++){
      for(j = 1;j <= x;j++){
	scanf("%d", &cond[i][j]);
      }
    }
    for(i = 0;i < y;i++){
      for(j = 1;j <= x;j++){
	if(i == 0)
	  dp[i][j] = !cond[i][j];
	if(cond[i][j] == 2)
	  dp[i + 2][j] += dp[i][j];
	if(cond[i][j] == 0){
	  if(cond[i + 1][j] != 1)
	    dp[i + 1][j] += dp[i][j];
	  if(cond[i + 1][j - 1] == 0)
	    dp[i + 1][j - 1] += dp[i][j];
	  if(cond[i + 1][j + 1] == 0)
	    dp[i + 1][j + 1] += dp[i][j];
	}	
      }
    }
    for(j = 1;j <= x;j++){
      if(cond[y - 1][j] != 1)
	ans += dp[y - 1][j];
      if(cond[y - 2][j] == 2)
	ans += dp[y - 2][j];
    }
   
    printf("%d\n", ans);
  }
}

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

#include <assert.h>    // LON
#include <math.h>    // sqrt()


using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }


//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<ll, vector<ll>, greater<ll>> PQ_ASK;
const int mod = 1000000007;


int main() {
    int n;

    cin >> n;
    vector<int> characters(26, 0);
    {
        string s;
        cin >> s;
        for (char c : s) {
            int index = c - 'a';
            characters[index]++;
        }
    }
    rep(i, n - 1) {
        vector<int> nc(26, 0);
        string s;
        cin >> s;
        for (char c : s) {
            int index = c - 'a';
            nc[index]++;
        }
        for (int j = 0; j < 26; j++) {
            characters[j] = min(characters[j], nc[j]);
        }
    }

    multiset<char> cs;

    for (int i = 0; i < 26; i++) {

        for (int j = 0; j < characters[i]; j++) {
            cs.insert('a' + i);
        }

    }

    for(char c : cs) {
        cout << c ;
    }
    cout << endl;

}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp setprecision
#define pb(x) push_back(x)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ld, ld> pdd;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = 1e8;
const ll INF = 1e16;
const string alpha = "abcdefghijklmnopqrstuvwxyz";

int main(){
    int a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;
    int ans = 0;
    if(a+b < 2*c){
        ans = a*x+b*y;
    }
    else{
        ans = min(x,y)*2*c;
        if(x > y){
            if(a > 2*c) ans = x*2*c;
            else ans += (x-y)*a;
        }
        else{
            if(b > 2*c) ans = y*2*c;
            else ans += (y-x)*b;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<set>
#include<map>
#include<queue>
using namespace std;
typedef long long  LL;
#define sqr(x) ((x)*(x))
#define mp make_pair
#define F first
#define S second
inline int read(){
	int x = 0; char ch = getchar(); bool positive = 1;
	for (; !isdigit(ch); ch = getchar())	if (ch == '-')	positive = 0;
	for (; isdigit(ch); ch = getchar())	x = x * 10 + ch - '0';
	return positive ? x : -x;
}
inline void write(int a){
    if(a>=10)write(a/10);
    putchar('0'+a%10);
}
inline void writeln(int a){
    if(a<0){
    	a=-a; putchar('-');
	}
	write(a); puts("");
}
#include<string>
string s;
int dp[1<<26],sum,oo=10000005;
int main(){
	cin>>s;
	for(int i=1;i<(1<<26);i++)dp[i]=oo;
	for(int i=0;i<s.length();i++){
		sum^=1<<(s[i]-'a');
		int zs=oo;
		for(int j=0;j<26;j++)zs=min(zs,dp[sum^(1<<j)]+1);
		if(i==s.length()-1)cout<<min(dp[sum]+1,zs)<<endl;
		dp[sum]=min(dp[sum],zs);
	}
}

Measured memory_bytes: 262780
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

template<class T> inline void chmin(T& a, T b){
    if (a > b){
        a = b;
    }
}

template<class T> inline void chmax(T& a, T b){
    if (a < b){
        a = b;
    }
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    ll A,B,C,K;
    cin >> A >> B >> C >> K;
    K%=2;
    cout << (K ? B-A:A-B) << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/detail/standard_policies.hpp>
// using namespace __gnu_pbds;
using namespace std;
// using cd = complex<double>;
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
//     tree_order_statistics_node_update>;
 
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("unroll-loops")
typedef long long int ll;
typedef long double ld;
const ll N = 1e6;
// const ll m = 1e9 + 7;
const ll inf= 1e14;
const ll mod =1e9+7;
const double PI = acos(-1);
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define pld pair<ld,ld>
ll powm(ll a, ll b) { a = a%mod;ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; }
ll n;
ll a[N];
ll f(ll b){
    ll ans =0;
    for(int i = 0;i<n;i++){
        ans+=abs(a[i]-b);
    }
    return ans;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt","w",stderr); 
    #endif  
    ll t = 1;
    // cin>>t;
    while(t--){
        cin>>n;
        ll ma = 0,mi = inf;
        for(int i = 0;i<n;i++){
            cin>>a[i];
            a[i]-=(i+1);
            ma = max(ma,a[i]);
            mi = min(mi,a[i]);
        
        }
        ll B = ma,A = mi;
        while(B - A > 4)
        {
            int m1 = (A + B) / 2;
            int m2 = (A + B) / 2 + 1;

            if(f(m1) > f(m2))
               A = m1;
            else
               B = m2;
        }

        ll ans = inf;
        // cout<<ans<<'\n';

        for(int i = A; i <= B; i++){
            ans = min(ans , f(i));
        }
        cout<<ans<<'\n';
    }
        
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int, int>
#define p3i pair<pii, int>
#define pll pair<ll, ll>
#define p3l pair<pll, ll>
#define vi vector<int>
#define vpii vector<pii>
#define vp3i vector<p3i>
#define vpll vector<pll>
#define vp3l vector<p3l>
#define lseg L, (L+R)/2, N*2+1
#define rseg (L+R)/2+1, R, N*2+2
#define ub upper_bound
#define lb lower_bound
#define pq priority_queue
#define MN 1000000007
#define fox(k, x) for (int k=0; k<x; ++k)
#define fox1(k, x) for (int k=1; k<=x; ++k)
#define foxr(k, x) for (int k=x-1; k>=0; --k)
#define fox1r(k, x) for (int k=x; k>0; --k)
#define ms multiset
#define flood(x) memset(x, 0x3f3f3f3f, sizeof x)
#define drain(x) memset(x, 0, sizeof x)
#define rng() ((rand() << 14)+rand())
#define scan(X) do{while((X=getchar())<'0'); for(X-='0'; '0'<=(_=getchar()); X=(X<<3)+(X<<1)+_-'0');}while(0)
char _;
#define pi 3.14159265358979323846

int n, p, a[200005], b[200005];
int32_t main(){
    cin >> n;
    fox(l, n){
        cin >> a[l];
    }
    sort(a, a+n);
    while(p<n-2 && abs(a[n-1]-2*a[p])>=abs(a[n-1]-2*a[p+1])) ++p;
    cout << a[n-1] << ' ' << a[p];
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#define PI 3.141592653589
typedef long long ll;
const int MOD = 1000000007;
const int INF = 2002002002;
const int di[] = { -1, 0, 1, 0 };
const int dj[] = { 0, -1, 0, 1 };
using namespace std;

int main() {
	int a, b, h, m;
	cin >> a >> b >> h >> m;
	long double mi = 360 * m / 60;
	long double ho = (360 * h + mi) / 12;
	long double rad = (mi > ho ? mi - ho : ho - mi);
	rad = (rad > 360 - rad ? 360 - rad : rad);
	long double ans = sqrt(a * a + b * b - 2 * a * b * cos(rad*PI/180));
	cout << setprecision(12) << ans << endl;
	return 0;
}


Measured memory_bytes: 4148
from collections import Counter as ct

s = input()
t = input()

c_s = ct(s)
c_t = ct(t)

n_s = []
n_t = []

for w in set(s):
    n_s.append(c_s[w])

for w in set(t):
    n_t.append(c_t[w])

b = sorted(n_s) == sorted(n_t)

if b:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 4136
//From Naruto to Hokage
//#include <RJ>
#include<bits/stdc++.h>
using namespace std;

#define ll          long long
#define pb          push_back
#define eb          emplace_back
#define endl        '\n'
#define mii         map<ll,ll>
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define INF         (1ll<<60)
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
#define rrep(i,a,b)  for(ll i=a;i>=b;i--)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
const int N=100005;
void solve(){
    ll a,b;
    cin>>a>>b;
    ll curr=1;
    ll tot=0;
    while(curr<b){
        curr--;
        curr+=a;
        tot++;
    }
    cout<<tot;
}
signed main()
{
    ios
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        solve();
    }
    time
    return 0;
}

Measured memory_bytes: 256
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();
        boolean f = false;
        for (int i = 1; i <= 1000; i++) {
            int at = (int) (i * 0.08);
            int bt = (int) (i * 0.1);
            if (at == a && bt == b) {
                System.out.println(i);
                f = true;
                break;
            }
        }
        if (!f) {
            System.out.println(-1);
        }
    }
}

Measured memory_bytes: 21972
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;

int main() {
	double a, l, x;
	while (cin >> a >> l >> x) {
		double y = sqrt(l * l - (a / 2) * (a / 2));
		double h = (l + x) / 2.;
		double z = sqrt(h * h - (l / 2) * (l / 2));
		printf("%.10lf\n", a * y / 2. + l * z);
	}
	return 0;
}

Measured memory_bytes: 1240
#include <cstdio>

int a, b;
int n, m;

int main() {
	scanf("%d%d", &a, &b);
	if (a <= 0 && 0 <= b) {
		puts("Zero");
		return 0;
	}
	if (a < 0) n = -a;
	if (b < 0) m = 1 - b;
	puts((n - m) & 1? "Negative" : "Positive");
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
int main(){
  int n;
  while(cin>>n){
    if(n==0)break;
    int a[5000],sum[5001];
    sum[0]=0;
    for(int i=0;i<n;i++){
      cin>>a[i];
      sum[i+1]=sum[i]+a[i];
    }
    int ans=-1000000;
    for(int i=0;i<n;i++){
      for(int j=i+1;j<=n;j++){
        ans=max(ans,sum[j]-sum[i]);
      }
    }
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 1196
#pragma region
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue> 
#include <stack>
#include <set>
#include <list>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	string s; cin >> s;
	int n = s.size() + 1;
	vector<int> a(n, 0);
	int cnt = 0;
	rep(i, n - 1)
	{
		if (s[i] == '<')++cnt;
		else cnt = 0;
		a[i + 1] = cnt;
	}
	cnt = 0;
	for (int i = n - 2; i >= 0; --i)
	{
		if (s[i] == '>')++cnt;
		else cnt = 0;
		a[i] = max(a[i], cnt);
	}
	ll res = 0;
	rep(i, n)res += a[i];
	cout << res << endl;
}

Measured memory_bytes: 2820
#include <bits/stdc++.h>
     
    #define REP(i, n) for(int i = 0; i < (int)(n); ++i)
    #define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
    #define INF 2000000000
     
    #ifdef LOCAL
      #define eprintf(...) fprintf(stdout, __VA_ARGS__)
    #else
      #define eprintf(...) 0
    #endif
     
    using namespace std;
     
    typedef long long LL;
    typedef unsigned long long ULL;
    typedef unsigned int uint;
     
    std::vector<std::string> split(const std::string &str, char delim) {
      std::istringstream stream(str);
      std::string element;
      std::vector<std::string> result;
      while(std::getline(stream, element, delim)) {
        result.push_back(element);
      }
      return result;
    }
     
    int main() {
      //const int x_max = 100000;
     
      uint n;
      string str;
      scanf("%u", &n);
      vector<int> nums;
      int a;
      REP(i, n) {
        scanf("%d", &a);
        nums.push_back(a);
      }
      /*
      getchar();
      getline(cin, str);
      vector<string> strnums = split(str, ' ');
      //REP(i, strnums.size()) { cout<<strnums[i]<<endl; }
      vector<int> nums;
      REP(i, strnums.size()) {
        nums.push_back(atoi(strnums[i].c_str()));    
      }
      */
      //REP(i, nums.size()) { cout<<nums[i]<<endl; }
      
      map<int, int> m;
     
      for(auto &x : nums) {
        m[x-1]++;
        m[x+1]++;
        m[x]++;
      }
      int ans = 0;
      for(auto &x : m) {
        ans = max(ans, x.second);
      }
      cout << ans;
     
      return 0;
    }

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

using namespace std;

int main(void)
{
	int a,b,c;

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

	cin >> a >> b >> c;

	if(a+b>=c)
	{
		cout << "Yes" << '\n';
	}
	else
	{
		cout << "No" << '\n';
	}
	return 0;
}

Measured memory_bytes: 256
import math
N = int(input())
XY = [0]*N
for i in range(N):
    XY[i] = list(map(int,input().split()))
sum = 0


for i in range(N-1):
    for j in range(i+1, N):
        sum += math.sqrt((XY[i][0]-XY[j][0])**2 + (XY[i][1]-XY[j][1])**2)

ans = sum * 2 / N
print(ans)

Measured memory_bytes: 38384
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
if X >= Y:
    print('War')
    exit()
for i in range(X+1, Y+1):
    if max(x) < i and min(y) >= i:
        print('No War')
        exit()
print('War')


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int X;
  cin >> X;
  int64_t ans = 0;
  for (int i = 0; i < 100000; i++) {
    ans += i;
    if (ans >= X) {
      cout << i << endl;
      break;
    }
  }
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define tr(container, it) \
	for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c,x) ((c).find(x) != (c).end())   //O(log n) 
#define contains(c,x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define Ichar(_x) char _x;scanf("%c",&_x);
#define Iint(_x) int _x;scanf("%d",&_x); 
#define Ill(_x)  ll _x;scanf("%lld",&_x);
#define inc(a,b,x)(x)>a && (x)<b	
#define incE(a,b,x)(x)>=a && (x)<=b	
//freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);

vector<pair<int,int>> factorize(int n)
{
	vector<pair<int, int>> vp;
	int primes[] = { 2,3,5,7,11,13,17,19,23,29,31,37 };
	for (int i = 0; i < 12; ++i)
	{
		int m = 0;
		while (n%primes[i]==0)
		{
			n = n / primes[i];
			m++;
		}
		if (m > 0)vp.push_back(make_pair(primes[i], m));
	}
	for(auto a :vp)
	{
		std::cout << a.first <<":" << a.second <<"\n";
	}

	return vp;

}
int main()
{
	Iint(n);
	deque<int> dq;
	bool b = 1;
	for (int i = 0; i < n; ++i)
	{
		Iint(a);
		if (b)dq.push_back(a);
		else { dq.push_front(a); }
		b = !b;
	}
	if(b)for (int i = 0; i < n; ++i)
	{
		std::cout << dq[i] <<" ";	
	}
	else {
		for (int i = n - 1; i >= 0; --i)
		{
			std::cout << dq[i] << " ";
		}
	}
	





}




Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
#define fl(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define endl '\n'
#define pb push_back
#define ff first
#define ss second
#define mod 1000000007
#define mx 205
#define inf 2e9
#define nitro ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int main()
{
    nitro ;
    int n;
    cin>>n;
    set<int >s;
    for(int i=0;i<n;i++){
        int b;
        cin>>b;
        s.insert(b);
    }
    if(s.size() == n){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
	    
	    
	    using namespace std;
	
	    #define ll long long
	    #define do double
	    #define ff first
	    #define ss second
	    #define FOR(a,n) for(i=0;i<n;i++){    cin>>a[i];}
	    #define pb push_back
	    #define mp make_pair
	    #define inf LONG_LONG_MAX
	    #define mod  1000000007
	    #define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	    

	ll d,x,y;
	void extendedEuclid(ll A, ll B) 
	{
	    if(B == 0) {
	        d = A;
	        x = 1;
	        y = 0;
	    }
	    else {
	        extendedEuclid(B, A%B);
	        int temp = x;
	        x = y;
	        y = temp - (A/B)*y;
	    }
	}

	ll power(ll x,ll y, ll p) 
	{ 
	    ll res = 1; 
	    x = x % p;
	    while (y > 0) 
	    {  // If y is odd, multiply x with result 
	        if (y & 1) 
	            res = (res*x) % p;
	            
	        y = y>>1; 
	        x = (x*x) % p;   
	    } 
	    return res; 
	} 



map<ll,ll> par,val;
void ini()
{
	for(ll i=0;i<500010;i++)
		{
			par[i]=i;
		}
}

ll root(ll x)
{
	while(par[x]!=x)
	{
		par[x]=par[par[x]];
		x=par[x];
	}
	return x;
}

void uni(ll x,ll y)
{
	x=root(x);
	y=root(y);
		par[y]=par[x];
}

int gcdExtended(int a, int b, int *x, int *y) 
{ 

    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
    int x1, y1;
    int gcd = gcdExtended(b%a, a, &x1, &y1); 
    *x = y1 - (b/a) * x1; 
    *y = x1;
    return gcd; 
}  
int modInverse(int b, int m) 
{ 
    int x, y; 
    int g = gcdExtended(b, m, &x, &y); 
    if (g != 1) 
        return -1; 
    return (x%m + m) % m; 
}
ll isPrime(ll n)
{
    if(n==0||n==1)
        return n;
    if(n%2==0)
        return (ll)2;
    if(n%3==0)
        return (ll)3;
    else
    {
        for(ll i=5;i*i<=n;i+=6)
        {
            if(n%i==0)
                return i;
            if(n%(i+2)==0)
                return (i+2);
        }
        return n;
    }
}
const ll N=10000010;
vector<bool> prime(N);
vector<ll> spf(N);
void sieve()
{
	fill(prime.begin(),prime.end(),true);
	prime[1]=false;
	prime[0]=false;
	ll i,j;
	for(i=2;i*i<=N;i++)
	{
		if(prime[i]==true)
		{	spf[i]=i;
			for(j=i*i;j<N;j+=i)
			{
				prime[j]=false;
				if(spf[j]==0)
					spf[j]=i;
			}
		}
	}
}
int main()
{
	FAST;
	ll n,i,j,k,m;
	string s;
	cin>>n;
	ll a[n];
	FOR(a,n);
	ll ans=0;
	for(i=1;i<n-1;i++)
	{
		ll x=max(a[i-1],max(a[i],a[i+1]));
		ll y=min(a[i-1],min(a[i],a[i+1]));
		//cout<<x<<" "<<y<<endl;
		if(a[i]!=x && a[i]!=y)
			ans++;
	}
	cout<<ans;
	
}

Measured memory_bytes: 79616
#include <bits/stdc++.h>
#define repeat(i, n) for (ll(i) = 0; (i) < (n); (i)++)
using namespace std;
typedef long long ll;

int main()
{
	int N;
	cin >> N;
	vector<int> A(1100, 0);
	string result = "APPROVED";

	repeat(i, N) {
		cin >> A[i];
	}

	repeat(i, N) {
		if (A[i] % 2 == 0 && (A[i] % 3 != 0 && A[i] % 5 != 0)) {
			result = "DENIED";
		}
	}

	cout << result << endl;
	return 0;
}


Measured memory_bytes: 256
n = int(input())
s = [int(input()) for _ in range(n)]
dp = [[-1 for _ in range(n*100+1)] for _ in range(n+1)]
dp [0][0] = 0
for i in range(n):
    for j in range(n*100+1):
        if dp[i][j] != -1:
            dp[i+1][j] = dp[i][j]
            dp[i+1][j+s[i]] = dp[i][j] + s[i]
res = 0
for i in range(n*100+1)[::-1]:
    if dp[n][i] > res and i % 10 != 0:
        res = dp[n][i]
        break
print(res)


Measured memory_bytes: 11508
#pragma GCC optimize("O3")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define IOS ios::sync_with_stdio(false); cin.tie(0)
#define ll long long
#define ld long double
#define rep(i,a,n) for (int i=(int)(a);i<(int)(n);i++)
#define per(i,a,n) for (int i=(int)(n-1);i>=(int)(a);i--)
#define mp(a, b) make_pair(a, b)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pil pair<int, ll>
#define pli pair<ll, int>
#define fi first
#define se second


const int MOD = 1e9+7; // 998244353; // = (119<<23)+1
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = 4*atan((ld)1);
const int xd[4] = {1,0,-1,0}, yd[4] = {0,1,0,-1};


template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


int main() {
    ll x;
    cin >> x;
    for (ll a = -1000; a <= 1000; ++a) {
        for (ll b = -1000; b <= 1000; ++b) {
            if (a * a * a * a * a - b * b * b * b * b == x) {
                cout << a << ' ' << b << '\n';
                return 0;
            }
        }
    }
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define int long long
#define P pair<long,long>
#define all(a) a.begin(),a.end()
using namespace std;

vector<P> cnt(vector<int> vec){
    sort(all(vec));
    vec.push_back(-1);
    vector<P> ans;
    int count=0;
    rep(i,vec.size()-1){
        count++;
        if(vec.at(i)!=vec.at(i+1)){
            ans.push_back(P(count,vec.at(i)));
            count=0;
        }
    }
    return ans;
}
signed main(){
    int n; cin>>n;
    vector<int> a(n);
    rep(i,n) cin>>a.at(i);
    vector<P> p=cnt(a);
    int ans=1;
    int mod=pow(10, 9)+7;
    rep(i,p.size()){
        if(p.at(i).second==0){
            if(p.at(i).first!=1){
                cout<<0<<endl;
                return 0;
            }
        }else{
            if(p.at(i).first!=2){
                cout<<0<<endl;
                return 0;
            }else{
                ans=(ans*2)%mod;
            }
        }
    }
    cout<<ans<<endl;
}

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

using namespace std;
typedef long long ll;

int main() {
    ll a, b, c;
    cin >> a >> b >> c;
    ll x = c - a - b;
    cout << ((4 * a * b < x * x && x > 0) ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
# 一度に食べられるリンゴを一つの山だと考える
# 青　青　青
# 赤　赤
# 黄
# だとすると、
# 青赤黄
# 青赤
# 青
# の3つの山があると考えてよい
# この山を想定したときに、各山のXORが0であればsecond、そうでなければfirst

N=int(input())
A=[0] * N
for i in range(N):
  A[i] = int(input())
  
A = sorted(A)
minus = 0
m = []
for i in range(len(A)):
  if (A[i] - minus)%2 == 1:
    m += [N-i]
  minus = A[i] + minus

if len(m) == 0:
  print("second")
else:
  from functools import reduce
  r = reduce(lambda x,y:x^y,m)
  print(("first","second")[r == 0])

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

#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
const long long INF = 1LL << 60;
#define PI 3.14159265359 
bool dp[100100];

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
 

struct mon {
    long long wa=0 ;
    bool ac =false; 

};

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

    vector<mon>tei(N+10);
    
    rep(i,M){
        int p;
        string S;
        cin >> p >> S;

        if(tei[p].ac == false && S == "WA"){
            tei[p].wa +=1;
        }
        else if(S == "AC"){
            tei[p].ac = true;
            }
    }   
    
    long long AC = 0;
    long long WA = 0;
    rep(i,N+10){
        if(tei[i].ac){
            AC +=1;
            WA += tei[i].wa;
        }
    }

    cout << AC << " " << WA << endl;


}



Measured memory_bytes: 1792
N, K = map(int, input().split())
h = [int(input()) for _ in range(N)]
h.sort()
ans = 11**9
for i in range(N - K + 1):
    min_tree = h[i]
    max_tree = h[i + K - 1]
    ans = min(ans, max_tree - min_tree)
print(ans)


Measured memory_bytes: 13168
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>

using namespace std;
typedef long long LL;
typedef pair<int,int> P;

const int L=1e5+10;
vector<int> pos[L];
int lb[L];
bool done[L];
int main() {
	int N,M,Q;
	cin >> N >> M >> Q;
	vector<int> as;
	for(int i=0;i<Q;i++){
		int a;
		cin >> a;
		pos[a].push_back(Q-1-i);
		as.push_back(a);
	}
	for(int i=1;i<=M;i++){
		reverse(pos[i].begin(),pos[i].end());

	}
	for(int i=0;i<N;i++){
		lb[i]=i;
	}
	reverse(as.begin(),as.end());
	done[0]=true;
	int c=0;

	bool breaked=false;
	for(int i=0;i<Q;i++){
		int a=as[i];
		if(done[a])continue;
		done[a]=true;
		if(!breaked){
			for(int j=0;j<N;j++){
				auto it=lower_bound(pos[a].begin(),pos[a].end(),lb[j]);
				if(it==pos[a].end()){
					breaked=true;
					//cerr << "bbb " << i << ", " << j << ", " << lb[j] << ": " << a << endl;
					break;
				}
				//cerr << lb[j] << ", " << *it << endl;
				lb[j]=*it;
				lb[j+1]=max(lb[j+1],lb[j]+1);
			}
		}
		if(breaked){
			while(c<a){
				if(!done[c]){
					cout << "No" << endl;
					return 0;
				}
				c++;
			}
		}
	}

	cout << "Yes" << endl;


	return 0;
}



Measured memory_bytes: 6648
def solve():
    n = int(input())
    a = tuple(map(int,input().split()))
    front = [0]*(n+10)
    back = [0]*(n+10)
    front[1] = abs(a[0])
    for i in range(1,n):
        front[i+1]=front[i]+abs(a[i]-a[i-1])
    back[n] = abs(a[n-1])
    for i in range(2,n+1):
        back[n-i+1] = back[n-i+2]+abs(a[n-i+1]-a[n-i])
    for i in range(n):
        if i==0:
            print(abs(a[1])+back[2])
        elif i==n-1:
            print(front[n-1]+abs(a[n-2]))
        else:
            print(front[i]+back[i+2]+abs(a[i-1]-a[i+1]))
if __name__ == "__main__":
    solve()

Measured memory_bytes: 16376
import java.util.Scanner;
public class Main{
    public static void trace(int n,int []A){
       for ( int i = 0; i < n; i++ ){
            if ( i > 0 ) System.out.print(" ");
            System.out.print(A[i]);
       }
            System.out.print("\n");
    }

        public static void main(String[] args){
             int n;
             int[] A;
        
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        A = new int[n];
        
        for ( int i = 0; i < n; i++ ) A[i] = sc.nextInt();
        
        trace(n,A);
        
        
         //insertion sort
                
        for ( int i = 1; i < n; i++ ) {
                int key = A[i];
                int j = i - 1;
            while ( j >= 0 && A[j] > key ){
                A[j+1] = A[j];
                j--;
            }
                A[j+1] = key;
            trace(n,A);
         }
        }
}

Measured memory_bytes: 26092
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 1, i##_end_ = (n); i <= i##_end_; ++i)
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;


const double eps = 1e-10;
int sgn(double x) {
    if(fabs(x) < eps) return 0;
    return x < 0 ? -1 : 1;
}
struct Point {
    double x, y;
    Point(double xp=0, double yp=0): x(xp), y(yp) { }
    Point operator + (const Point& rhs) const { return Point(x+rhs.x, y+rhs.y); }
    Point operator - (const Point& rhs) const { return Point(x-rhs.x, y-rhs.y); }
    Point operator * (const double& k) const { return Point(x*k, y*k); }
    Point operator / (const double& k) const { return Point(x/k, y/k); }
    bool operator < (const Point& rhs) const { return x < rhs.x || (x==rhs.x && y<rhs.y); }
    bool operator == (const Point& rhs) const {return sgn(x - rhs.x) == 0 && sgn(y - rhs.y) == 0; }
    Point turn(double rad) { return Point(x*cos(rad)-y*sin(rad), x*sin(rad)+y*cos(rad)); }
    void scan() { scanf("%lf%lf", &x, &y); }
};
typedef Point Vector;

double dot(Vector x, Vector y) { return x.x*y.x + x.y*y.y; }
double length(Vector x) { return sqrt(dot(x, x)); }
double cross(Vector A, Vector B) { return A.x*B.y - A.y*B.x; }


Point LineProjection(Point P, Point A, Point B) {
    Vector v = B - A;
    return A + v * (dot(P-A, v) / dot(v, v));
}
Point LineReflection(Point P, Point A, Point B) {
    Point proj = LineProjection(P, A, B);
    return proj + proj - P;
}

int Clockwise(Point O, Point A, Point B) {
    /* Clockwise: -1
       Counterclockwise: 1
       Otherwise: 0
    */
    return sgn(cross(A - O, B - O));
}
void SegCheck(Point a, Point b, Point p) {
    Vector d = b - a, e = p - a;
    if(sgn(dot(d, e)) == -1) puts("ONLINE_BACK");
    else if(sgn(length(e) - length(d)) == 1) puts("ONLINE_FRONT");
    else puts("ON_SEGMENT");
}

int JudgeParOrth(Point a1, Point a2, Point b1, Point b2) {
    /* 2: parallel
       1: orthogonal
       0: otherwise
    */
    Vector v = a2 - a1, w = b2 - b1;
    if(sgn(cross(v, w)) == 0) return 2;
    if(sgn(dot(v, w)) == 0) return 1;
    return 0;
}

int main() {
    Point a1, a2, b1, b2;
    int q; scanf("%d", &q);
    while(q--) {
        a1.scan(), a2.scan();
        b1.scan(), b2.scan();
        printf("%d\n", JudgeParOrth(a1, a2, b1, b2));
    }
    
    return 0;
}


Measured memory_bytes: 3252
#include <iostream>
using namespace std;
int main(){
	int l,r;
	cin>>l>>r;
	if(r-l>=2019){
		cout<<0;
	}
	else{
		int ans=2018;
		for(int i=l;i<r;i++){
			for(int j=i+1;j<=r;j++){
				ans=min(ans,((i%2019)*(j%2019))%2019);
			}
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int ans = a*b;
		System.out.println(ans);
	}

}


Measured memory_bytes: 35744
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln = '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct UnionFind {
    int N;
    vector<int> node;

    UnionFind(){}
    UnionFind(int N) : N(N), node(N,-1) {}

    void init(int x) {
        node.assign(x,-1);
        N = x;
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (node[x] > node[y]) swap(x,y);
        node[x] += node[y];
        node[y] = x;
        N--;
        return true; 
    }

    bool same(int x, int y) {return root(x) == root(y);}

    int root(int x) {
        if (node[x] < 0) return x;
        return node[x] = root(node[x]);
    }

    int size(int x) {return -node[root(x)];}

    int count() const {return N;}
};

const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using Tu = tuple<int, int, int>;
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int H,W; cin >> H >> W;
    int sx,sy,gx,gy; cin >> sx >> sy >> gx >> gy;
    --sx; --sy; --gx; --gy;
    vector<string> S(H);
    rep(i,H) cin >> S[i];

    vector<vector<int>> dist(H, vector<int>(W,1e9));
    dist[sx][sy] = 0;
    deque<Tu> deq;
    deq.emplace_back(Tu(0,sx,sy));
    while (!deq.empty()) {
        auto[d,x,y] = deq.front(); deq.pop_front();
        if (d > dist[x][y]) continue;
        rep(k,4) {
            int nx = x+dx[k];
            int ny = y+dy[k];
            if (nx < 0 or nx >= H or ny < 0 or ny >= W) continue;
            if (S[nx][ny]=='#') continue;
            if (chmin(dist[nx][ny],d)) {
                deq.emplace_front(dist[nx][ny],nx,ny);
            }
        }
        for (int i = -2; i <= 2; i++) {
            for (int j = -2; j <= 2; j++) {
                int nx = x+i;
                int ny = y+j;
                if (nx < 0 or nx >= H or ny < 0 or ny >= W) continue;
                if (S[nx][ny]=='#') continue;
                if (chmin(dist[nx][ny],d+1)) {
                    deq.emplace_back(dist[nx][ny],nx,ny);
                }
            }
        }
    }

    cout << (dist[gx][gy]==1e9 ? -1 : dist[gx][gy]) << ln;
}

Measured memory_bytes: 8692
#include<cstdio>
#include<cstring>
#include<algorithm>
#define N 100005
using namespace std;
typedef long long ll;
inline int read(){
	int sum = 0, t = 1; char ch = getchar();
	while(ch < '0' || ch > '9'){ if(ch == '-') t = -1; ch = getchar(); }
	while(ch >= '0' && ch <= '9'){ sum = sum * 10 + ch - '0'; ch = getchar(); }
	return sum * t;
}

int n, m;
int a[N];
ll d[N], Ans;

int main(){
	n = read(); m = read();
	for(int i = 1; i <= n; i++)
		a[i] = read();
	for(int i = 1; i < n; i++)
		if(a[i] < a[i + 1]){
			d[a[i] + 2]++; 
			d[a[i + 1] + 1] -= a[i + 1] - a[i];
			d[a[i + 1] + 2] += a[i + 1] - a[i] - 1;
			Ans += a[i + 1] - a[i];
		}
		else {
			d[a[i] + 2]++;
			if(a[i] < m) d[1] += m - a[i], d[2] -= m - a[i] - 1;
			else d[2]++;
			d[a[i + 1] + 1] -= a[i + 1] - a[i] + m;
			d[a[i + 1] + 2] += a[i + 1] - a[i] + m - 1;
			Ans += a[i + 1] - a[i] + m;
		}
	for(int i = 1; i <= m; i++)
		d[i] += d[i - 1];
	for(int i = 1; i <= m; i++)
		d[i] += d[i - 1];
	ll S = 0;
	for(int i = 1; i <= m; i++) S = max(S, d[i]);
	printf("%lld\n", Ans - S);
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}
int main() {
  int N;
  cin>>N;
  vector<int>a(N);
  map<int,int>k;
  for(int i=0;i<N;i++){
    cin>>a[i];
    k[a[i]]++;
  }
  bool ans=false;
  if(k.size()==1&&k[0]==N){ans=true;}
  else if(k.size()==2&&N%3==0&&k[0]==N/3){ans=true;}
  else if(k.size()==3&&N%3==0) {
    bool ok=true;
    int start=0;
    for(auto p:k){
      start^=p.first;
      if(p.second!=N/3){ok=false;}
    }
    if(start==0&&ok){ans=true;}
    }
  if(ans){cout<<"Yes"<<endl;}
  else{cout<<"No"<<endl;}
 return 0;
}

Measured memory_bytes: 7080