akhauriyash/Code-Regression huggingface dataset:
package main

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

var sc = bufio.NewScanner(os.Stdin)

func oneInt() int {
	var a int
	fmt.Scan(&a)
	return a
}
func oneStr() string {
	var a string
	fmt.Scan(&a)
	return a
}

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

func scanNums() (nums []int) {
	s := nextLine()
	numStr := strings.Split(s, " ")

	for _, n := range numStr {
		i, _ := strconv.Atoi(n)
		nums = append(nums, i)
	}
	return nums
}

func scanStrings() (strs []string) {
	s := nextLine()
	list := strings.Split(s, " ")
	strs = append(strs, list...)
	return strs
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func sortAsc(a []int) []int {
	sort.Ints(a)
	return a
}

func sortDesc(a []int) []int {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
	return a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	if a == 0 && b == 0 {
		return 0
	}
	return a * b / gcd(a, b)
}


func main() {
	P := oneInt()
	Q := oneInt()
	R := oneInt()

	m := min(P, Q, R)
	var m2 int
	if m == P {
		m2 = min(Q, R)
	} else if m == Q {
		m2 = min(P, R)
	} else {
		m2 = min(P, Q)
	}

	fmt.Print(m + m2)
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define F(i,s,e) for(int i=s;i<e;++i)

int main()
{
    int n,m;
    cin >> n >> m;
    if(n==m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

typedef long long   ll;
const ll mod = 1e9 + 7;

#define speedup_IO      ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,a,n)     for(ll i = a; i < n; i++)
#define ford(i,n,a)     for(ll i = n-1; i >= a; i--)
#define pb              push_back
#define lb              lower_bound
#define ub              upper_bound
#define pll             pair<ll,ll>
#define all(a)          (a).begin(),(a).end()
#define reset(a,x)      memset(a,x,sizeof(a))

ll mypow(ll base, ll exp) {ll res = 1; while (exp) {if (exp & 1) res = (res * base) % mod; exp >>= 1, base = (base * base) % mod;} return res;}
ll gcd(ll a, ll b)  { return b ? gcd(b, a % b) : a;            }
ll mult(ll a, ll b) { return ((a % mod) * (b % mod)) % mod;    }
ll add(ll a, ll b)  { return (a % mod + b % mod) % mod;        }
ll sub(ll a, ll b)  { return (a % mod + mod - b % mod) % mod;  }

const ll inf = 1e18;
const int nax = 1e5 + 5;

int main()
{
	speedup_IO;
	string s,t;
	cin>>s>>t;

	t+=s;
	cout<<t;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define INF 1000000000
#define mod 1000000007
#define vi vector <int>
#define vll vector<long long>
#define ii pair<int,int>
#define vii vector<pair<int,int>>
#define ll long long 
#define ld long double
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define sz(a) (int)a.size()

long long binpow(long long a, long long b, long long m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
/*struct item{
    int m,c;
};					// change item according to the question;
struct segtree{
	int size;
	vector<item>values;
	void intit(int n){
		size=1;
		while(size<n)size*=2;
		values.resize(2*size);
	}
    item merge(item a,item b){
        if(a.m<b.m)return a;
        if(b.m<a.m)return b;
        if(a.m==b.m)return {a.m,a.c+b.c}; 
    }
    item single(int v){
        return {v,1};
    }
    item NEUTRAL_ELEMENT={INF,1};
    void build(vi &a,int x,int lx,int rx){
        if(rx-lx==1){
            if(lx<sz(a)){
                values[x]=single(a[lx]);
            }
            return;
        }
        int m=(lx+rx)/2;
        build(a,2*x+1,lx,m);
        build(a,2*x+2,m,rx);
        values[x]=merge(values[2*x+1],values[2*x+2]);
    }
    void build(vi &a){
        build(a,0,0,size);
    }
    void set(int i,int v,int x,int lx,int rx){
        if(rx-lx==1){
            values[x]=single(v);
            return;
        }
        int m=(lx+rx)/2;
        if(i<m){
            set(i,v,2*x+1,lx,m);
        }else{
            set(i,v,2*x+2,m,rx);
        }
        values[x]=merge(values[2*x+1],values[2*x+2]);
    }
    void set(int i,int v){
        set(i,v,0,0,size);
    }
    item calc(int l,int r,int x,int lx,int rx){
        if(lx>=r||rx<=l)return NEUTRAL_ELEMENT;
        if(l<=lx && rx<=r)return values[x];
        int m=(lx+rx)/2;
        item s1=calc(l,r,2*x+1,lx,m);
        item s2=calc(l,r,2*x+2,m,rx);
        return merge(s1,s2);
    }
    item calc(int l,int r){
        return calc(l,r,0,0,size);
    }
};*/
int main(){
	int n;
    cin>>n;
    string s;
    cin>>s;
    vi idxr,idxw;
    for(int i=0;i<n;i++){
        if(s[i]=='R')idxr.pb(i);
        else idxw.pb(i);
    }
    if(sz(idxr)==0||sz(idxw)==0){
        cout<<0;
        return 0;
    }
    int cnt=0,pos=sz(idxr)-1;
    while(idxr[pos]>idxw[sz(idxr)-pos-1] && pos>=0){
        cnt++,pos--;
    }
    cout<<cnt;
}


Measured memory_bytes: 4676
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = input()
for i in range(2):
    if len(set(list(n[i:3+i]))) == 1:
        print('Yes')
        exit()
print('No')


Measured memory_bytes: 10324
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <cstdio>
#include <float.h>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <stack>
#include <functional>
       
using namespace std;
       
#define endl '\n'
#define MOD 1000000007
#define INF 1ll<<30
 
// #define MAX 100010
 
#define eps 1e-11
#define bit_max 1ll<<32
#define _USE_MATH_DEFINES
 
// long long binpow(long long a,long long b)
// {
//     if (b == 1) return a;
//     long long res = binpow(a, b/2)%MOD;
//     if (b % 2) return (res*((res*a)%MOD))%MOD;
//     else return (res * res)%MOD;
// }
 
// long long int fact(long long int a)
// {
//     if(a==0||a==1)
//         return 1;
//     long long int ans = 1;
//     for(int i=a;i>=1;i--)
//         ans = (ans * i);
//     return ans;
// }
 
// long long int ivmod(long long int a)
// {
//     return binpow(a,MOD-2);
// }
 
// long long int ncr(long long int a,long long int b)
// {
//     long long int pans=1;
//     for(int i =a;i>max(b,a-b);i--)
//         pans=pans*i;
//     long long int div = fact(min(b,a-b));
//     // cout<<ans<<"            "<<div<<endl;
//     pans = pans/div;
//     return pans;
// }


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    // #ifndef ONLINE_JUDGE
        // freopen("input.txt","r",stdin);
        // freopen("output.txt","w",stdout);
    // #endif
    string a ,b;
    cin>>a>>b;
    string c="";
    int x =0,y=0;
    for(int i=0;i<a.length()+b.length();i++)
    {
        if((i+1)%2!=0)
        {
            cout<<a[x];
            x++;
        }
        else
        {
            cout<<b[y];
            y++;
        }
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
//#include "pch.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define FOR(i, s, e) for(int i=s; i<e; i++)
#define REF(i, s, e) for(int i=s; i>e; i--)

static const double Rate = 380000.0;

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

    int n;
    cin >> n;
    
    vector<double> num(n);
    vector<string> coin(n);
    
    double ans = 0.0;
    
    FOR(i,0,n){
        cin >> num[i] >> coin[i];
        
        if (coin[i] == "JPY") ans += num[i];
        else                  ans += num[i] * Rate;
        
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#define REP(i, n) for(LL i = 0;i < n;i++)
#define REPR(i, n) for(LL i = n;i >= 0;i--)
#define FOR(i, m, n) for(LL i = m;i < n;i++)
#define FORR(i, m, n) for(LL i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

/*************** using variables ***************/
string s, t;
/**********************************************/

int main(){
    cin >> s >> t;

    sort(all(s));
    sort(all(t), std::greater<char>());
    REP(i, s.size()){
        if(int(s[i]) < int(t[i])){
            cout << "Yes" << endl;
            return 0;
        }else if(int(s[i]) > int(t[i])){
            cout << "No" << endl;
            return 0;
        }else if(i == s.size() - 1 && s.size() < t.size()){
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define vl vector
#define pb push_back
#define ff first
#define ss second
using namespace std;

vl<ll> divisor(ll n)
{
    vl<ll> v;
    for(int i=1;i<=sqrt(n);i++)
    {
        if(n%i==0) 
        {
            if(n/i==i) v.pb(i);
            else
            {
                v.pb(i);
                v.pb(n/i);
            }
        }
    }
    return v;
}

int main()
{
    ll a,b,i,j,n,m,k,t;
    string s;
    cin>>s;
    for(i=0;i<s.size();i++)
    {
        if(((i+1)%2 && s[i]=='L') || ((i+1)%2==0 && s[i]=='R'))
        {
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}

Measured memory_bytes: 3688
a = int(input())
l = list(map(int,input().split()))

le,ri,le2,ri2 = 0,sum(l),sum(l),0
ans,ans2 = 10**10,10**10
for i in range(len(l)//2):
    le += l[i]
    ri -= l[i]
    le2 -= l[-(i+1)]
    ri2 += l[-(i+1)]
    ans = min(ans,abs(le-ri))
    ans2 = min(ans2, abs(le2-ri2))
    # print(ans,ans2)
else:
    print(min(ans,ans2))

Measured memory_bytes: 24624
#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 FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    ll N,d[50],sum=0;

    cin >> N;
    REP(i,N){
        cin >> d[i];
    }

    REP(i,N){
        REP(j,N-i){
            if(j+i+1<N){
                sum += d[i]*d[j+i+1];
            }
        }
    }
    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
#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;
const int mod = 1000000007;

int main() {
  int N;
  cin>>N;
  map<string,int>s;
  map<string,int>t;
  vector<string>S(N);
  for(int i=0;i<N;i++){
    cin>>S[i];
    s[S[i]]++;
  }
  int M;
  cin>>M;
  for(int i=0;i<M;i++){
    string T;
    cin>>T;
    t[T]++;
  }
  int MAX=0;
  for(int i=0;i<N;i++){
    chmax(MAX,s[S[i]]-t[S[i]]);
  }
  cout<<MAX<<endl;
  return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
//#include "toollib.h"
#pragma warning (disable:4018)
using namespace std;

int main() {
	int n, q;
	cin >> n >> q;
	vector<vector<int>> groups(n);
	for (int i = 0; i < n; i++) {
		groups[i].push_back(i);
	}
	vector<int> ret;
	for (int i = 0; i < q; i++) {
		int com, x, y;
		cin >> com >> x >> y;
		if (com == 0) {
			int a = -1, b = -1;
			for (int j = 0; j < groups.size(); j++) {
				for (int k = 0; k < groups[j].size(); k++) {
					if (groups[j][k] == x) a = j;
					if (groups[j][k] == y) b = j;
				}
				if (a != -1 && b != -1)break;
			}
			if (a != b) {
				for (int k = 0; k < groups[b].size(); k++) {
					groups[a].push_back(groups[b][k]);
				}
				groups.erase(groups.begin() + b);
			}
		}
		else {
			int mode = 0;
			for (int j = 0; j < groups.size(); j++) {
				for (int k = 0; k < groups[j].size(); k++) {
					if (mode == 0) {
						if (groups[j][k] == x || groups[j][k] == y) mode = 1;
					}
					else if (mode == 1) {
						if (groups[j][k] == x || groups[j][k] == y) mode = 2;
					}
				}
				if (mode == 1 || mode == 2) break;
			}
			if (mode == 1) ret.push_back(0);
			if (mode == 2) ret.push_back(1);
		}
	}
	for (int i = 0; i < ret.size(); i++) cout << ret[i] << endl;
	return 0;
}

Measured memory_bytes: 3776
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
const int INF = 1<<30;
const ll MOD = 1000000007;

const int M = 1000005;

int main(void) {

    int n;
    cin >> n;
    vi a(n);
    rep(i, n) cin >> a[i];
    vi cnt(M);
    sort(a.begin(), a.end());
    for (int x : a) {
        if (cnt[x] != 0) {
            cnt[x] = 2;
            continue;
        }
        for (int i = x; i < M; i += x) cnt[i]++;
    }
    int ans = 0;
    for (int x : a) {
        if (cnt[x] == 1) ans++;
    }
    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 7920
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Mod 1000000007
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main()
{
    fastio;
    
	int size;
	cin >> size;
	string str;
	set<string> s;
	for (int i = 0; i < size; i++) {
		cin >> str;
		s.insert(str);
	}
	
	cout << s.size() << "\n";
	//code
	return 0;
}


Measured memory_bytes: 19248
n = int(input())

nums = []
for i in range(n):
    [d_1,d_2] = input().split()
    d_1 = int(d_1)
    d_2 = int(d_2)
    nums.append([d_1,d_2])

ans = "No"
for i in range(0,n-2):
    count = 0
    for j in range(3):
        if nums[i + j][0] == nums[i + j][1]:
            count += 1
    if count == 3:
        ans = "Yes"
        break

print(ans)


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

#define NIL -1
#define MAX (1 << 24)

struct Node {
	int dis = MAX;
	bool flag = false;
	vector<int> d;
	vector<int> id;
};

void dfs(vector<Node>& u, int id)
{
	u[0].dis = 0;

	while (1)
	{
		bool fin = true;
		int mini = MAX;
		int n;
		for (int i = 0; i < u.size(); i++)
		{
			if (!u[i].flag && u[i].dis < mini) {
				mini = u[i].dis;
				n = i;
				fin = false;
			}
		}

		if (fin) return;
		u[n].flag = true;

		for (int i = 0; i < u[n].id.size(); i++)
		{
			if (u[u[n].id[i]].dis > u[n].d[i] && !u[u[n].id[i]].flag) {
				u[u[n].id[i]].dis = u[n].d[i];
			}
		}
	}
}

int main(void)
{
	int i, N, m, q = 0;
	cin >> N;
	vector<Node> u(N);
	for (i = 0; i < N; i++)
	{
		for (int j = 0; j < N; j++)
		{
			cin >> m;
			if (m == NIL) continue;
			u[i].d.push_back(m);
			u[i].id.push_back(j);
		}
	}

	
	dfs(u, 0);

	for (i = 0; i < N; i++) q += u[i].dis;

	cout << q << endl;

	return 0;
}


Measured memory_bytes: 3220
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = INF+7;
const ll LINF = 1e18;
#define rep(i,N) for(int (i)=0;(i)<(N);++(i))
#define rrep(i,N) for(int (i)=(N-1);(i)>0;--i)
#define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i))
#define put(n) cout<<(n)<<endl;
#define all(v) v.begin(),v.end()
#define MP make_pair
#define pb(n) push_back(n)


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

    int N;
    cin >> N;
    int ans = 0;
    for(int i=0;i<N;++i){
        int p; cin >> p;
        bool prime = true;
        for(int j=2;j*j<=p;++j){
            if(p % j == 0){
                prime = false;
                break;
            }
        }
        if(prime) ++ans;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3116
#include <cstdio>
#include <cstring>
const int MAX_n = 999999;
bool isPrime[MAX_n+1];
int sum[MAX_n+1];
int main()
{
    memset(isPrime,true,sizeof(isPrime));
    for(int i = 2; 2*i <= MAX_n ; ++i)
        if(isPrime[i])
            for(int j = 2*i; j <= MAX_n; j+=i)
                isPrime[j] = false;
    isPrime[0] = isPrime[1] = false;
    
    for(int i = 0; i < MAX_n; ++i)
        sum[i+1] = sum[i] + isPrime[i+1];
    
    int n;
    while(scanf("%d",&n) != EOF)
    {
        int ans = sum[n];
        printf("%d\n",ans);
    }
    
}

Measured memory_bytes: 5912
#include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

int n, m;
std::string s, P;
int ans;

int main()
{
	while (true)
	{
		n = m = 0;
		s.clear(); P.clear();
		ans = 0;

		in >> n >> m >> s;
		if (n == 0) { break; }

		rep(i, n * 2 + 1) { P += (i % 2 == 0 ? "I" : "O"); }
		rep(i, m - n * 2)
		{
			const auto temp = s.substr(i, n * 2 + 1);
			if (temp == P) { ++ans; }
		}

		out << ans << std::endl;
	}
	return 0;
}

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

int main(){
  int N,M;
  cin>>N>>M;
  vector<int> k(M),p(M);
  vector<vector<int>> s(M,vector<int>(N));
  for(int i=0;i<M;i++){
    cin>>k.at(i);
    for(int j=0;j<k.at(i);j++){
      cin>>s.at(i).at(j);
    }
  }
  for(int i=0;i<M;i++){
    cin>>p.at(i);
  }
  int ans=0;
  for(int i=0;i<pow(2,N);i++){
    int a=0,b=i;
    vector<int> l(N);
    for(int j=0;j<N;j++){
      l.at(j)=b%2;
      b=b/2;
    }
    for(int j=0;j<M;j++){
      int sum=0;
      for(int m=0;m<k.at(j);m++){
        sum+=l.at(s.at(j).at(m)-1);
      }
      if(sum%2!=p.at(j)){
        a=1;
        break;
      }
      if(a==1)break;
    }
    if(a==0){
      ans++;
    }
  }
  cout<<ans<<endl; 
    
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	char s[10];
	char ans[10];
	int i, j;
	j = 0;


	scanf("%s", s);

	for(i=0; i<10; i++){
		if(s[i] == '0' || s[i] == '1' ){
			ans[j] = s[i];
			ans[j+1] = '\0';
			j++;
		}else if(s[i] == 'B'){
			if(j!=0){
				ans[--j] = '\0';
			}
		}
	}

	printf("%s\n", ans);

	return 0;
}


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

int main()
{
	int n,m;
	cin>>n>>m;
	int sum = 0;
	for(int i = 0 ; i < m ; i ++)
	{
		int temp;
		cin>>temp;
		sum += temp;
		if(sum > n)
		{
			break;
		}
	}
	int ans = 0;
	if(sum > n)
		ans = -1;
	else ans = n - sum;
	cout<<ans;
	return 0;
}


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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    vector<int> data(3);
    for (int i = 0; i < 3; i++) {
        cin >> data[i];
    }
    sort(all(data));
    if (data[0] == data[2]) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

typedef long long ll;
typedef vector<int> vi;

const double PI=acos(-1.0);

int A,B;
void input()
{
    cin>>A>>B;
}

void solve()
{
    int ans=B*10;
    for(int i=0;i<10;++i){
        int tmp=(ans+i)*0.08;
        if(tmp==A){
            cout<<ans+i<<endl;
            return;
        }
    }
    cout<<-1<<endl;
}

int main()
{
    cin.tie();
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 3644
#include<iostream>

using namespace std;

int main()
{
int x[10000];

    for(int i=0;;i++){
        cin>>x[i];
        if(x[i]==0) break;
    }
    for(int i=0;;i++){
        if(x[i]==0) break;
        cout<<"Case "<<i+1<<": "<<x[i]<<'\n';

    }
}


Measured memory_bytes: 3100
#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
  int n,c=0;cin>>n;
  for(int i=1;i<=n;i++){
    if(i<10||i>99&&i<1000||i>9999&&i<100000)c++;
  }
  cout<<c;
}

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

int main(void){
    int K, N; cin >> K >> N;
    int A[N+1], maxdist=0;
    A[0] = 0;
    for(int i=1; i<=N; i++){
        cin >> A[i];
        maxdist = max(A[i] - A[i-1], maxdist);
        //if(A[i]- A[i-1] > maxdist)maxdist = A[i] - A[i-1];
    }
    maxdist = max(maxdist, K-A[N]+A[1]);
    //if(K-A[N] + A[1] > maxdist) maxdist = 
    cout << K - maxdist << endl;
    return 0;
}

Measured memory_bytes: 1024
class dice:
    directions = ['S', 'E', 'N', 'W']
    def __init__(self, strlabels):
        label = strlabels.split()
        self.top = label[0]
        self.side = label[1:5]
        self.side[2], self.side[3] = self.side[3], self.side[2]
        self.down = label[5]
        #print(self.top, self.side, self.down)

    def roll(self, direction):
        tmp = self.top
        self.top = self.side[(self.directions.index(direction)+2)%4]
        self.side[(self.directions.index(direction)+2)%4] = self.down
        self.down = self.side[self.directions.index(direction)]
        self.side[self.directions.index(direction)] = tmp
        #print(self.top, self.side, self.down)

    def pFace(self, initial):
        if initial == 'u':
            print(self.top)
        elif initial == 'd':
            print(self.down)
        else:
            print(self.side[directions.index(direction)])

dice1 = dice(input())
for direction in input():
    dice1.roll(direction)

dice1.pFace('u')

Measured memory_bytes: 5572
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
int main()
{
       ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
       int n;
       cin >> n;
       n=n%1000;
       if (n==0) cout << 0 << endl;
       else
       cout << 1000-n << endl;
	return 0;
}






Measured memory_bytes: 3644
#include<cstdio>
int n,tot;
int f[1005];
int main()
{
	scanf("%d",&n);
	if(!n)
	{
		printf("0");
		return 0;
	}
	int x=n;
	if(x<0)
		x=-x;
	while(x)
	{
		f[++tot]=x%2;
		x/=2;
	}
	if(n>0)
	{
		for(int i=0;i<=tot;i+=2)
			if(f[i])
			{
				int j=i+1;
				while(f[j])
					f[j++]=0;
				f[j]=1;
				if(j==tot+1)
					tot++;
			}
	}
	else
	{
		for(int i=1;i<=tot;i+=2)
			if(f[i])
			{
				int j=i+1;
				while(f[j])
					f[j++]=0;
				f[j]=1;
				if(j==tot+1)
					tot++;
			}
	}
	for(int i=tot;i>=1;i--)
		printf("%d",f[i]);
	return 0;
}

Measured memory_bytes: 128
#include<cstdio>
#include<algorithm>
int main(){
	int n;
	scanf("%d",&n);
	char a[101]={};
	char b[101]={};
	char c[101]={};
	scanf("%s %s %s",a, b, c);
	int ans=0;
	for(int i=0;i<n;i++){
		int p[3]={};
		p[0]=a[i];
		p[1]=b[i];
		p[2]=c[i];
		std::sort(p, p+3);
		if(p[0]==p[2]){
			ans=ans+0;
		}else if(p[0]==p[1] || p[1]==p[2]){
			ans=ans+1;
		}else{
			ans=ans+2;
		}
	}
	printf("%d\n",ans);
	return 0;
}
		

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() {
  cout << "Yes";
}

void no() {
  cout << "No";
}

int main() {
  kyun;
  in6 n,k,q;
  cin >> n>> k >> q;
  vi data(q);
  rep(i,q) cin >> data[i];
  map<int,int> mp;
  rep(i,q) mp[data[i]]++;
  repa(i,1,n+1) {
    if(mp[i] >= q-k+1) {yes(); hinata;}
    else {no(); hinata;}
  }
}

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

int main() {
    ll n;
    cin >> n;
    if (n > 9) {
        n %= 10;
    }
    if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9) {
        cout << "hon" << endl;
    } else if (n == 3) {
        cout << "bon" << endl;
    } else {
        cout << "pon" << endl;
    }
    return 0;
}

Measured memory_bytes: 3608
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int main(void){
	int a,b;
	cin >> a >> b;
	cout << max(a-b*2,0) << endl;
	return 0;
}


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

int main(){
    int k, n, l=0;
    cin >> k >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];

    a.push_back(k+a[0]);
    rep(i,n){
        l = max(l, a[i+1]-a[i]);
    }
    cout << k-l << endl; 
    return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <utility>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;

int main()
{
    string S;
    cin >> S;
    list<char> SList;
    for (int i = 0; i < S.size(); i++)
        SList.push_back(S[i]);

    long long int Q;
    scanf("%lld", &Q);

    bool dir = true;
    for (long long int i = 0; i < Q; i++)
    {
        int t, f;
        char c;
        scanf("%d", &t);
        if (t == 1)
            dir = !dir;
        else if (t == 2)
        {
            scanf("%d", &f);
            scanf("%s", &c);
            if ((f == 1 && dir) || (f == 2 && !dir))
                SList.push_front(c);
            else
                SList.push_back(c);
        }
    }

    if (dir)
        for (auto itr = SList.begin(); itr != SList.end(); itr++)
            printf("%c", *itr);
    else
        for (auto itr = SList.rbegin(); itr != SList.rend(); itr++)
            printf("%c", *itr);
    return 0;
}


Measured memory_bytes: 9984
#include<bits/stdc++.h>
using namespace std;
#define N 1000000000
typedef long long int ll;
ll gcd(ll a,ll b){
if(b==0)return a;
else return gcd(b,a%b);

}
queue<ll> q;
vector<bool> prime(N+1,true);
void make(ll M){
	prime[0]=prime[1]=false;
	ll i;
	for( i=2;i*i<=M+1;i++){
	if(prime[i]){
		ll j=2;
		q.push(i);
	while(i*j<M+1){
	prime[i*j]=false;
	j++;
		}

	}

	}
/*	for(;i<=M;i++){
		if(prime[i])q.push(i);
	}*/
return;

}
int main(){
ll a,b;
//cout<<"ok"<<endl;

cin>>a>>b;
//make(max(a,b));
//cout<<"ok"<<endl;
//cout<<b/gcd(a,b)<<endl;
ll c=b/gcd(a,b);
//cout<<c<<endl;
ll ans = 1;
ll ma = c;
for(ll i=2;i*i<=ma;i++){
	if(c%i==0){
	ans*=i;
	while(c%i==0)c/=i;
	}
}
/*while(!q.empty()){
	ll d = q.front();
//	cout<<d<<endl;
if(c%d==0){
	while(c%d==0)c/=d;
	ans*=d;
}
q.pop();
}*/

//cout<<ans<<' '<<c<<endl;
ans*=c;
cout<<ans<<endl;
return 0;

}





Measured memory_bytes: 124608
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;
 

int main(){
  int N,X,mi=1001;
  cin >> N >> X;
  int m[N+10];
  for(int i=0; i<N; i++){
     cin >> m[i];
     mi=min(mi,m[i]);
     X-=m[i];
  }X=X/mi;
  cout << X+N << endl;
}

Measured memory_bytes: 256
s = input()

count = 0
for i in range(len(s)):
    x = 0
    for j in range(i,len(s)):
        if(s[j] == 'A' or s[j] == 'C' or s[j] == 'G' or s[j] == 'T'):
            x += 1
        else:
            break
    if(count < x):
        count = x

print(count)

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

int main(){
    int N, K;
    cin >> N >> K;
    vector<int> d(K);
    vector<vector<int>> A(K, vector<int>(N));
    for(int i=0; i<K; ++i){
        cin >> d.at(i);
        for(int j=0; j<d.at(i); ++j) cin >> A.at(i).at(j);
    }

    set<int> st;
    for(int i=0; i<K; ++i){
        for(int j=0; j<d.at(i); ++j){
            st.insert(A.at(i).at(j));
        }
    }
    cout << N - st.size() << endl;
}

Measured memory_bytes: 3688
#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

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

bool a(const string& s) {
	int m = 0;
	REP(i, s.size()) {
		if (s[i] == '(')m++;
		else {
			m--;
			if (m < 0)return false;
		}
	}
	return m == 0;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s; cin >> s;
	int n = s.size();
	int cnt = 0;
	REP(i, n)FOR(j, i + 1, n) {
		if (s[i] == '(' && s[j] == ')') {
			bool f = false;
			string tmp;
			FOR(k, i + 1, j) {
				if (s[k] == '*')f = true;
				else tmp += s[k];
			}
			if (f)cnt += a(tmp);
		}
	}
	cout << cnt << endl;
}


Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 30;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };



string s;
map<int, int> b_m;
map<int, int> m;

int main() {
	while ( getline( cin, s ) && s != "" ) {
		int a = 0;
		for ( int i = 0; i < s.size(); i++ ) {
			if ( s[ i ] != ',' ) {
				a *= 10;
				a += s[ i ] - '0';
			}
			else {
				b_m[ a ]++;
			}
		}
	}
	while ( getline( cin, s ) && s != "" ) {
		int a = 0;
		for ( int i = 0; i < s.size(); i++ ) {
			if ( s[ i ] != ',' ) {
				a *= 10;
				a += s[ i ] - '0';
			}
			else {
				m[ a ]++;
			}
		}
	}
	for ( map<int, int>::iterator i = m.begin(); i != m.end(); i++ ) {
		int number = i->first;
		if ( b_m[ number ] ) {
			printf( "%d %d\n", number, m[ number ] + b_m[ number ] );
		}
	}
	return 0;
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
#define senor_SR ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
typedef long long ll;
typedef long double ld;
typedef int32_t i32;
 
#define mp make_pair
#define F first
#define S second
#define pb push_back
#define pf push_front
 
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define RFOR(i,a,b) for(ll i=a;i>=b;i--)
#define FILL(a,b,c) for(ll i=0;i<c;i++) a[i]=b;
 
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
 
#define endl "\n"
#define setpri(x) setprecision(x)
#define vp(x) cout<<#x<<" : "<< (x)<<" | "
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl
#define farr(a,n) for(long long i=0;i<n;i++) cin>>a[i];
#define fvec(vec,n) for(long long i=0;i<n;i++) {ll tmp;cin>>tmp;vec.pb(tmp);}
#define parr(a,n) for(long long i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;
#define prvec(v) for(long long i=v.size()-1;i>=0;i--) cout<<v[i]<<" "; cout<<endl;
#define pvecpair(v) for(long long i=0;i<v.size();i++) cout<<v[i].first<<" "<<v[i].second<<endl;
 
#define INF LONG_LONG_MAX
#define MINF LONG_LONG_MIN
#define MAX_INT 100000
#define MOD 1000000007

const int N=1e6+2;
vector<int> adj[N+1];
ll vis[N+1]={0};
double tot=0,dis=0,leaf=0;
map<pair<int,int>,vector<int>> mv;

int col[N]={0},len;

ll dfs(ll cur)
{
    if(vis[cur]==1) return 0;
    vis[cur]=1;
    ll ans=1;
    for(auto x:adj[cur])
    {
        if(vis[x]==0)
        {
            ans+=dfs(x);                    
        }
    }
    return ans;
}

long long moduloExpo(long long X,long long N,long long M=1000000007)
{
    if(X==0) return 0;
    long long RES=1;
    while(N>0) { if(N%2==1) RES=(RES*X)%M;X=(X*X)%M;N=N/2;}
    return RES;
}

void solve()
{
    ll m;cin>>m;
    ll n;cin>>n;
    ll a[n];
    FOR(i,0,n) cin>>a[i];
    ll mx=0;
    sort(a,a+n);
    FOR(i,0,n-1)
    {
        mx=max(mx,a[i+1]-a[i]);
    }
    mx=max(mx,m-a[n-1]+a[0]);
    cout<<m-mx;
    
}
    
int main()
{
    senor_SR;
    
    //ll t;cin>>t;while(t--)
        solve();
 
    return 0;
}

Measured memory_bytes: 28800
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main() {
    int N; cin >> N;
    cout << N * (N+1) / 2 << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;typedef vector<ll> vll;
#define fill(a) memset(a, 0, sizeof (a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int (i)=0;(i)<(int)(a);(i)++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define each(it,s) for(auto it = s.begin(); it != s.end(); ++it)
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define _ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int maxn = 2000100;

int main(){
        _ios;

        int h,n;
        cin>>h>>n;
        int a[n];
        rep(i,n)cin>>a[i];
        rep(i,n){
            h-=a[i];
        }
        if(h<=0)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;



return 0;
}







Measured memory_bytes: 640
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
using P = pair<ll, ll>;

const int INF = 1001001001;

int main(void){
  ll H, W, D;
  cin >> H >> W >> D;
  vector<vector<ll>> a(H, vector<ll>(W));
  map<ll, P> mp;
  REP(i, H) REP(j, W){
    cin >> a[i][j];
    a[i][j]--;
    mp[a[i][j]] = P(i, j);
  }
  ll Q;
  cin >> Q;
  vector<ll> L(Q), R(Q);
  REP(i, Q) cin >> L[i] >> R[i], L[i]--, R[i]--;

  vector<ll> dp(H*W, 0);
  REP(i, H*W-D){
    P p = mp[i];
    P q = mp[i+D];
    dp[i+D] = dp[i]+labs(q.first-p.first)+labs(q.second-p.second);
  }

  REP(i, Q){
    cout << dp[R[i]]-dp[L[i]] << endl;
  }

  return 0;
}

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

using namespace std;

int main(){
    int n;
    while(cin >> n, n != 0){
        vector<pair<int, int> > c, p;

        for(int i=0; i < n; i++){
            int x, y;
            cin >> x >> y;
            c.push_back(make_pair(x, y));
        }
        cin >> n;
        for(int i=0; i < n; i++){
            int x, y;
            cin >> x >> y;
            p.push_back(make_pair(x, y));
        }
        sort(c.begin(), c.end());
        sort(p.begin(), p.end());

        int dx, dy;
        for(int i=0; i < p.size(); i++){
            bool isFind = true;
            dx = p[i].first-c[0].first;
            dy = p[i].second-c[0].second;
            for(int j=1; j < c.size(); j++){
                if(!binary_search( p.begin(), p.end(), make_pair(c[j].first+dx, c[j].second+dy))){ isFind = false; break;}
            }
            if(isFind){ cout << dx << " " << dy << endl;  break;}
        }
    }
}

Measured memory_bytes: 1216
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <vector>

double solve(int k, int n, const std::vector<int>& pips)
{
  std::vector<double> averages(n);
  std::transform(
      pips.begin(),
      pips.end(),
      averages.begin(),
      [](int p) { return (p + 1) / 2.0; });
  double sum = std::accumulate(averages.begin(), averages.begin() + k, 0.0);
  double max = sum;
  for (int i = k; i < n; ++i) {
    sum = sum - averages[i - k] + averages[i];
    max = std::max(max, sum);
  }
  return max;
}

int main()
{
  int k, n;
  std::cin >> n >> k;
  std::vector<int> pips(n);
  for (auto& p : pips) {
    std::cin >> p;
  }

  std::cout << std::setprecision(20) << solve(k, n, pips) << std::endl;
}


Measured memory_bytes: 2560
#include <stdio.h>

int main(void){
 int a, b, c, d;
 double f;
 scanf("%d %d", &a, &b);
 c=a/b;
 d=a%b;
 f=(double)a/(double)b;
 printf("%d %d %f\n", c, d, f);
 return 0;
}


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

/*
Codeforces 766A
Codeforces 766B
ATCODER A
Codeforces 766C
HDU 3001
HDU 3007
*/


/*
Codeforces 766A 题意：
题意好坑，介绍了一堆子串的性质，长的一定不是短的的子串。
思路：
那么如果两个串相同-1
不相同取max(len1,len2)...
Codeforces 766B 题意：
给你n条线段，问能否取三个线段得一个三角形。
两边之和大于第三边。
枚举最大边，看能不能产生比他大的组合。
那其实sort完以后a<b<c只要看a+b是不是>c就好了
Codeforces 766C 题意：


AtCoder Beginner Contest 052 A题意：
输出大的面积？
思路：
max(A*B,C*D);
AtCoder Beginner Contest 052 B题意：
枚举过程，然后。。。太水了。。
AtCoder Beginner Contest 052 C题意：
输出N!的因子个数mod1e9+7;
思路：
算质因子的个数，然后(质因子个数+1)的乘积mod1e+7就是answer.
原理就是一个质因子组合，+1就是意味着这个质因子可以没有，但是都没有就会出问题需要-1，然而1本身就是存在的。
所以得(质因子个数+1)的乘积mod1e+7就是answer？
那么只需要一个，素数筛+质因子数分解？
AtCoder Beginner Contest 052 D题意：
依次给你n个村庄的位置，现在你在第一个村庄，每次能花费A走一单位，或者花费B走到任意位置。
思路：
感觉如果出现dis*A>B那么必跳对吧。。。
就是如果还有dis*A<B的话。。
1大2小3大4小5大6小7大8大9小10
最好就是我跳一个大的地方顺便还能路过小的，满足么？
其实一定满足对吧。
小的在大的前面，小的先走，
大的在小的前面，大的先走。
哦，可能出现先跳过去，然后再走多截花费的少？不可能。


HDU 3001 题意：
每个城市最多只玩一次，起点任意，求花费最少。
思路：
*/

LL x,A,B,y;
int main()
{
    LL temp,ans=0;
    int n;
    scanf("%d%lld%lld",&n,&A,&B);
    scanf("%d",&y);
    for(int i=2;i<=n;i++)
    {
        scanf("%lld",&x);
        temp=(x-y)*A;
        temp=min(B,temp);
        y=x;
        ans+=temp;
    }
    printf("%lld\n",ans);
    return 0;
}





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

using namespace std;

#define int long long
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

typedef pair<int,int> PI;
typedef pair<int,pair<int,int>> PII;
static const int INF=1010000000000000017LL;
static const double eps=1e-12;
static const double pi=3.14159265358979323846;
static const int dx[4]={1,-1,0,0};
static const int dy[4]={0,0,1,-1};
static const int ddx[8]={1,-1,0,0,1,1,-1,-1};
static const int ddy[8]={0,0,1,-1,1,-1,1,-1};

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;}

int N,X,T;

signed main(){
    cin>>N>>X>>T;
    int K=N/X;
    if(N%X!=0)K++;
    cout<<K*T<<endl;
}

Measured memory_bytes: 3624
import copy




N,X=map(int,input().split())
S=input()
lenS=len(S)

RS=S[::-1]

goukei=0
G=[]
G.append(0)
Rgoukei=0
RG=[]
for i in range(1,lenS):
    if S[i]=="C":
        if S[i-1]=="A":
            goukei+=1
    G.append(goukei)


RG.append(0)
for i in range(1,lenS):
    if RS[i]=="A":
        if RS[i-1]=="C":
            Rgoukei+=1
    RG.append(Rgoukei)
RG.reverse()

#print(G)
#print(RG)

for i in range(X):
    A,B=map(int,input().split())
    print(goukei-G[A-1]-RG[B-1])


Measured memory_bytes: 13980
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;

int main(){
  int m=2;
  int count[101];
  for(int i=1;i<=100;i++)
    count[i]=0;

  vector<int> list[101];

  int a,b;
  while(cin >> a >> b){
    if(a>0 && b>0){
      count[a]++; count[b]++;
      m=max(m,max(a,b));

      list[a].push_back(b);
      list[b].push_back(a);
    }else{
      bool f[101];
      for(int i=1;i<=m;i++) f[i]=false;

      stack<int> cur;
      cur.push(1);
      f[1]=true;
      while(!cur.empty()){
        bool flg=false;
        for(vector<int>::iterator it=list[cur.top()].begin();it!=list[cur.top()].end();it++){
          if(!f[*it]){
            f[*it]=true;
            cur.push(*it);
            flg=true;
            break;
          }
        }
        if(flg) continue;
        cur.pop();
      }

      bool flg=true;
      for(int i=1;i<=m;i++) flg=(flg && f[i]);

      flg=(flg && (count[1]%2==1) && (count[2]%2==1));
      for(int i=3;i<=m;i++) flg=(flg && (count[i]%2==0));

      if(flg) cout << "OK" << endl;
      else cout << "NG" << endl;

      for(int i=1;i<=100;i++){
        count[i]=0;
        list[i].clear();
      }
      m=2;
    }
  }

  return 0;  
}

Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e2+7;
int a[MAXN], b[MAXN];
int main()
{
    int n; cin >> n;
    memset(a, 0x3f, sizeof(a));
    for(int i = 1; i < n; i++) cin >> b[i], a[i] = min(a[i], b[i]), a[i+1] = min(a[i+1], b[i]);
    int sum = 0;
    for(int i = 1; i <= n; i++) sum += a[i];
    printf("%d\n", sum);
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
	public static void main(String[] args){
		int h, m, s;
		
		Scanner c = new Scanner(System.in);
		int b = c.nextInt();
		
		h = b / 3600;
		m = (b % 3600) / 60;
		s = (b % 3600) % 60;
		
		System.out.println(h +":"+ m +":"+ s);
	}
}

Measured memory_bytes: 17320
using System;

class Solution
{
  public static void Main(string[] args)
  {
    var input = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
    int n = input[0], a = input[1], b = input[2];
    var ans = 0;
    for (var i = 1; i <= n; i++)
    {
      var sum = 0;
      var num = i;
      while (num > 0)
      {
        sum += num % 10;
        num /= 10;
      }
      if (sum >= a && sum <= b) ans += i;
    }
    Console.WriteLine($"{ans}");
  }
}


Measured memory_bytes: 13140
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
using LL = long long;

int main() {
	int N; cin >> N;
	vector<LL> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];
	sort(A.rbegin(), A.rend());
	bool flag = true;
	LL l1 = 0, l2 = 0;
	for (int i = 0; i < N - 1; i++) {
		if (A[i] == A[i + 1]) {
			if (flag) {
				l1 = A[i];
				i++;
				flag = false;
			}
			else {
				l2 = A[i];
			}
		}
		if (l1*l2 != 0)break;
	}
	cout << l1 * l2 << endl;
}

Measured memory_bytes: 1024