akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
 
int x[400];
 
int main(){
    int n;
    cin >> n;
    ll ans = 1;
    REP(i,n){
        ll t;
        cin >> t;
        ans *= t / __gcd(t,ans);
    }
    cout << ans << endl;
 
    return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::io::*;
use std::str::FromStr;
 
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed reading char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed parsing")
}
 
use std::cmp::{min, max};
use std::num;
use std::collections::HashMap;
use std::collections::HashSet;

const MOD : u64 = 1_000_000_000 + 7;

fn main() {
    
    let n = read::<u64>();
    
    let mut ans = n * (n - 1) / 2;
    
    println!("{}",ans);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define Sz(a) ((int)(a).size())
const int maxn = 200009;
const int MOD = 1e9 + 7;
int main(){
#ifdef LOCAL
  freopen("a.in", "r", stdin);
#endif
  ios_base::sync_with_stdio(false),cout.tie(0),cin.tie(0);
  int64_t n;cin>>n;
  vector<int> F;
  while(n){
    F.push_back(n%26);
    n/=26;
  }
  reverse(F.begin(),F.end());

  for(int i=Sz(F)-1;i>0;--i){
    if(F[i]==0){
      F[i]=26;int j=i-1;
      while(j>=0&&F[j]==0)F[j--]=25;
      if(j>=0)F[j]--;
    }
  }
  if(F[0]==0){
    for(int i=1;i<Sz(F);++i)cout<<char(F[i]+'a'-1);
  }else{
    for(int i=0;i<Sz(F);++i)cout<<char(F[i]+'a'-1);
  }
  
  return 0;
}
//2020.06.23 17:10:06


Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <cctype>

using namespace std;

int main()
{
	int counter[26];
	for (int i = 0; i < 26; ++i) counter[i] = 0;

	char x;
	while (cin >> x)
	{
		if (isupper(x)) x = tolower(x);
		if (isalpha(x)) counter[x-'a']++;
	}

	for (int i = 0; i < 26; ++i)
		cout << (char)(i + 'a') << " : " << counter[i] << endl;
	return 0;
}

Measured memory_bytes: 1140
import java.util.*;
 
class Restaurant implements Comparable<Restaurant> {
	String direc;
	int num;
	int i;
	
	public Restaurant(String direc, int num, int i) {
		this.direc = direc;
		this.num = num;
		this.i = i;
	}
 
	public int compareTo(Restaurant other) {
		int ans = direc.compareTo(other.direc);
		if (ans != 0)
			return ans;
		return Integer.compare(other.num, num);
	}
}

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<Restaurant> list = new ArrayList<Restaurant>();
		int n = sc.nextInt();
		for (int i = 1; i <= n; i++) {
			String direc = sc.next();
			int num = sc.nextInt();
			list.add(new Restaurant(direc, num, i));
		}
		Collections.sort(list);
		for (Restaurant restaulant : list) {
			System.out.println(restaulant.i);
		}
	}
}

Measured memory_bytes: 36184
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from collections import defaultdict
def main():
    s = tuple(map(int, input()))
    lens = len(s)

    d1 = defaultdict(int)
    ss = 0
    num10 = 1
    for se in s[::-1]:
        ss += (int(se) * num10) % 2019
        ss = ss % 2019
        d1[ss] += 1
        num10 = (num10 * 10) % 2019
    r = d1[0]
    for v in d1.values():
        r += v * (v - 1) // 2
    print(r)

if __name__ == '__main__':
    main()

Measured memory_bytes: 12500
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>


#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

const int cons = 1e9 + 7;

//61C
int main(void) {
	ll n, k;
	cin >> n >> k;
	ll nums[100000] = { 0 };
	rep(0, n) {
		ll a, b;
		cin >> a >> b;
		nums[a] += b;
	}
	ll count = 0;
	ll ans = 0;
	rep(1, 100001) {
		if (nums[i] == 0)continue;
		if (k <= count + nums[i]) {
			ans = i;
			break;
		}
		else {
			count += nums[i];
		}
	}
	cout << ans << endl;
}

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


using namespace std;
int n;
vector<int> vec;

int meme[100007];

int solve(int index){

    if(index==n-1){
        return 0;
    }
    if(meme[index]!=-1){
        return meme[index];
    }
    
    int ret1 = 100000000;
    int ret2 = 100000000;
    if(index+1<n){
         ret1 = abs (vec[index]- vec[index+1]) + solve(index+1); 
    }
    if(index+2<n){
         ret2 = abs (vec[index]- vec[index+2]) + solve(index+2); 
    }


    return meme[index] = min(ret1,ret2);
}

int main(){
    cin>>n;
    memset(meme,-1,sizeof(meme));
    int num;
    for(int i = 0 ; i<n ; i++){
        cin>>num;
        vec.push_back(num);
    }
    cout<<solve(0)<<endl;
    return 0;
}

Measured memory_bytes: 8852
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using uint = unsigned int;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;
const ld PI = acosl(-1);

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

    int A, B, H, M;
    cin >> A >> B >> H >> M;

    int tm = H * 60 + M;
    double Adeg = (double)tm / 2;
    double Bdeg = (double)6 * M;
    double deg = abs(Adeg - Bdeg);
    deg = min(360 - deg, deg);
    double rad = deg * PI / 180;

    double ans = sqrt(A * A + B * B - (double)2 * A * B * cos(rad));

    printf("%.15lf\n", ans);

    return 0;
}


Measured memory_bytes: 4244
#![allow(unused_imports, non_snake_case)]
use proconio::{
    input, fastout,
    marker::{Chars, Bytes, Usize1}
};

#[fastout]
fn main() {
    input! {
        n:usize,
        a:[usize; n]
    }
    let mut a = a;
    a.sort();
    a.reverse();
    let mut tot:usize = a.iter().sum();
    let mut cnt = 1;
    for &x in &a {
        if x > (tot - x) * 2 {
            break;
        }
        tot -= x;
        cnt += 1;
    }
    println!("{}", cnt);
}

Measured memory_bytes: 4264
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] input =sc.nextLine().split(" ");
		int r = Integer.parseInt(input[0]);
		int c = Integer.parseInt(input[1]);
		int[][] sheet = new int[r+1][c+1];
	//in	
		for(int i=0;i<r;i++){
			String[] line = sc.nextLine().split(" ");
			int sum=0;
			for(int j=0;j<c;j++){
				sheet[i][j]=Integer.parseInt(line[j]);
				sum = sum+sheet[i][j];
			}
			sheet[i][c]=sum;
		}	
		for(int i=0;i<c+1;i++){
			int sum=0;
			for(int j=0;j<r;j++){
				sum=sum+sheet[j][i];
			}
			sheet[r][i]=sum;
		}
	//out
		for(int i=0;i<r+1;i++){
			for(int j=0;j<c;j++){
				System.out.print(sheet[i][j]+" ");
			}
			System.out.println(sheet[i][c]);
		}
	}
}

Measured memory_bytes: 34240
# coding: utf-8
import sys
input = sys.stdin.readline

A, B = map(int, input().split())
ans = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            val = 10000*i + 1000*j + 100*k + 10*j + i
            if A <= val <= B:
                ans+=1
print(ans)


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

using namespace std;
#define ll long long
#define cni const int
#define cnl const long long

cni maxn = 1e5+20;
ll dp[maxn];
ll inf=1e18+10;
int mod=1e9 + 7;
int ar[maxn], maxx[maxn], mxx[maxn];


int main() 
{
	ios_base::sync_with_stdio(0);cin.tie(0);
	int n, k;
	cin >> n >> k;
	for(int i=0;i<n;i++)
		cin >> ar[i];
		
    dp[0] = 0;
    dp[1] = abs(ar[1]-ar[0]);
    
    for(int i=2;i<n;i++)
    {
    	ll mn=inf;
		for(int j=1;j<=min(k,i);j++)
				mn=min(mn, dp[i-j] + abs(ar[i] - ar[i-j])); 
						
		dp[i]=mn;
	}
    cout << dp[n-1];
}




Measured memory_bytes: 1408
H,W=map(int,input().split())
x=[[] for _ in range(H)]
xn=[[] for _ in range(H)]
for i in range(H):
  for _ in range(W):
    xn[i].append(999)

for i in range(H):
  x[i]=input()

xn[0][0]=0

for i in range(H+W-1):
  for j in range(i+1):
    if i-j>=W:
      continue
    if j>=H:
      break
    
    w=1
    h=1
    if i-j>=W-1:
      w=0
    if j>=H-1:
      h=0
    if w==1:
      if x[j][i-j]==".":
        if x[j][i-j+1]=="#":
          xn[j][i-j+1]=min(xn[j][i-j]+1,xn[j][i-j+1])
        else:
          xn[j][i-j+1]=min(xn[j][i-j],xn[j][i-j+1])
      else:
        xn[j][i-j+1]=min(xn[j][i-j],xn[j][i-j+1])
    if h==1:
      if x[j][i-j]==".":
        if x[j+1][i-j]=="#":
          xn[j+1][i-j]=min(xn[j][i-j]+1,xn[j+1][i-j])
        else:
          xn[j+1][i-j]=min(xn[j][i-j],xn[j+1][i-j])
      else:
        xn[j+1][i-j]=min(xn[j][i-j],xn[j+1][i-j])

if x[0][0]=="#":
  xn[H-1][W-1]+=1
print(xn[H-1][W-1])

Measured memory_bytes: 3192
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main() {

	char s[1][3] ;
	int a_count = 0;
	int b_count = 0;

	scanf("%s", s[0]);




	for(int i = 0; i < 3; i++) {
		if(s[0][i] == 'A' ) {
			a_count++;
		} else if(s[0][i] == 'B' ) {
			b_count++;
		}
	}

	if(a_count == 3 || b_count == 3) {
		printf("No\n");
	} else {
		printf("Yes\n");
	}


	return 0;

}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<cstdlib>

using namespace::std;

int main(){

  int number;
  int i, j;
  int center = 0;
  int h = 0;
  int w = 0;
  cin>>number;

  while(number != 0){
  int magic[number][number];

  for(i = 0; i < number; i++){
    for(j = 0; j < number; j++){
      magic[i][j] = -1;
    }
  }

  center = number/2;

  h = center + 1;
  w = center;
  magic[h][w] = 1;
  for(i = 2; i <= number * number; i++){
    h = (h + 1) % number;
    w = (w + 1) % number;
    if(magic[h][w] != -1){
      h = (h + 1) % number;
      w = w - 1;
      if(w == -1){
        w = w + number;
      }
    }
    magic[h][w] = i;
  }

  for(i = 0; i < number; i++){
    for(j = 0; j < number; j++){
      printf("%4d", magic[i][j]);
    }
    printf("\n");
  }



  cin>>number;
  }


  return 0;
}

Measured memory_bytes: 1164
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}

	Scanner sc = new Scanner(System.in);

	void run() {

		for(;;){
			String s = sc.next()+"_EOT";
			
			if(s.equals("."+"_EOT")){
				break;
			}
			
			String s2 = sc.next()+"_EOT";
			
			String[] spl1 = s.split("\"");
			String[] spl2 = s2.split("\"");
			
			boolean match = true;
			boolean close = true;
			int count = 0;
			if(spl1.length != spl2.length){
				match = false;
				close = false;
			}else{
				for(int i = 0; i < spl1.length;i++){
					if(!spl1[i].equals(spl2[i])){
						match = false;
						count ++;
					}
					if(i % 2 == 0){
						if(!spl1[i].equals(spl2[i])){
							close = false;
						}						
					}
				}		
			}
			
			if(match){
				System.out.println("IDENTICAL");
			}else if(close && count == 1){
				System.out.println("CLOSE");
			}else{
				System.out.println("DIFFERENT");
			}
			
		}
		
	}
}



Measured memory_bytes: 28904
from fractions import gcd
def yaku2(a):
    count=0
    while a%2==0:
        a=a//2
        count+=1
    return(count)

def lcm(a,b):
    return(a*b//gcd(a,b))

N,M=map(int,input().split())
A=list(map(int,input().split()))

yaku=yaku2(A[0])
for i in range(1,N):
    if yaku!=yaku2(A[i]):
        print(0)
        exit()



_lcm=A[0]
for i in range(1,N):
    A[0]=lcm(A[0],A[i])
#print(A[0])
print((M-(A[0]-A[0]//2-A[0]))//A[0])


Measured memory_bytes: 89580
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()

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

    string s;
    int n;
    cin >> n >> s;

    int H[2] = {1, 1}, D[2] = {(n + 1) / 2, n / 2};

    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < D[i]; j++) {
            H[i] *= 3;
        }
    }
    
    vector<int> ops[2], opt[2];
    vector<string> shorten_s(H[0]);
    vector<int> res(H[0]);

    for (int j = 0; j < 2; j++) {
        ops[j].resize(H[j]);
        opt[j].resize(H[j]);

        for (int i = 0; i < H[j]; i++)  {
            int x = i;

            vector<int> v;
            while (x > 0) {
                v.push_back(x % 3);
                x /= 3;
            }

            reverse(all(v));
            for (int y : v) {
                ops[j][i] *= 3;
                if (y > 0) {
                    y = 3 - y;
                    ops[j][i] = ops[j][i] + y;
                }
            }

            opt[j][i] = (i + 1) % H[j];
        }
    }
    
    // cout << opt[0][2] << "\n";

    for (int i = 0; i < H[0]; i++) {
        res[i] = i;
        for (const char &c : s) {
            if (c == 'S') {
                if (!shorten_s[i].empty() && shorten_s[i].back() == c) {
                    shorten_s[i].pop_back();
                }
                else {
                    shorten_s[i].push_back(c);
                }
                res[i] = ops[0][res[i]];
            }
            else {
                res[i] = opt[0][res[i]];
                if (res[i] == 0)
                    shorten_s[i].push_back(c);
            }
        }
    }

    for (int i = 0; i < H[0] * H[1]; i++) {
        ll ans = i / H[0];
        for (const char &c : shorten_s[i % H[0]]) {
            if (c == 'S') {
                ans = ops[1][ans];
            }
            else {
                ans = opt[1][ans];
            }
        }
        ans = ans * H[0] + res[i % H[0]];
        cout << ans << " ";
    }

    return 0;
}

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

int main(void){
    int n, a, c[10], ans = 0;
    cin >> n;
    for (int i = 0; i <= 8; i++) c[i] = 0;
    for (int i = 1; i <= n; i++) {
        cin >> a;
        if (a < 3200) c[a / 400]++;
      	else c[8]++; 
    }
    for (int i = 0; i < 8; i++) {
        if (c[i] > 0) ans++;
    }
    if (ans != 0) cout << ans << " " << c[8] + ans;
  	else cout << 1 << " " << c[8];
    return 0;
}



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

int main()
{
	int n, r;
	long long max = -2000000000, min = 2000000000;
	cin >> n;
	
	for (int i = 0; i < n; i++)
	{
		cin >> r;
		if (r - min > max)
			max = r - min;
		if (r < min)
			min = r;
	}
	cout << max << endl;

	return 0;
}


Measured memory_bytes: 3128
#include <algorithm>
#include <iostream>

using namespace std;

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int n_of_1 = 0, n_of_2 = 0, n_of_3 = 0;
  int p;
  while (cin >> p) {
    if (p <= A)
      ++n_of_1;
    else if (p <= B)
      ++n_of_2;
    else
      ++n_of_3;
  }
  int res = min(n_of_1, n_of_2);
  res = min(res, n_of_3);
  cout << res << endl;
  return 0;
}

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

using namespace std;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a , b;
  cin >> a >> b;
  if (b < a){
    swap(a,b);
  }
  for(int i=0;i<b;++i){
    cout << a;
  }
  return 0;
}



Measured memory_bytes: 256
//................ DON'T WISH IT WERE EASIER, WISH YOU WERE BETTER........................
//............ WHEN LIFE PUTS YOU IN TOUGH SITUATIONS, DONT SAY "WHY ME" SAY "TRY ME".......

#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#define pb emplace_back
#define endl "\n"
#define f first
#define mp make_pair
#define s second
#define int long long
#define delrep(v)  (v).erase(unique((v).begin(),(v).end()),(v).end());
#define all(a)  (a).begin(),(a).end()
#define allr(a) (a).rbegin(),(a).rend()
#define sz(x)   (int)x.size()
#define lll __int64
const int N=1e6+10; const int M=1e6+20;
const int mod=1e9+7;
using namespace std;
typedef long long ll;
const long long MAX_SIZE = 3000003;
vector<pair<int,int>>v[N]; map<int,int>hashx;
vector<int>a(N); vector<int>b(N); int pref[N]; int suff[N]; int sum[N];
// vector<ll>dp(N);
ll n,k;
ll dp[1005][1005];
int32_t main()
{
    int n; cin>>n; cout<<n*(n-1)/2;

}
 



Measured memory_bytes: 39936
#![allow(clippy::many_single_char_names)]
#[allow(unused_imports)]
use proconio::{
    input,
    marker::{Chars, Usize1},
};

fn main() {
    input!(
        h: usize,
        w: usize,
        si: Usize1,
        sj: Usize1,
        ti: Usize1,
        tj: Usize1,
        grid: [Chars; h]
    );
    let grid = grid
        .iter()
        .map(|v| {
            v.iter()
                .map(|&c| match c {
                    '.' => false,
                    '#' => true,
                    _ => panic!(),
                })
                .collect::<Vec<_>>()
        })
        .collect::<Vec<_>>();

    let mut queue = std::collections::VecDeque::new();
    let mut dist = vec![vec![std::u32::MAX; w]; h];
    dist[si][sj] = 0;
    queue.push_back((si, sj));
    while let Some((i, j)) = queue.pop_front() {
        let d = dist[i][j];
        for di in -2..=2 {
            for dj in -2..=2 {
                if (di, dj) == (0, 0) {
                    continue;
                }
                let ni = i as i32 + di;
                let nj = j as i32 + dj;
                if (0..h as i32).contains(&ni) && (0..w as i32).contains(&nj) {
                    let ni = ni as usize;
                    let nj = nj as usize;
                    if !grid[ni][nj] {
                        if 2 <= di.abs() + dj.abs() {
                            if d + 1 < dist[ni][nj] {
                                dist[ni][nj] = d + 1;
                                queue.push_back((ni, nj));
                            }
                        } else {
                            if d < dist[ni][nj] {
                                dist[ni][nj] = d;
                                queue.push_front((ni, nj));
                            }
                        }
                    }
                }
            }
        }
    }

    let ans = dist[ti][tj];
    if ans != std::u32::MAX {
        println!("{}", ans);
    } else {
        println!("-1");
    }
}


Measured memory_bytes: 12308
n=int(input())
graph=[[0]*n for loop in range(n)]
for loop in range(n):
    tmp_ope=list(map(int,input().split()))
    for j in range(tmp_ope[1]):
        graph[tmp_ope[0]-1][tmp_ope[j+2]-1]=1

for loop in range(n):
    for j in range(0,n-1):
        print(f"{graph[loop][j]}",end=" ")
    print(f"{graph[loop][n-1]}")


Measured memory_bytes: 6392
// review
#include <iostream>

using namespace std;
typedef long long ll;

string s;

ll cnt[26];

void solve() {
  for (int i=0;i<s.size();i++) {
    cnt[s[i] - 'a']++;
  }
  ll ans = 0;
  for (int i=0;i<26;i++) {
    ans += cnt[i] * (cnt[i]-1) / 2;
  }
  cout << (s.size() * (s.size() - 1) / 2 - ans + 1) << endl;
}

int main() {
  cin >> s;
  solve();
}


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

const int MAX = 4e6 + 5;

bitset<MAX> dp, tmp;

int main() {
    int n, sum = 0;
    scanf("%d",&n);
    for(int i = 1; i <= n; i++) {
        int x; scanf("%d",&x);
        sum += x;
        tmp[x] = 1;
        dp |= ((dp << x) | tmp);
        tmp[x] = 0; 
    }
    for(int j = (sum+1)/2; j < MAX; j++) if (dp[j]) {
        printf("%d\n",j);
        return 0;
    }
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef long double ld;
typedef vector<ld> vd;
typedef bool bl;
typedef vector<bl> vb;
typedef unordered_map<ll,unordered_map<ll,ll>> graph;

const ll e5 = 1 << 20;
const ll mod = 1000000007;
const ll e3 = 1 << 13;
const ll INF = 1ll << 60;

ll n,k;
string s;

int main(){
  cin >> n >> k;
  cin >> s;
  s[k-1] += 32;
  cout << s << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int64_t,int64_t> pll;
typedef vector<int64_t> vl;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
const long double PI = acos(-1);
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define sz(s) (s).size()
#define ALL(a) begin(a),end(a)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second


void solve() 
{
    int a,b;cin>>a>>b;
    cout<<(a*500>=b?"Yes":"No")<<endl;
}

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


Measured memory_bytes: 256
def read_input():
    n, m = map(int, input().split())
    pylist = [tuple(map(int, input().split())) for _ in range(m)]
    return n, m, pylist


def submit():
    n, m, pylist = read_input()
    pylist_count = {}

    pylist_sort = sorted(pylist, key=lambda x: x[1])
    cities = {i: 0 for i in range(1, n + 1)}

    for p, y in pylist_sort:
        cities[p] += 1
        pylist_count[(p, y)] = cities[p]
    
    for p, y in pylist:
        print(str(p).zfill(6) + str(pylist_count[(p, y)]).zfill(6))


if __name__ == "__main__":
    submit()

Measured memory_bytes: 47168
import java.util.Scanner;

class Main {
	static int[][] dp;
	static boolean[][] isStop;

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while (true) {
			int w = in.nextInt();
			int h = in.nextInt();

			if (w == 0 && h == 0) {
				in.close();
				return;
			}
			int n = in.nextInt();
			dp = new int[h + 1][w + 1];
			isStop = new boolean[h + 1][w + 1];

			for (int i = 0; i < h + 1; i++) {
				for (int j = 0; j < w + 1; j++) {
					isStop[i][j] = false;
				}
			}

			for (int i = 0; i < n; i++) {
				int a = in.nextInt();
				int b = in.nextInt();
				isStop[b][a] = true;
			}
			System.out.println(solve(h, w));

		}

	}

	static int solve(int y, int x) {

		if (dp[y][x] != 0)
			return dp[y][x];
		if (x == 0 || y == 0)
			return 0;
		if (x == 1 && y == 1)
			return 1;
		if (isStop[y][x]) {
			return 0;
		}
		int ret = 0;
		dp[y][x] = (solve(y - 1, x) + solve(y, x - 1));
		ret = dp[y][x];
		return ret;
	}

}

Measured memory_bytes: 26036
s = input()

L = [['W', 'E'], ['S', 'N']]

for l in L:
  if l[0] in s:
    if l[1] not in s:
      print("No")
      exit(0)
  if l[1] in s:
    if l[0] not in s:
      print("No")
      exit(0)

print("Yes")

Measured memory_bytes: 8876
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))

using namespace std;
typedef pair<llint, llint> P;

llint n;
llint a[200005];

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	sort(a, a+n);
	reverse(a, a+n);
	
	llint ans = 0;
	for(int i = 1; i <= n-1; i++) ans += a[i/2];
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 5212
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;


#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define pb push_back
#define pii pair<int,int>
#define pf push_front
#define mp make_pair
#define vi vector<int>
#define vip vector<pair<int,int> >
#define ff first
#define ss second
#define int long long
#define mod 1000000007
#define BIG 998244353
#define s(t) scanf("%lld",&t)
#define p(t) printf("%lld\n",t)
#define mii map<int,int>
#define MSET(table,i) memset(table, i, sizeof(table))
#define endl '\n'
#define tc int t;cin>>t;while(t--)
#define pi  3.1415926358
#define bits(x) __builtin_popcount(x)
#define minimum(a,n) min_element(a,a+n)-a
#define maximum(a,n) max_element(a,a+n)-a
#define pqbig priority_queue<pii>
#define pqsmall priority_queue<int,vector<int>,greater<int> >
#define all(v) v.begin(),v.end()
#define sitr set<int>:: iterator
#define spitr set<pii>:: iterator
#define mitr map<int,int>:: iterator

int toint(const string &s) {stringstream ss; ss << s; int x; ss >> x; return x;}
string tostring ( int number ) {stringstream ss; ss << number; return ss.str();}


typedef tree<int, null_type, less<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;


#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl


int32_t main()
{
    fast;
    int n;cin>>n;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        if(i%3!=0 and i%5!=0)
            ans+=i;
    }
    cout<<ans;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  int y;
  while(1) {
    y = 0;
    cin >> x;
    if (x == "0") break;
    for (int i = 0; i < x.size(); i++) {
      y += (x[i] - '0');
    }
    cout << y << endl;
  }
}


Measured memory_bytes: 3108
#include<stdio.h>

typedef struct{
  char c;
  int value;
  }card;

int main(){
  char space;
  int i,j,n,min,flag;
  card x[36],y[36],z;
  scanf("%d\n",&n);
  for(i=0;i<n;i++){
    scanf("%c%d%c",&x[i].c,&x[i].value,&space);
    y[i]=x[i];
  }

  for(j=0;j<n;j++){
    flag=0;
    for(i=n-1;i>j;i--){
      if(x[i].value<x[i-1].value){
        z=x[i];
        x[i]=x[i-1];
        x[i-1]=z;
        flag=1;
      }
    }
    if(flag==0)break;
  }

  for(j=0;j<n;j++){
    min=j;
    for(i=j;i<n;i++){
      if(y[i].value<y[min].value)
      min=i;
    }
    if(min!=j){
      z=y[j];
      y[j]=y[min];
      y[min]=z;
    }
  }

  for(i=0;i<n-1;i++){
    printf("%c%d ",x[i].c,x[i].value);
  }

  printf("%c%d\n",x[n-1].c,x[n-1].value);
  printf("Stable\n");

  for(i=0;i<n-1;i++){
    printf("%c%d ",y[i].c,y[i].value);
    if(x[i].c!=y[i].c)flag=2;
  }

  printf("%c%d\n",y[n-1].c,y[n-1].value);

  if(flag==2)printf("Not stable\n");
  else printf("Stable\n");

  return 0;
}



Measured memory_bytes: 2088
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
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 NIL = -1;
const int INF = (1<<21);
const long long MOD = 1e9+7;
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};

int main() {
  int N, M; cin >> N >> M;
  vector<vector<int>> S(M);
  vector<int> p(M);
  for (int i = 0; i < M; ++i) {
    int k; cin >> k;
    for (int j = 0; j < k; ++j) {
      int s; cin >> s; s--;
      S[i].push_back(s);
    }
  }
  for (int i = 0; i < M; ++i) cin >> p[i];
  int ans = 0;
  for (int bit = 0; bit < (1<<N); ++bit) {
    bool flag = true;
    for (int i = 0; i < M; ++i) {
      int on = 0;
      for (auto ns : S[i]) {
        if (bit & (1<<ns)) on++;
      }
      if (on % 2 != p[i]) flag = false;
    }
    if (flag) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3564
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)
from bisect import bisect_left


def read():
    H, W, K = map(int, input().strip().split())
    C = [["." for j in range(W)] for i in range(H)]
    for i in range(H):
        c = list(input().strip())
        for j in range(W):
            C[i][j] = c[j]
    return H, W, K, C


def solve(H, W, K, C):
    ans = 0
    D = [["." for j in range(W)] for i in range(H)]

    for p in range(1<<H):
        for q in range(1<<W):
            # init
            for i in range(H):
                for j in range(W):
                    D[i][j] = C[i][j]
            
            # simulate
            for i in range(H):
                if (p >> i) & 1 == 1:
                    for j in range(W):
                        D[i][j] = "."
            for j in range(W):
                if (q >> j) & 1 == 1:
                    for i in range(H):
                        D[i][j] = "."
            
            # count
            count = 0
            for i in range(H):
                for j in range(W):
                    if D[i][j] == "#":
                        count += 1
            if count == K:
                ans += 1
    return ans


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Measured memory_bytes: 9288
h,w = map(int,input().split())
ass = 10**9
if h%3 == 0:
    ass = 0
else:
    ass = w

if w % 3 == 0:
    ass = 0
else:
    ass = min(ass,h)


if h % 2 == 0:
    for i in range(1,w):
        ass = min(ass,abs(h*i-(w-i)*h//2))
else:
    for i in range(1,w):
        ass = min(ass,max(abs(h*i-(h-1)*(w-i)//2),abs(h*i-(h+1)*(w-i)//2),w-i))

if w % 2 == 0:
    for i in range(1,h):
        ass = min(ass,abs(w*i-(h-i)*w//2))
else:
    for i in range(1,h):
        ass = min(ass,max(abs(w*i-(w-1)*(h-i)//2),abs(w*i-(w+1)*(h-i)//2),h-i))
print(ass)
        

    


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
int main() {
	int n, k, s;
	scanf("%d%d%d", &n, &k, &s);
	const int MX = 1e9;
	for (int i = 0; i < n; ++i) {
		printf("%d ", i < k ? s : s == MX ? s - 1 : s + 1);
	}
}


Measured memory_bytes: 1280
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

class Main {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static Scanner sc = new Scanner(new InputStreamReader(System.in));

	public static void main (String[] args) throws Exception {
		int[] list = prime();
		while(true) {
			String str = br.readLine();
			if(str == null) break;
			solve(list, Integer.parseInt(str));
		}
	}
	
	public static int[] prime() {
		int[] list = new int[10000];
		list[0] = 2;
		list[1] = 3;
		list[2] = 5;
		list[3] = 7;
		list[4] = 11;
		list[5] = 13;
		int pit = 6;
		for(int i=17; i<60000; i = i+2) {
			for(int j=1; list[j]*list[j] < i; j++) {
				if(i%list[j] == 0) break;
				if(list[j+1]*list[j+1] > i) {
					list[pit] = i;
					pit++;
				}
			}
		}
		return list;
	}
	
	public static void solve(int[] list, int n) {
		for(int i=0; i<10000; i++) {
			if(n < list[i]) {
				if(n == list[i-1]) System.out.println(list[i-2]+" "+list[i]);
				else System.out.println(list[i-1]+" "+list[i]);
				return;
			}
		}
	}
}

Measured memory_bytes: 19176
//??????????????????????????????????????????????????????????????¨??¢?´¢?????°???p??§????????????????????????
//(???or???)??¨?????§a??????b???????????¨???????§?????????¢????±?????????¢??°????????????

#include <iostream>
#include <algorithm>
using namespace std;

int getDist( bool isRight, int from, int to, int n ){
	//???????????????????????????
	if( !isRight )
		swap( from, to );
	//0??????????????????
	if( from <= to )
		return to - from;
	//0????????????
	return n - from + to;
}

int toLeft( int *a, int m, int val ){
	int *it = upper_bound( a, a + m, val );
	if( it == a + m )
		return a[0];
	return *it;
}
int toRight( int *a, int m, int val ){
	int *it = lower_bound( a, a + m, val );
	if( it == a )
		return a[m - 1];
	return *(--it);
}

int n, m, p;
int d[100000];

int main()
{
	int i;
	cin >> n >> m >> p;
	for( i = 0; i < m; i++ )
		cin >> d[i];
	sort( d, d + m );
	
	int ans = 1000000000;
	for( i = 0; i < n; i++ ){
		//??????
		int c1 = getDist( true, p, i, n ) + getDist( false, i, toLeft(d, m, i), n );
		//??????
		int c2 = getDist( false, p, i, n ) + getDist( true, i, toRight(d, m, i), n );
		ans = min( ans, min(c1, c2) );
	}
	ans *= 100;
	
	cout << ans << endl;
	return 0;
}

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

public class Main {
	private static void solve(){
	//Implement solution here.
		int h = ni();
		int w = ni();
		char[][] map = new char[h][w];
		int[][] vmap = new int[h][w + 1];
		int[][] hmap = new int[h][w];
		for(int i = 0; i < h; i++) {
			map[i] = next().toCharArray();
		}
		
		int st = -1;
		int dotcnt = 0;
		boolean indot = false;
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				if(!indot) {
					if(map[i][j] == '.') {
						indot = true;
						st = j;
						dotcnt = 1;						
					}
				} else {
					if(map[i][j] == '.') {
						dotcnt++;
					} else {
						Arrays.fill(vmap[i],st,j,dotcnt);
						st = -1;
						dotcnt = 0;
						indot = false;
					}
				}
				if(j == w - 1 && indot) {
					Arrays.fill(vmap[i],st,j + 1,dotcnt);
					st = -1;
					dotcnt = 0;
					indot = false;
				}
			}
		}
		
		for(int i = 0; i < w; i++) {
			for(int j = 0; j < h; j++) {
				if(!indot) {
					if(map[j][i] == '.') {
						indot = true;
						st = j;
						dotcnt = 1;						
					}
				} else {
					if(map[j][i] == '.') {
						dotcnt++;
					} else {
						for(int k = st; k < j; k++) {
							hmap[k][i] = dotcnt;
						}
						st = -1;
						dotcnt = 0;
						indot = false;
					}
				}
				if(j == h - 1 && indot) {
					for(int k = st; k <= j; k++) {
						hmap[k][i] = dotcnt;
					}
					st = -1;
					dotcnt = 0;
					indot = false;
				}
			}
		}
		
		int result = 0;
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				result = Math.max(result, vmap[i][j] + hmap[i][j] - 1);
			}
		}
		System.out.println(result);
		
	}

    //Switch input source (stdin/file)
	private static BufferedReader br  = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args){
        String debugDataPath = System.getenv("DD_PATH");        
        if(debugDataPath != null){
            try{
            	br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
            }catch(Exception e){
                throw new RuntimeException(e);
            }
        }
        solve();
	}

    //Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
    //Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
    //Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
    //Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
    //Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
    //Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 94080
n,k = map(int,input().split())
a = []
b = []
for i in range(n):
    x,y = map(int,input().split())
    a.append(x)
    b.append(y)
cnt = {}
for i in range(n):
    cnt[a[i]] = 0
for i in range(n):
    cnt[a[i]] += b[i]
res = 0
for i in range(10**6):
    if i not in cnt:continue
    if res +cnt[i] >=k:
        ans = i
        break
    res += cnt[i]
print(ans)
    
    

Measured memory_bytes: 16096
#include<bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
typedef long long ll;
const int N=1005,mod=1000000007;
int n,m,t,k1,k2,c1,c2;
ll k;
char s[N][N];
bool flag1,flag2;
struct matrix{
    int a[4][4];
    matrix(){
        memset(a,0,sizeof(a));
    }
    matrix operator * (const matrix &b){
        matrix c;
        for(int i=0;i<4;i++){
            for(int j=0;j<4;j++){
                if(a[i][j]){
                    for(int k=0;k<4;k++){
                        c.a[i][k]=(c.a[i][k]+1LL*a[i][j]*b.a[j][k]%mod)%mod;
                    }
                }
            }
        }
        return c;
    }
}a,b;
int fastpow(int a,ll x){
    int res=1;
    while(x){
        if(x&1){
            res=1LL*res*a%mod;
        }
        x>>=1;
        a=1LL*a*a%mod;
    }
    return res;
}
matrix fastpow(matrix a,ll x){
    matrix res=a;
    x--;
    while(x){
        if(x&1){
            res=res*a;
        }
        x>>=1;
        a=a*a;
    }
    return res;
}
int main(){
    scanf("%d%d%lld",&n,&m,&k);
    if(k==1){
        puts("1");
        return 0;
    }
    for(int i=1;i<=n;i++){
        scanf("%s",s[i]+1);
        for(int j=1;j<=m;j++){
            if(s[i][j]=='#'){
                t++;
                if(s[i][j-1]=='#'){
                    k1++;
                }
                if(s[i-1][j]=='#'){
                    k2++;
                }
            }
        }
    }
    for(int i=1;i<=n;i++){
        if(s[i][1]=='#'&&s[i][m]=='#'){
            c1++;
            flag1=true;
        }
    }
    for(int i=1;i<=m;i++){
        if(s[1][i]=='#'&&s[n][i]=='#'){
            c2++;
            flag2=true;
        }
    }
    if(!flag1&&!flag2){
        printf("%d\n",fastpow(t,k-1));
    }else if(flag1&&flag2){
        puts("1");
    }else if(flag1&&!flag2){
        a.a[0][0]=1;
        a.a[0][1]=1;
        b.a[0][0]=t;
        b.a[1][0]=mod-k1;
        b.a[1][1]=c1;
        a=a*fastpow(b,k-1);
        printf("%d\n",a.a[0][0]);
    }else{
        a.a[0][0]=1;
        a.a[0][1]=1;
        b.a[0][0]=t;
        b.a[1][0]=mod-k2;
        b.a[1][1]=c2;
        a=a*fastpow(b,k-1);
        printf("%d\n",a.a[0][0]);
    }
    return 0;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    int n,p=0; cin>>n;
    for(int i=1;i<=9;i++){
        for(int j=1;j<=9;j++){
            if(i*j==n){p=1;}
        }
    }
    if(p==1)cout<<"Yes";
    else cout<<"No";
}



Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
/// Macros ---------------------
#define ll long long
#define sz(a) (int)a.size()
#define int long long
#define pb push_back
#define vi vector<int>
#define f first
#define s second
#define ii pair<int,int>
#define lb lower_bound
#define up upper_bound
#define rep(i,x,y) for(int i=(x);i<=(y);i++)
#define ld long double
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
/// Constracts -----------------------------------------------
const int maxn=1e5;
const int INF=(1ll)<<(30ll);
const int inf=1000000000000000000;
const int eps=1e-9;
const int mod=1e9+7;
/// Quick Pow ------------------------------------------------
int qpow(int b,int e)
{
    if( !e ) return 1;
    if( e & 1 ) return qpow(b, e - 1) * b;
    int pwur = qpow(b, e >> 1);
    return pwur * pwur;
}

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

/// My Code ---------------------------------------------------

bool mk[1001];
bool can(int n){
    for(;n>0;n/=10){
        if(mk[n%10])return 0;
    }
    return 1;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,k;
    cin>>n>>k;
    for(int i=0;i<k;i++){
        int a;
        cin>>a;
        mk[a]=1;
    }
    while(!can(n))n++;
    cout<<n<<endl;

    return 0;
}


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

using namespace std;

const int N = 1e5 + 7 ; 

int n , m ; 

int main(){
   // freopen("in.in" , "r" , stdin); 
    cin>>n>>m ; 
    cout<< n  * (n-1) /2 + m * (m-1)/2;

    return 0 ;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;

int main(int argc, char const* argv[])
{
  int64_t N;
  scanf("%ld", &N);

  string S;
  int64_t P;
  // vector<pair<string, int64_t>> vp(N, make_pair("", 0));
  vector<pair<pair<string, int64_t>, int32_t>> vpp(N);
  for (int i = 0; i < N; i++) {
    cin >> S;
    scanf("%ld", &P);
    vpp[i] = make_pair(make_pair(S, P), i + 1);
  }

  sort(vpp.begin(), vpp.end(), [](pair<pair<string, int64_t>, int32_t> p, pair<pair<string, int64_t>, int32_t> q) {
    int res = p.first.first.compare(q.first.first);
    if (!res) {
      return p.first.second > q.first.second;
    } else {
      return (res < 0);
    }
  });

  /*
  for (auto v : vpp) {
    cout << '[' << v.second << "] " << v.first.first << ' ' << v.first.second << '\n';
  }
  */
  for (auto v : vpp) printf("%d\n", v.second);
  return 0;
}



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

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using ll = long long;
using pint = pair<int, int>; 
using pll  = pair<ll, ll>;
using vint = vector<int>; 
using vll  = vector<ll>;
using vstr = vector<string>;

//　定数, 変数 *********************************************
const ll MOD=1e9+7;
const ll INF=1ll<<60;

ll N;

// *********************************************************
int main(){

    cin >>  N;

    ll m;
    vector<char> vec;

    string s="abcdefghijklmnopqrstuvwxyz";
    
    while(N>26){
        m = N%26;
        N = N/26;
        
        if(m==0){
            vec.emplace_back('z');
            N -= 1;
        }else{
            vec.emplace_back(s[m-1]);
        }
    }

    if(N==0){
        //vec.emplace_back('z');
    }else{
        vec.emplace_back(s[N-1]);
    }

    for(int i=vec.size()-1; i>=0; --i){
        cout << vec.at(i);
    }
    cout<<endl;
    return 0;
}

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

ll mod=998244353;

int main(){
    ll x,y;
    cin>>x>>y;
    
    if(x==y){
        cout<<0;
    }else if(y<x){
        cout<<min({abs(y-x)+2,abs(y-(-x))+1});
    }else{
        cout<<min({abs(y-x),abs((-y)-x)+1});
    }
    
}

Measured memory_bytes: 3600
package main

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

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	lMax := 0
	rMin := 100001
	for i := 0; i < m; i++ {
		sc.Scan()
		l, _ := strconv.Atoi(sc.Text())
		if l > lMax {
			lMax = l
		}
		sc.Scan()
		r, _ := strconv.Atoi(sc.Text())
		if r < rMin {
			rMin = r
		}
	}

	v := rMin - lMax + 1
	if v < 0 {
		v = 0
	}
	if v < n {
		fmt.Println(v)
	} else {
		fmt.Println(n)
	}
}


Measured memory_bytes: 1792
<?php
/**
 * ABC120
 * C - Unification
 */

// $s = trim(fgets(STDIN));
// fscanf(STDIN, "%d %d", $a, $b);
// $n = array_map('intval', explode(' ', trim(fgets(STDIN))));

$S = trim(fgets(STDIN));

$strlen = strlen($S);
$count_0 = $count_1 = 0;
for ($i = 0; $i < $strlen; $i++) {
    if ($S[$i] === '0') $count_0++;
    else $count_1++;
}

echo min($count_0, $count_1) * 2, PHP_EOL;


Measured memory_bytes: 4604
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

# GCD
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x

def main():
  n,x=LI()
  l=LI()

  b=abs(l[0]-x)
  for a in l[1:]:
    b=gcd(b,abs(a-x))

  return b

print(main())


Measured memory_bytes: 16508
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;


int main()
{
	int N, K;
	string S;
	cin >> N >> K >> S;

	auto inv = 0;
	for (auto i = 1; i < S.length(); ++i)
	{
		if (S[i] != S[i - 1])
		{
			++inv;
		}
	}

	cout << N - 1 - max(inv - 2 * K, 0) << endl;

	return 0;
}

Measured memory_bytes: 512
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  int maxi = max({a,b,c});
  maxi *= pow(2,k);
  cout << a + b + c + - max({a,b,c}) + maxi << endl;
  return 0;
}
//templete by private_yusuke

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

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define RREP(i, N) for (int i =(int)N-1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

int main(){
  int n,k;
  int sum=0;
  cin>>n>>k;
  int v[n+1];
  memset(v,0,sizeof(v));
  REP(i,k){
    int d;
    cin>>d;
    REP(j,d){
      int tmp;
      cin>>tmp;
      v[tmp]++;
    }
  }
  for(int i=1;i<=n;i++){
    if(v[i]==0){
      sum++;
    }
  }
  cout<<sum<<endl;
}

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

typedef long long ll;
const ll INF = 1LL<<60, MOD = 1e9 + 7;
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define all(v) (v).begin(), (v).end()
#define m_p make_pair

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n;
    cin >> n;
    double value;
    vector<ll> v(n);
    rep(i,n) cin >> v[i];
    sort(all(v));
    value = v[0];
    for(ll i=1;i<n;i++){
        value = (value+v[i])/2;
    }
    printf("%.5lf\n",value);
    return 0;
}

Measured memory_bytes: 256