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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    set<int> se;
    se.insert(A);
    se.insert(B);
    se.insert(C);

    if (se.size() == 2) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

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

	int l = 0, m = 0;
	for(auto &x: s) {
		if(x == 'A' || x == 'T' || x == 'G' || x == 'C') {
			l++;
			m = max(l, m);
		} else {
			l = 0;
		}
	}

	cout << m << endl;
}


Measured memory_bytes: 760
#include<stdio.h>  
#include<string.h>  
#include<math.h>  
#include<algorithm>
using namespace std;
 
int nx[4][2]={{-1,0},{0,-1},{0,1},{1,0}};
 

int goal[16][2]= {{3,3},{0,0},{0,1},{0,2},//0 1 2 3
				  {0,3},{1,0},{1,1},{1,2},//4 5 6 7
				  {1,3},{2,0},{2,1},{2,2},//8 9 10 11
				  {2,3},{3,0},{3,1},{3,2}};//12 13 14 15
				  
int map[4][4],map2[16],limit;
int flag,length;				  
      
int hv(int a[][4])
{
    int cost=0;
    for(int i=0;i<4;i++)
    {
        for(int j=0;j<4;j++)  
        {
            int w=map[i][j];
            if(w!=0) cost+=abs(i-goal[w][0])+abs(j-goal[w][1]);
        }
    }
    return cost;
}
 
void dfs(int x,int y,int len,int pre_move)
{
    if(flag) return;
    int dv=hv(map);
    if(len==limit)
    {
        if(dv==0) 
        {
            flag=1;
            length=len;
            return;
        }
        else return; 
    }
 
    for(int i=0;i<4;i++)  
    {
        if(i+pre_move==3&&len>0) continue;
        int tx=x+nx[i][0];
        int ty=y+nx[i][1];
        if(tx>=0&&tx<4&&ty>=0&&ty<4)
        {
            swap(map[x][y],map[tx][ty]);
            int p=hv(map);
            if(p+len<=limit&&flag==0)
            {
                dfs(tx,ty,len+1,i);
                if(flag) return;
            }
            swap(map[x][y],map[tx][ty]);
        }
    }
}
 
int main()  
{
    int t=1;
    while(t--)       
    {
		int x1,y1;
        for(int i=0;i<16;i++)
        {
            scanf("%d",&map2[i]);
            if(map2[i]==0)
            {
                x1=i/4;
				y1=i%4;
				map[x1][y1]=0;
            }
            else
            {
                map[i/4][i%4]=map2[i];
            }
        }                                      
 
        limit=hv(map);
        //printf("limit===%d\n",limit);
        flag=0;
        length=0;
        while(flag==0&&length<=45)
        {
            dfs(x1,y1,0,0);
            if(flag==0) limit++; 
        }
        if(flag) printf("%d\n",length);
    }
    return 0;
}



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

vector<int> dfs(int left, int len, int s, int t) {
        int sc = __builtin_popcount(s);
        int tc = __builtin_popcount(t);
        assert(sc % 2 != tc % 2);
        if (len == 2) {
                return vector<int>{ s, t };
        }
        int m = left + len / 2;
        bool swapped = false;
        if (s > t) {
                swap(s, t);
                swapped = true;
        }
        if (s < m && m <= t) {
                int u = left;
                while (__builtin_popcount(u) % 2 == __builtin_popcount(s) % 2) {
                        u ++;
                }
                assert(u < m);
                int uu = u + len / 2;
                auto l = dfs(left, len / 2, s, u);
                auto r = dfs(m, len / 2, uu, t);
                for (auto it : r) {
                        l.push_back(it);
                }
                assert(l.size() == len);
                if (swapped) {
                        reverse(l.begin(), l.end());
                }
                return l;
        } else { 
                vector<int> res;
                if (s < m && t < m) {
                        auto l = dfs(left, len / 2, s, t);
                        int u = l[1];
                        int uu = u + len / 2;
                        int ss = s + len / 2;
                        auto r = dfs(m, len / 2, ss, uu);
                        res.push_back(s);
                        for (auto it : r) {
                                res.push_back(it);
                        }
                        for (int i = 1; i < l.size(); i ++) {
                                res.push_back(l[i]);
                        }
                } else {
                        auto r = dfs(m, len / 2, s, t);
                        int u = r[1];
                        int uu = u - len / 2;
                        int ss = s - len / 2;
                        auto l = dfs(left, len / 2, ss, uu);
                        res.push_back(s);
                        for (auto it : l) {
                                res.push_back(it);
                        }
                        for (int i = 1; i < r.size(); i ++) {
                                res.push_back(r[i]);
                        }
                }
                assert(res.size() == len);
                if (swapped) {
                        reverse(res.begin(), res.end());
                }
                return res;
        }
}

int main() {
        int n, a, b;
        scanf("%d%d%d", &n, &a, &b);
        int ac = __builtin_popcount(a);
        int bc = __builtin_popcount(b);
        if (ac % 2 == bc % 2) {
                puts("NO");
                return 0;
        }
        puts("YES");
        auto ans = dfs(0, (1 << n), a, b);
        assert(ans.size() == (1 << n));
        rep(i, ans.size()) {
                printf("%d ", ans[i]);
        }
        printf("\n");
        return 0;
}


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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

fn main() {
    input! {
        mut a: [i64; 5],
        k: i64,
    }

    // std::thread::sleep_ms(3000);

    a.sort();

    let ans = if a[4] - a[0] > k { ":(" } else { "Yay!" };
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <vector>
#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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  //  freopen("input.txt","r",stdin);
  //  freopen("output.txt","w",stdout);
    
    int x,y,z,k;
    cin>>x>>y>>z>>k;

    long long int a[x],b[y],c[z];
    for(int i=0;i<x;i++)
        cin>>a[i];
    for(int i=0;i<y;i++)
        cin>>b[i];
    for(int i=0;i<z;i++)
        cin>>c[i];
    sort(a,a+x,greater<long long >());
    sort(b,b+y,greater<long long >());
    sort(c,c+z,greater<long long >());
    std::vector<long long int > ans;
    for(int i=0;i<x;i++)
    {
        for(int j=0;j<y;j++)
        {
            for(int l=0;l<z;l++)
            {
                if((i+1)*(j+1)*(l+1)<=k)
                    ans.push_back(a[i]+b[j]+c[l]);
            }
        }
    }
    sort(ans.begin(),ans.end());
    for(int i=ans.size()-1;i>=0;i--)
    {
        cout<<ans[i]<<endl;
        k--;
        if(k==0)
            break;
    }
    return 0;
}

Measured memory_bytes: 1400
import java.util.Scanner;

class Main
{
	public static void main(String[] args)
	{
	Scanner sc1 = new Scanner(System.in);//入力
	int a = sc1.nextInt();
	int b = sc1.nextInt();
	int d = a / b;
	int r = a % b;
	double f = (double)a / b;//(double)がないとintで出る
	System.out.println(d+" "+r+" "+String.format("%.5f", f));//表示形式
	}
}



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

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;

int main(void) {
  char num[1005];
  int result;
  while(1) {
    scanf("%s", num);
    if(num[0] == '0') break;

    result = 0;
    rep(i, strlen(num)) result += num[i] - '0';
    cout << result << endl;
  }
}



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

//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end



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

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    map<long long ,long long>m;

    long long n,x,a=0;
    cin>>n;

    vector<long long> v;

    for(int i=0; i<n; i++){
        cin>>x;
        m[x]++;
    }

    for(auto it: m){

        if(it.second>=2)
            v.push_back(it.first);
        if(it.second>=4)
            a = max(a,it.first);
    }
    v.push_back(0); v.push_back(0);
    sort(v.begin(),v.end(),greater<int>());

    cout<<max(v[0]*v[1],a*a)<<endl;

}


Measured memory_bytes: 9844
#include <stdio.h>
#include <algorithm>
int n;
long long a[100000], b[100000], c[100000];
long long ans;
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld%lld", a + i, b + i);
		c[i] = (a[i] + b[i]) * 100000 + i;
	}
	std::sort(c, c + n);
	for (int i = 0; i < n; i++) {
		if ((n - i) % 2)ans += a[(c[i] % 100000)];
		else ans -= b[(c[i] % 100000)];
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 2560
# encoding: utf-8


import sys


class Solution:
    def __init__(self):
        """
        init input array
        """
        self.__input = sys.stdin.readlines()

    @property
    def solution(self):
        product_num = int(self.__input[0].split()[0])
        truck_num = int(self.__input[0].split()[1])
        weight_list = list(map(int, self.__input[1:]))

        # assert product_num == len(weight_list)

        # binary search
        left, right, mid = max(weight_list), sum(weight_list), 0
        while left < right:
            mid = (left + right) // 2
            # check return True : p could be smaller
            if self.check(max_load_cursor=mid, weight_list=weight_list, truck_num=truck_num):
                right = mid
            else:
                mid += 1
                left = mid
        return str(mid)

    @staticmethod
    def check(max_load_cursor, weight_list, truck_num):
        track_count = 1
        current_load = 0
        for item_weight in weight_list:
            current_load += item_weight
            # change to next truck
            if current_load > max_load_cursor:
                current_load = item_weight
                track_count += 1
                if track_count > truck_num:
                    return False
        return True


if __name__ == '__main__':
    case = Solution()
    print(case.solution)

Measured memory_bytes: 18596
/*
*/

#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS

#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds

#define eps 1e-9
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 350

using namespace std;

const int INF = 1e9;
const int N = 220031;

int n, a, b, cnt;

int main(){
	//freopen("fabro.in","r",stdin);
	//freopen("fabro.out","w",stdout);
	//freopen("F:/in.txt", "r", stdin);
	//freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);

	int cnt2 = 0;
	cin >> n >> a >> b;
	string st;
	cin >> st;
	for (int i = 0; i < st.size(); i++)
	{
		if (st[i] == 'c')
		{
			cout << "No" << endl;
		}
		else if (st[i] == 'a')
		{
			if (cnt2 < a + b)
			{
				++cnt2;
				cout << "Yes" << endl;
			}
			else
				cout << "No" << endl;
		}
		else
		{
			if (cnt2 < a + b&&cnt < b)
			{
				++cnt2;
				cout << "Yes" << endl;
			}
			else
				cout << "No" << endl;
			++cnt;
		}
	}
	cin.get(); cin.get();
	return 0;
}

Measured memory_bytes: 848
#include <stdio.h>
int main () {
  int a;
  scanf("%d",&a);
  if (a/100!=7) {
    a=a%100;
    if (a/10!=7) {
      a=a%10;
      if (a!=7) {
        printf("No");
        return 0;
      }
    }
  }
  printf("Yes");
}
      

Measured memory_bytes: 1732
#include<bits/stdc++.h>
using namespace std;
int n,m;
int vis[100][100];
int path[100][100];
char grid[105][105];
int bfs(int i,int j){

    path[i][j]=1;
    queue<pair<int,int> > q;
    q.push(make_pair(i,j));

    while(!q.empty()){

        pair<int,int> curr=q.front();
        q.pop();
        if(curr.first==n && curr.second==m)return path[n][m];
        if(!vis[curr.first][curr.second]){
            vis[curr.first][curr.second]=1;

            i=curr.first-1;
            j=curr.second;
            if(!(i<1 || j<1 || i>n || j>m || grid[i][j]=='#')){
                q.push(make_pair(i,j));
                path[i][j]=path[curr.first][curr.second]+1;
            }
            i=curr.first+1;
            j=curr.second;
            if(!(i<1 || j<1 || i>n || j>m || grid[i][j]=='#')){
                q.push(make_pair(i,j));
                path[i][j]=path[curr.first][curr.second]+1;
            }
            i=curr.first;
            j=curr.second-1;
            if(!(i<1 || j<1 || i>n || j>m || grid[i][j]=='#')){
                q.push(make_pair(i,j));
                path[i][j]=path[curr.first][curr.second]+1;
            }
            i=curr.first;
            j=curr.second+1;
            if(!(i<1 || j<1 || i>n || j>m || grid[i][j]=='#')){
                q.push(make_pair(i,j));
                path[i][j]=path[curr.first][curr.second]+1;
            }

        }
    }
    return -1;
}
int main()
{

    cin>>n>>m;

    int blocked=0;
    for(int i=1; i<=n; i++){
        for(int j=1; j<=m; j++){
            scanf(" %c",&grid[i][j]);
            if(grid[i][j]=='#')blocked++;
        }
    }

    int len = bfs(1,1);
    int ans;
    if(len!=-1)ans=((n*m)-blocked-len);
    else ans=-1;

    cout<<ans<<endl;
    return 0;

}


Measured memory_bytes: 256
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

input_n = lambda: int(readline())
input_nn = lambda: map(int, readline().split())
input_s = lambda: readline().rstrip().decode('utf-8')
input_ss = lambda: readline().rstrip().decode('utf-8').split()


def main():
    H, W = input_nn()
    h, w = input_nn()
    ans = H * W - (H * w + W * h - h * w)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include  <iostream>
#include  <vector>
#include  <cstdlib>

long long solve(void);


int main(void)
{
	long long ans;
	ans = solve();

	std::cout << ans << std::endl;


	return EXIT_SUCCESS;
}

long long solve(void)
{
	int N;
	std::cin >> N;

	std::vector<long long> A(N);
	for(int i = 0; i < N; ++i)
		std::cin >> A[i];

	long long ans = 0;

	for(int i = 1; i < N; ++i) {
		// 前の人よりも身長が高いか同じ
		if(A[i-1] <= A[i])
			continue;

		// 前の人よりも身長が低いので、差分の高さの踏み台を使う
		ans += (long long)(A[i-1] - A[i]);
		A[i] += (A[i-1] - A[i]);
	}

	return ans;
}



Measured memory_bytes: 4692
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e5+2;
int arr[N],dp[N];
int n,k;


int main(int argc, char* argv[]) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    
   	cin>>n>>k;
   	for(int i=0;i<n;i++)
   		cin>>arr[i];

   	dp[0]=0;
   	int mn;
   	
   	for(int i=1;i<n;i++){
   		//dp[i] = min( min (   dp[i-1]+abs(arr[i]-arr[i-1]))     )
   		int mn = INT_MAX;
   		for(int j=1;j<=k;j++){
   			if(i-j>=0){
   				mn = min(mn ,  dp[i-j] + abs(arr[i]-arr[i-j]) );
   			}
   		}
   		dp[i] = mn;
   	}
   	
   	cout<<dp[n-1];

    return 0;
}

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

int main() {
  int n, t;
  cin >> n >> t;
  map<int, int> ct;
  rep(i, n) {
    int c, T;
    cin >> c >> T;
    ct[c] = T;
  }
  int mincost = 10010;
  int ans = -1;
  for(auto it = ct.begin(); it != ct.end(); it++) {
    if(it->second <= t) {
      if(mincost > it->first) {
        mincost = it->first;
        ans = it->first;
      }
    }
  }
  if(ans == -1) cout << "TLE" << endl;
  else cout << ans << endl;
  return 0;
} 

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

int main(){
	int N,M,W,F=0;
	int64_t R=0;
	cin >> N >> M;
	priority_queue<int> A;
	for (int i = 0; i < N; i++){
		cin >> W;
		A.push(W);
	}
	for (int i=0; i < M; i++){
		W = A.top();
		if(W == 0){
			F = 1;
			break;
		}
		W /= 2;
		A.pop();
		A.push(W);
	}
	if (F == 1){
		cout << 0 << endl;
	}
	
	else{
		for (int i=0; i < N; i++){
			R += A.top();
			A.pop();
		}
		cout << R << endl;
	}
}
	
	


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

//#define int long long
typedef long long ll;
//const int INF = 2e9;
//const ll INF = 9e18;

int N;

void dfs(string s, char mx){
    if (s.size() == N){
        cout << s << "\n";
    } else {
        for (char i='a';i<=mx;i++){
            dfs(s + i, (i==mx)?(mx+1):mx);
        }
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> N;
    dfs("", 'a');
}

Measured memory_bytes: 3580
def main():
	n = int(input())
	k = n//50
	rem = n%50
	arr = [0 for i in range(50)]
	for i in range(0 , 50):
		arr[i]=i
	for i in range(0 , 50):
		arr[i]=arr[i]+k
	while rem>0:
		for i in range(0 , 50):
			if arr[i]==k:
				arr[i]=arr[i]+50 # after k operation this element becomes 0 next operation it becomes 
			else:				# negative so we just need to add 50 so that it become 49 still smaller than 50
				arr[i]=arr[i]-1
		rem=rem-1
	print(50)
	print(*arr)
if __name__ == "__main__":
	main()	

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

bool f;
int ac;

int calc(int now, char c) {
	if (c=='A') {
		if (ac==0&&now<=10) { now+=11; f=true; }
		else now+=1;
	} else if (c=='T'||c=='J'||c=='Q'||c=='K') {
		now += 10;
	} else {
		now += (int)c - '0';
	}

	if (now>21&&f) { f=false; now-=10; }
	return now;
}

int main() {
	char init[2];
	int N;
	cin >> N;
	while (N--) {
		cin >> init[0] >> init[1];
		f = false;
		ac = 0;
		char top[8];
		for (int i=0; i<8; i++)
			cin >> top[i];

		int scr = 0;
		scr = calc(scr, init[0]);
		scr = calc(scr, init[1]);

		for (int i=0; i<8; i++) {
			if (i==0&&scr==21) {
				cout << "blackjack\n";
				break;
			} else if (scr<=21&&(scr>17||(!f)&&scr==17)) {
				cout << scr << endl;
				break;
			} else if (scr > 21) {
				cout << "bust\n";
				break;
			}
			scr = calc(scr, top[i]);
			if (i==7) cout << scr << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
using namespace std;
long long mods[100010];
long long a[100010];

int main() {
	int n;
	cin >> n;
	long long all = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		all += a[i];
	}
	long long ans = 1e9 + 7;
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		if (all % a[i] == 0) {
			cout << a[i] << endl;
			return 0;
		}
	}
	long long num0, num1;
	for (int i = 0; i < n - 1; i++) {
		num1 = a[i + 1], num0 = a[i];
		while (num0 > 0 && num1 > 0) {
			if (num0 == num1) {
				break;
			}
			else if (num0 > num1) {
				num0 %= num1;
			}
			else {
				num1 %= num0;
			}
		}
		if (num0 != num1) {
			mods[i] = max(num0, num1);
		}
	}
	sort(mods, mods + n - 1);
	for (int i = 0; i < n - 1; i++) {
		if (mods[i] != 0) {
			cout << mods[i] << endl;
			return 0;
		}
	}
	return 0;
}

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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int MOD = 1000000009;
const long long INF = 1LL << 60;

int main() {
    int N;
    cin >> N;
    int res = 0;
    if (N >= 400 && N <= 599) res = 8;
    else if (N >= 600 && N <= 799) res = 7;
    else if (N >= 800 && N <= 999) res = 6;
    else if (N >= 1000 && N <= 1199) res = 5;
    else if (N >= 1200 && N <= 1399) res = 4;
    else if (N >= 1400 && N <= 1599) res = 3;
    else if (N >= 1600 && N <= 1799) res = 2;
    else if (N >= 1800 && N <= 1999) res = 1;
    cout << res << endl;
    return 0;
}

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

using namespace std;

const int Nmax = 1e5 + 5;

int s[Nmax];
int n;
bool unlocked[Nmax];
vector<int> v[Nmax], w[Nmax];
pair<int, int> edge[Nmax];

class Graph
{
    vector<int> v[Nmax];
    bool used[Nmax];
    int L[Nmax], R[Nmax];

    bool cupleaza(int node)
    {
        if(used[node]) return 0;
        used[node] = 1;

        for(auto it : v[node])
            if(!R[it])
            {
                L[node] = it;
                R[it] = node;
                return 1;
            }

        for(auto it : v[node])
            if(cupleaza(R[it]))
            {
                L[node] = it;
                R[it] = node;
                return 1;
            }
        return 0;
    }

public:
    void add_edge(int x, int y)
    {
        v[x].push_back(y);
    }

    bool cuplaj()
    {
        bool done = 1; int i;
        while(done)
        {
            done = 0;
            for(i=1; i<=n; ++i) used[i] = 0;

            for(i=1; i<=n; ++i)
                if(!L[i]) done |= cupleaza(i);
        }

        for(i=1; i<n; ++i)
        {
            s[i] = R[i];
            if(!s[i]) return 0;
        }
        return 1;
    }

} graph;

void build_sol()
{
    queue<int> q;
    q.push(n);

    int node, nr = n-1;
    while(q.size())
    {
        node = q.front();
        q.pop();

        for(auto it : w[node])
            if(!unlocked[s[it]])
            {
                q.push(s[it]);
                unlocked[s[it]] = 1;
                edge[it] = {node, s[it]};
                --nr;
            }
    }

    if(nr)
    {
        cout << "-1\n";
        return;
    }

    int i;
    for(i=1; i<n; ++i) cout << edge[i].first << ' ' << edge[i].second << '\n';
}

int main()
{
  //  freopen("input", "r", stdin);
    cin.sync_with_stdio(false);

    int i, nr, x;
    cin >> n;
    for(i=1; i<n; ++i)
    {
        cin >> nr;
        while(nr--)
        {
            cin >> x;
            v[i].push_back(x);
            w[x].push_back(i);
            if(x < n) graph.add_edge(x, i);
        }
    }

    if(!graph.cuplaj())
    {
        cout << "-1\n";
        return 0;
    }

    build_sol();

    return 0;
}


Measured memory_bytes: 21888
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
	int x1,y1,x2,y2,x,y,dx,dy;
	cin>>x1>>y1>>x2>>y2; 
	dx=x2-x1;dy=y2-y1;
	x=x2-dy;y=y2+dx;
	cout<<x<<" "<<y<<" ";
	x-=dx;y-=dy;
	cout<<x<<" "<<y<<endl;
	return 0;
} 



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


def main(k, n, a):
    distance = []
    for i in range(n):
        dist = abs(a[i] - a[i - 1])
        if dist >= k / 2:
            dist = k - dist
        distance.append(dist)

    distance.pop(distance.index(max(distance)))

    res = sum(distance)

    return res


print(main(K, N, A))


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

int main(){
  
  int N;
  scanf("%d\n",&N);
  vector<int> A(N);
  for(int i=0; i<N; i++) cin >> A[i];
  
  sort(A.begin(),A.end(),greater<int>());
  
  long long ans=0;
  for(int i=1; i<N; i++){
    ans += A[i/2];
  }
  printf("%lld\n",ans);
  return 0;
  
}
	

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

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define test() int t;cin>>t;for(int test=1;test<=t;test++)
#define pb push_back
#define nl cout<<"\n"
#define all(x) x.begin(),x.end()

template<class C> void min_self( C &a, C b ){ a = min(a,b); }
template<class C> void max_self( C &a, C b ){ a = max(a,b); }

const ll MOD = 1000000007;
ll mod( ll n, ll m=MOD ){ n%=m,n+=m,n%=m;return n; }

const int MAXN = 1e5+5;
const int LOGN = 21;
const ll INF = 1e14;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

template<class T1, class T2> void add( T1 &x, T2 y, ll m = MOD )
{
    x += y;
    if( x >= m )
        x -= m;
}

template<class T1, class T2> void sub( T1 &x, T2 y, ll m = MOD )
{
    x -= y;
    if( x < 0 )
        x += m;
}

int main() 
{
    #ifdef gupta_samarth
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    fastio();

    int n,m;
    cin>>n>>m;
    vector<string>s(n);
    mf_graph<int> gr(n*m+3);

    auto get = [&]( int i, int j )
    {
        return i*m + j;
    };
    auto getx = [&]( int AA )
    {
        return AA/m;
    };
    auto gety = [&]( int AA )
    {
        return AA%m;
    };
    auto good = [&]( int i, int j ) -> bool
    {
        if( i < 0 || i >= n || j < 0 || j >= m || s[i][j] == '#' )
            return 0;
        return true;
    };

    int src = n*m, sink = n*m+1;
    for(int i=0;i<n;i++)
    {
        cin>>s[i];
        for(int j=0;j<m;j++)
        {
            if( s[i][j] == '#' )
                continue;
            if( (i+j)%2 == 0 )
                gr.add_edge(src,get(i,j),1);
            else
                gr.add_edge(get(i,j),sink,1);
        }
    }

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            if( s[i][j] == '#' || (i+j)%2 )
                continue;
            for(int dir=0;dir<4;dir++)
            {
                int ni = i + dx[dir];
                int nj = j + dy[dir];
                if( good(ni,nj) )
                    gr.add_edge(get(i,j), get(ni,nj), 1);
            }
        }
    }

    cout<<gr.flow(src,sink),nl;
    auto edges = gr.edges();
    for( auto e : edges )
    {
        if( e.from == src || e.to == sink || e.flow == 0 )
            continue;

        int A = e.from, B = e.to;
        int i = getx(A), j = gety(A);
        int ni = getx(B), nj = gety(B);

        if( ni == i+1 )
        {
            s[i][j] = 'v';
            s[i+1][j] = '^';
        }
        else if( ni == i-1 )
        {
            s[i][j] = '^';
            s[i-1][j] = 'v';
        }
        if( nj == j+1 )
        {
            s[i][j] = '>';
            s[i][j+1] = '<';
        }
        if( nj == j-1 )
        {
            s[i][j] = '<';
            s[i][j-1] = '>';
        }
    }

    for(int i=0;i<n;i++)
        cout<<s[i],nl;
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


Measured memory_bytes: 5456
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(int argc, char const *argv[])
{
	vector<int> v;
	int n,x;
	int res = 0;

	cin >> n >> x;

	for (int i = 0; i < n; ++i)
	{
		int tmp;
		cin >> tmp;
		v.push_back(tmp);
	}

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

	for (int i = 0; i < n; ++i)
	{
		++res;
		x -= v[i];
	}

	while(x >= v[0])
	{
		++res;
		x -= v[0];
	}

	cout << res << "\n";

	return 0;
}

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

int main() {
  int n, x, y; cin >> n >> x >> y;
  x--; y--;
  int INF = 1001001001;
  vector<int> ans(n);
  
  rep(sv, n) {
    vector<int>dist(n, INF);
    queue<int> q;
    auto push = [&](int v, int d) {
      if (dist[v] != INF) return;
      q.push(v);
      dist[v] = d;
    };
    push(sv, 0);
    while(!q.empty()) {
      int v = q.front(); q.pop();
      int d = dist[v];
      if (v-1 >= 0) push(v-1, d+1);
      if (v+1 < n) push(v+1, d+1);
      if (v == x) push(y, d+1);
      if (v == y) push(x, d+1);
    }
    rep(i,n) ans[dist[i]]++;
  }
  rep(i,n) ans[i] /= 2;
  for (int i=1; i<n; ++i) cout << ans[i] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string s;
	cin >> s;
	if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R')
		cout << 3 << endl;
	else if ((s[0] == 'R' && s[1] == 'R') ||
		(s[1] == 'R' && s[2] == 'R'))
		cout << 2 << endl;
	else if (s[0] == 'R' || s[1] == 'R' || s[2] == 'R')
		cout << 1 << endl;
	else
		cout << 0 << endl;
	return 0;
}

Measured memory_bytes: 3620
using System; 
using System.Text;
using System.Collections.Generic;
using System.Collections;
using System.Linq; 
using E = System.Linq.Enumerable; 


class Program {
    
    static void Main(string[] args) {
        
        var NM = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        var N = NM[0];
        var M = NM[1];
        var query = new long[M][];
        for(int i = 0;i < M; i++){
            query[i] = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        }
        //不便度を格納する配列
        var ans = new long[M];
        var UF = new UnionFind(N+1);
        //すべて崩壊したらどこもいけなくなる
        ans[M-1]　= (N*(N-1))/2;
        //橋を一つずつ壊していったときの不便度を計算する
        for(long i = M-1;i > 0;i--){
            var a = query[i][0];
            var b = query[i][1];
            //既に結合済
            if(UF.Same(a,b)){
                ans[i-1] = ans[i];
                continue;
            }
            long sizea = UF.Size(a);
            long sizeb = UF.Size(b);
            //結合
            UF.Union(a,b);
            
            //差を引く
            ans[i-1] = Math.Max(ans[i]-(sizea*sizeb),0);
        }
        
        for(int i = 0;i < M;i++){
           // Console.WriteLine(i);
            Console.WriteLine(ans[i]);
        }
        
   }
}

class UnionFind

{

// 親要素のインデックスを保持する

// 親要素が存在しない(自身がルートである)とき、マイナスでグループの要素数を持つ

public long[] Parents { get; set; }

public UnionFind(long n)

{

this.Parents = new long[n];

for (int i = 0; i < n; i++)

{

// 初期状態ではそれぞれが別のグループ(ルートは自分自身)

// ルートなのでマイナスで要素数(1個)を保持する

this.Parents[i] = -1;

}

}

 

// 要素xのルート要素はどれか

public long Find(long x)

{

// 親がマイナスの場合は自分自身がルート

if (this.Parents[x] < 0) return x;

// ルートが見つかるまで再帰的に探す

// 見つかったルートにつなぎかえる

this.Parents[x] = Find(this.Parents[x]);

return this.Parents[x];

}

 

// 要素xの属するグループの要素数を取得する

public long Size(long x)

{

// ルート要素を取得して、サイズを取得して返す

return -this.Parents[this.Find(x)];

}

 

// 要素x, yが同じグループかどうか判定する

public bool Same(long x, long y)

{

return this.Find(x) == this.Find(y);

}

 

// 要素x, yが属するグループを同じグループにまとめる

public bool Union(long x, long y)

{

// x, y のルート

x = this.Find(x);

y = this.Find(y);

// すでに同じグループの場合処理しない

if (x == y) return false;

 

// 要素数が少ないグループを多いほうに書き換えたい

if (this.Size(x) < this.Size(y))

{

var tmp = x;

x = y;

y = tmp;

}

// まとめる先のグループの要素数を更新

this.Parents[x] += this.Parents[y];

// まとめられるグループのルートの親を書き換え

this.Parents[y] = x;

return true;

}

} 



Measured memory_bytes: 27060
import sys
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = iss()

    if N[-1] in ['2', '4', '5', '7', '9']:
        print('hon')
    elif N[-1] in ['0', '1', '6', '8']:
        print('pon')
    else:
        print('bon')


if __name__ == '__main__':
    main()


Measured memory_bytes: 10092
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

const int W(1), B(0);
vector<vector<pair<int, int>>>M; // dist,cost
int n;
int prim() {
	vector<int>d(n, INF), color(n, W);
	d[0] = 0;
	priority_queue<pair<int, int>>pq; // d[v], v
	pq.push(make_pair(0, 0));
	while (!pq.empty()) {
		pair<int, int>f(pq.top()); pq.pop();
		dump(f.second);
		color[f.second] = B;
		if (d[f.second] < f.first*(-1)) continue;
		rep(i, 0, M[f.second].size()) {
			pair<int, int>u(M[f.second][i]);

			if (color[u.first] != B&&u.second < d[u.first]) {
				d[u.first] = u.second;
				pq.push(make_pair(d[u.first] * (-1), u.first));
			}
		}
	}
	return accumulate(all(d), 0);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N; cin >> N;
	n = N;
	M = vector<vector<pair<int, int>>>(N, vector<pair<int, int>>());
	vector<int> x(N), y(N); rep(i, 0, N) { cin >> x[i] >> y[i]; }
	vector<pair<int, int>>v;
	map<pair<int, int>, int>mp;
	rep(i, 0, N) {
		v.emplace_back(make_pair(x[i], y[i]));

	}
	sort(all(v), [](pair<int, int>&a, pair<int, int>&b) {return (a.first == b.first ? a.second < b.second : a.first < b.first); });
	v.erase(unique(all(v)), v.end());

	vector<pair<int, int>>h(v);
	sort(all(v), [](pair<int, int>a, pair<int, int>b) {return a.second < b.second; });
	sort(all(h), [](pair<int, int>a, pair<int, int>b) {return a.first < b.first; });
	v.erase(unique(all(v)), v.end());
	h.erase(unique(all(h)), h.end());
	rep(i, 0, v.size()) {
		mp[v[i]] = i;
	}
	N = v.size();
	n = v.size();
	dump(v, h);
	rep(i, 0, v.size()) {
		int x = mp[v[i]];
		if (i - 1 >= 0) {
			int c = abs(v[i].second - v[i - 1].second);
			int y = mp[v[i - 1]];
			M[x].emplace_back(make_pair(y, c));
		}
		if (i + 1 < N) {

			dump(i + 1);
			int c = abs(v[i + 1].second - v[i].second);
			int y = mp[v[i + 1]];
			M[x].emplace_back(make_pair(y, c));
		}

	}
	dump(111);
	rep(i, 0, N) {
		int x = mp[h[i]];
		if (i - 1 >= 0) {
			int c = abs(h[i].first - h[i - 1].first);
			int y = mp[h[i - 1]];
			M[x].emplace_back(make_pair(y, c));
		}
		if (i + 1 < N) {
			int c = abs(h[i + 1].first - h[i].first);
			int y = mp[h[i + 1]];
			M[x].emplace_back(make_pair(y, c));
		}

	}
	dump(222);
	cout << prim() << endl;
	return 0;
}

Measured memory_bytes: 27248
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int32_t, int32_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

int64_t GreatestCommonDivisor(const int64_t a, const int64_t b) {
  // GCD. O(log(min(a, b)))
  int64_t result = -1LL;
  if (a < 0) {
    std::cerr << "ERROR: GreatestCommonDivisor(): a is out of range: " << a << std::endl;
    throw 1;
  } else if (b < 0LL) {
    std::cerr << "ERROR: GreatestCommonDivisor(): b is out of range: " << b << std::endl;
    throw 1;
  } else if (a == 0LL) {
    result = b;
  } else if (b == 0LL) {
    result = a;
  } else {
    const int64_t new_a = std::min(a, b);
    const int64_t new_b = std::max(a, b) % new_a;  // Euclidean Algorithm
    result = GreatestCommonDivisor(new_a, new_b);
  }
  return result;
}


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

  int64_t x, y;
  cin >> x >> y;
  cout << GreatestCommonDivisor(x, y) << endl;
  return 0;
}



Measured memory_bytes: 3140
from copy import deepcopy
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools
import copy


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


def gcd(a, b):
    while(b != 0):
        a, b = b, a % b
    return a


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]


n, k = map(int, input().split())
p = readints()
pp = sorted(p)
# print(pp)
ans = 0
for i in range(k):
    ans += pp[i]
print(ans)


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

using namespace std;

typedef long long ll;

const int MAX_N = 1e6 + 10;
const ll MOD = 998244353;

ll sq(ll x) { return x * x % MOD; }
ll qpow(ll a, ll b) { return b ? sq(qpow(a, b / 2)) * (b & 1 ? a : 1) % MOD : 1; }
ll inv(ll x) { return qpow(x, MOD - 2); }

int N, K;
ll fac[MAX_N], ifac[MAX_N];

ll comb(int n, int m) { return fac[n] * ifac[n - m] % MOD * ifac[m] % MOD; }
ll F(int n, int m) { return comb(n + m, n); }
ll G(int n, int m, int k) {
    if (k <= 0) return F(n, m);
    if (k > min(n, m)) return 0;
    return (F(n, m) + MOD - F(k - 1, n + m - (k - 1))) % MOD;
}

int main() {
    scanf("%d%d", &N, &K);
    fac[0] = 1;
    for (int i = 1; i < MAX_N; i++) fac[i] = fac[i - 1] * i % MOD;
    ifac[MAX_N - 1] = inv(fac[MAX_N - 1]);
    for (int i = MAX_N - 1; i; i--) ifac[i - 1] = ifac[i] * i % MOD;
    ll ans = 0;
    for (int i = 0; i <= K; i++) {
        if (i * 2 < K) continue;
        int blue = i, red = K - i;
        if (blue == red) {
            (ans += G(blue, red - 1, N - 1)) %= MOD;
        } else {
            (ans += G(blue, red, N - (blue - red))) %= MOD;
        }
    }
    printf("%lld\n", ans);
}


Measured memory_bytes: 16380
#include <iostream>
#include <string>

int main() {

    std::string S;

    std::cin >> S;

    if (S == "RRR") {
        std::cout << 3 << std::endl;
        return 0;
    }

    if (S == "RRS" || S == "SRR") {
        std::cout << 2 << std::endl;
        return 0;
    }

    if (S == "RSS" || S == "RSR" || S == "SRS" || S == "SSR") {
        std::cout << 1 << std::endl;
        return 0;
    }

    std::cout << 0 << std::endl;
    return 0;

}


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

using namespace std;

int main(){
	int r, d;
	int x[11];
	cin >> r >> d >> x[0];
	for(int i = 1;i < 11;i++){
		x[i] = r * x[i - 1] - d;
		cout << x[i] <<endl;
	}
	return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, K = map(int, input().split())
    cnt = 0

    if K == 0:
        print(N ** 2)
    else:
        for b in range(K + 1, N + 1):
            p, mod = divmod((N + 1), b)

            cnt += p * (b - K)
            if mod != 0:
                if N >= K + p * b:
                    cnt += N - (K + p * b)+1

        print(cnt)


resolve()

Measured memory_bytes: 38896
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int diff = Integer.MAX_VALUE;
        ArrayList<Integer> list = new ArrayList<Integer>();

        for (int i = 0; i < n; i++) {
            list.add(sc.nextInt());
        }
        sc.close();

        Collections.sort(list);

        for (int i = 0; i < n - k + 1; i++) {
            int min = list.get(i);
            int max = list.get(i + k - 1);
            int tmp = max - min;
            if (diff > tmp) {
                diff = tmp;
            }
        }

        System.out.println(diff);

    }
}

Measured memory_bytes: 56032
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int A,B;
cin>>A>>B;
if(A==B)cout<<"Draw";
else if(A==1||(A>B&&B!=1))cout<<"Alice";
else cout<<"Bob";
  return 0;
}


Measured memory_bytes: 256
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

use itertools::Itertools;
use proconio::input;
use proconio::marker::{Chars, Usize1};

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = 92233720368547758;
#[allow(dead_code)]
static INF_I32: i32 = 21474836;
#[allow(dead_code)]
static INF_USIZE: usize = 18446744073709551;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait StringExt {
    fn get_reverse(&self) -> String;
}
impl StringExt for String {
    fn get_reverse(&self) -> String {
        self.chars().rev().collect::<String>()
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

fn main() {
    input! {
       a:i64,
       v:i64,
       b:i64,
       w:i64,
       t:i64,
    }

    if b <= a {
        let d = b - w * t;
        let e = a - v * t;
        if e <= d {
            echo!("YES");
            return;
        }
    } else {
        let d = b + w * t;
        let e = a + v * t;
        if e >= d {
            echo!("YES");
            return;
        }
    }
    echo!("NO");
}


Measured memory_bytes: 2188
#include <stdio.h>
#include <string.h>

int main(void){
	char str[201];
	int n;
	int h;
	char work[201];
	int i,j;
	
	scanf("%s",str);
	while(str[0]!='-'){
	scanf("%d",&n);
	while(n--){
		scanf("%d",&h);
		for(i=0;i<h;i++) work[i] = str[i];
		for(j=0;i<strlen(str);i++,j++) str[j] = str[i];
		for(i=0;i<h;i++,j++) str[j] = work[i];
	}
	printf("%s\n",str);
	scanf("%s",str);
	}
	return 0;
}

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

#define ll long long
#define deb(x) cerr << #x << ":" << x << "\n"
#define all(x) x.begin(),x.end()
#define sz(x) x.size()

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

int h,w;
vector<string> v;
int sx,sy,dx,dy;
int dis[1005][1005];
const int INF=1e9;

int using_dijkstra(){
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++)dis[i][j]=INF;
    }
    dis[sx][sy]=0;
    priority_queue<pair<int,pair<int,int>>,vector<pair<int,pair<int,int>>>,greater<pair<int,pair<int,int>>>> pq;
    auto legal=[&](int r,int c)->bool{
        if(r<0 || c<0 || r>=h || c>=w || v[r][c]=='#')return 0;
        return 1;
    };
    pq.push({0,{sx,sy}});
    while(sz(pq)){
        int w=pq.top().first;
        int x=pq.top().second.first;
        int y=pq.top().second.second;
        // cerr<<x<<" "<<y<<"\n";
        pq.pop();
        for(pair<int,int> P:vector<pair<int,int>>({{0,1},{0,-1},{1,0},{-1,0}})){
            if(legal(x+P.first,y+P.second)){
                if(dis[x][y]<dis[x+P.first][y+P.second]){
                    dis[x+P.first][y+P.second]=dis[x][y];
                    pq.push({dis[x+P.first][y+P.second],{x+P.first,y+P.second}});
                }
            }
        }
        for(int i=x-2;i<=x+2;i++){
            for(int j=y-2;j<=y+2;j++){
                if(legal(i,j)){
                    if(dis[x][y]+1<dis[i][j]){
                        dis[i][j]=dis[x][y]+1;
                        pq.push({dis[i][j],{i,j}});
                    }
                }
            }
        }
    }
    return dis[dx][dy]==INF?-1:dis[dx][dy];
}

void solve()
{
    cin>>h>>w;
    cin>>sx>>sy>>dx>>dy;
    --sx;--sy;--dx;--dy;
    v.resize(h);
    for(auto &x:v)cin>>x;
    cout<<using_dijkstra()<<"\n";
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}

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

namespace ABC154
{
    public class QuestionC
    {
        public static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = Console.ReadLine().Split().Select(long.Parse);

            if (a.GroupBy(x => x).Any(g => g.Count() > 1))
            {
                Console.WriteLine("NO");
            }
            else{
                Console.WriteLine("YES");
            }
        }
    }
}


Measured memory_bytes: 66156