akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		String d=scan.next().toLowerCase();
		String s=scan.next().toLowerCase();
		String c=s.substring(0, s.length()-1);
		if(d.equalsIgnoreCase(c)==true) {
			System.out.println("Yes");
		}
		else System.out.println("No");
		
		
	}

}


Measured memory_bytes: 35596
// https://atcoder.jp/contests/abl/submissions/17034149
#include <atcoder/all>
#include <bits/stdc++.h>

using namespace atcoder;
using namespace std;

const int SZ = 300005;
int mx(int a, int b) { return max(a, b); }
int e() { return 0; }

void solve() {
    int n, k;
    cin >> n >> k;
    // 1点更新、区間最大値を求めるセグ木を用いる。
    auto st = segtree<int, mx, e>(SZ);
    while (n--) {
        int x;
        cin >> x;
        // 過去に存在した x±k の座標に対する点の数の最大値を求める
        int me = st.prod(max(0, x - k), min(SZ, x + k + 1));
        // 現在のx座標に対して、過去の区間の長さの最大値+1をセット
        st.set(x, me + 1);
    }
    cout << st.all_prod() << endl;
}

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}

Measured memory_bytes: 8484
#include<bits/stdc++.h>
using namespace std;
int main()
{   
    int a,b,count=0;
    int x,y,i;
    cin>>a>>b;
    for(i=1;i<=1000;i++)
    {
        x=i*0.08;
        y=i*0.1;
        if((x==a)&&(y==b))
       { 
           cout<<i;
         break;
       }
       count++;
    }
    if(count==1000)
    cout<<-1;
}

Measured memory_bytes: 256
package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())

}

func main() {
	scanner.Split(bufio.ScanWords)

	for {
		a, err := nextInt()
		if err != nil {
			break
		}
		b, _ := nextInt()

		s := a + b
		nDigits := int(math.Log10(float64(s))) + 1
		fmt.Println(nDigits)
	}
}



Measured memory_bytes: 1068
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        int[] num = new int[3];
        for(int i=0; i<n; i++){
            int p = sc.nextInt();
            if(p <= a){
                num[0]++;
            }else if(p <= b){
                num[1]++;
            }else{
                num[2]++;
            }
        }

        System.out.println(Arrays.stream(num).min().getAsInt()
        );
    }
}

Measured memory_bytes: 27732
#![allow(unused_imports, unused_variables, dead_code)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;
use std::io::Write;

trait InputValue {
    fn parse(s: &str) -> Self;
}

fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

fn readvec<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

fn readlines<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
    }
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
            fn parse(s: &str) -> ($($t),*) {
                let mut tokens = s.split_whitespace();
                ($($t::parse(tokens.next().unwrap())),*)
            }
        }
    }
}
parse_tuple!(A, B);
parse_tuple!(A, B, C);

// ===

fn main() {
    let (h, w, d): (usize, usize, usize) = read();
    let mut a: Vec<Vec<usize>> = vec![];

    let mut x = vec![0 as i32; h*w];
    let mut y = vec![0 as i32; h*w];
    for i in 0..h {
        let a: Vec<usize> = readvec();
        for j in 0..w {
            x[a[j]-1] = j as i32;
            y[a[j]-1] = i as i32;
        }
    }

    let mut jump = vec![vec![]; d];
    for i in 0..d {
        let mut j = i;
        let mut cost = 0;
        jump[i].push(cost);
        while j+d < h*w {
            cost += (x[j+d] - x[j]).abs();
            cost += (y[j+d] - y[j]).abs();
            jump[i].push(cost);
            j += d;
        }
    }

    let q = read();
    for i in 0..q {
        let (l, r): (usize, usize) = read();
        let bucket = (l-1)%d;
        let li = (l-1)/d;
        let ri = (r-1)/d;
        println!("{}", jump[bucket][ri] - jump[bucket][li]);
    }
}

Measured memory_bytes: 10620
import java.util.*;
public class Main {
	public static void main(String[] args) { 
		Scanner scn = new Scanner(System.in);
		int a =scn.nextInt();
		int b =scn.nextInt();
		int ans=a-2*b;
		if(ans<0) {
			ans=0;
		}
		System.out.println(ans);
    }
}

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

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

signed main()
{
    int a,b,c; cin >> a >> b >> c;

    int ans;
    if ((a == b) && (b == c)) ans = 1;
    else if ((a != b) && (b != c) && (c != a)) ans = 3;
    else ans = 2;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.trim().split('\n');

while (line = lines.shift()) {
    const numbers = line.split(' ').map(Number);

    const shouldTerminate = numbers[0] === 0 && numbers[1] === 0;

    if (!shouldTerminate) {
    	if (numbers[0] - numbers[1] >= 0) {
    		const item = numbers[0];
			numbers[0] = numbers[1];
			numbers[1] = item;
    	}

	    const output = numbers;
	    // to here

	    console.log(output[0].toString(), output[1].toString());
	}
}



Measured memory_bytes: 19000
#include <stdio.h>
#include <stdlib.h>

int asc(const void *a, const void *b) {
  return *(long long int *)a - *(long long int *)b;
}


 
int main(void){
 
	int n,k,i,j;
	
  	scanf("%d %d",&n,&k);
  	
  	long long int h[n],tmp,ans;
  
  	for(i=0;i<n;i++){
    	scanf("%lld",&h[i]);
    }
  	
	qsort(h,n,sizeof(long long int),asc);
  
  	ans = h[k-1] - h[0];
 
	for(i=0;i<n-k+1;i++){
    	if(ans > (h[i+k-1] -h[i])){
          
        	ans = h[i+k-1] -h[i];
  
        }
      	if(ans == 0){
        	break;
        }
    }
  
  	printf("%lld",ans);
  
	return 0;
}


Measured memory_bytes: 1788
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
#include <chrono>

using namespace std;
#define     loop(n,i,a)     for(ll i=a;i<n;i++)
#define     loopR(n,i,a)    for(ll i=a-1;i>=n;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pii>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
template<typename T>void max_self(T &a,T b){a=max(a,b);}
template<typename T>void min_self(T &a,T b){a=min(a,b);}
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightI[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightJ[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=3e5+10,oo=0x3f3f3f3f,MOD=998244353;
const long double PI = acos(-1),eps=1.0e-14;

void solve(){
    int x,t;
    cin>>x>>t;
    cout<<max(x-t,0);
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();

}


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

int main() {
    int h, w, d;
    cin >> h >> w >> d;
    int a[h][w];
    map <int, pair <int, int>> numToPos;
    rep (i, h) rep (j, w) cin >> a[i][j], numToPos[a[i][j]] = make_pair(i, j);

    vector <int> dp(h * w + 1, 0);
    range (i, d, h * w + 1) dp[i] = abs(numToPos[i].first - numToPos[i - d].first)
                                  + abs(numToPos[i].second - numToPos[i - d].second);
    rep (i, h * w + 1 - d) dp[i + d] += dp[i];

    int q;
    cin >> q;
    while(q--) {
        int l, r;
        cin >> l >> r;
        cout << dp[r] - dp[l] << endl;
    }

    return 0;
}

Measured memory_bytes: 9472
const config = {
    input: '/dev/stdin',
    newline: '\n'
};

const line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);

const list = line[1].split(' ').map(x => parseInt(x));

const partition = arr => {
    const x = arr[arr.length-1];
    const result = [...arr];
    let i = -1;
    for (let j = 0; j < arr.length - 1; j++) {
        if (result[j] <= x) {
            i++;
            const tmp = result[i];
            result[i] = result[j];
            result[j] = tmp;
        }
    }
    const tmp = result[i+1];
    result[i+1] = result[arr.length-1];
    result[arr.length-1] = tmp;

    return [i+1, result];
}

const res = partition(list);

console.log(res[1].map((x, i) => i === res[0] ? `[${x}]` : x.toString()).join(' '));



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

long long n;

//cur:現在, use:7 or 5 or 3, counter:答え
void dfs(long long cur, int use, long long &counter) {
    if (cur > n) return;
    if (use == 0b111) counter++;

    dfs(cur * 10 + 7, use | 0b001, counter);
    dfs(cur * 10 + 5, use | 0b010, counter);
    dfs(cur * 10 + 3, use | 0b100, counter);
}

int main() {
    cin >> n;
    long long res = 0;
    dfs(0, 0, res);
    cout << res << endl;
    return 0;
}

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

static const ull MOD = 1000000007LL;

int n;
char s[100005];
uint64_t dp[100005][13];

uint64_t solve () {
  int i, j, ki;
  uint64_t res = 0;

  scanf("%s", s);
  n = strlen(s);

  dp[0][0] = 1;
  for (i = 0; i < n; i++) {
    int c;
    if (s[i] == '?') c = -1;
    else c = s[i] - '0';

    for (j = 0; j < 10; j++) {
      if (c != -1 && c != j) continue;
      for (ki = 0; ki < 13; ki++) {
        dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki];
      }
    }
    for (j = 0; j < 13; j++) dp[i + 1][j] %= MOD;
  }
  res = dp[n][5];

  printf("%llu\n", res);
  return 0;
}

int main(){
  solve();
  return 0;
}

Measured memory_bytes: 10496
#include <numeric>
typedef long long ll;

#include <algorithm>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <iostream>
#include <queue>
#include <set>

using namespace std;

class UnionFind{
private:
  mutable vector<int> id;

  int getId(int i) const{
    if(i == id[i]) return i;
    id[i] = getId(id[i]);
    return id[i];
  }
public:
  mutable vector<int> s;
  UnionFind(int size = 0){ init(size); }
  ~UnionFind(){}
  void init(int size){
    id = vector<int>(size);
    s = vector<int>(size, 1);
    for(int i = 0; i < size; i++)
      id[i] = i;
  }
  void unite(int i, int j){
    int next = min( getId(i), getId(j) );
    if(next != getId(i)) s[next] += s[getId(i)];
    if(next != getId(j)) s[next] += s[getId(j)];
    id[getId(i)] = id[getId(j)] = next;
  }
  int size(int i){
    return s[getId(i)];
  }
  int operator [](int i) const{ return getId(i); }
};


int main(){
  const int n = getInt();
  const int m = getInt();

  vector<pair<int, int> > v(m);
  REP(i,m){
    v[i].first = getInt() - 1;
    v[i].second = getInt() - 1;
  }

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

  vector<ll> ans(m);

  UnionFind uf(n);
  REP(i,m){
    const int a = v[i].first;
    const int b = v[i].second;
    if(uf[a] != uf[b]){
      ans[i] = (ll)uf.size(a) * uf.size(b);
    }
    // printf("%d %d : %d %d : %d\n", uf[a], uf[b], uf.size(a), uf.size(b), ans[i]);
    uf.unite(a, b);
  }

  reverse(ans.begin(), ans.end());
  ll sum = 0;
  REP(i,m){
    sum += ans[i];
    printf("%lld\n", sum);
  }


  return 0;
}

Measured memory_bytes: 3712
#include <iostream>
#include<cstdio>
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

ll gcd(ll x, ll y) {
    if (y == 0) {
        return x;
    }
    return gcd(y, x % y);
}

int main() {
    auto a = 0;
    cin >> a;
    cout << a + (a * a) + (a * a * a);

    return 0;
}

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define int long long

typedef pair<int, int> ii;
const int mod = 1e9 + 7;

const int N = 1e3 + 5;

int h, w, dp[N][N];
char a[N][N];

signed main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> h >> w;
    for(int i = 1; i <= h; i++) {
        for(int j = 1; j <= w; j++)
            cin >> a[i][j];
    }
    dp[1][1] = 1;
    for(int i = 1; i <= h; i++) {
        for(int j = 1; j <= w; j++) {
            if(a[i][j + 1] == '.')
                dp[i][j + 1] = (dp[i][j + 1] + dp[i][j]) % mod;
            if(a[i + 1][j] == '.')
                dp[i + 1][j] = (dp[i + 1][j] + dp[i][j]) % mod;
        }
    }
    cout << dp[h][w];
}


Measured memory_bytes: 9088
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)*}
    };
}

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

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, usize1) => {
        read_value!($next, usize) - 1
    };

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

fn main(){

    input!{
        n: usize,
        p: [usize;n],
    }

    let mut flag: bool = true;
    let mut p_tmp:Vec<usize> = Vec::new();

    for &value in &p{
        p_tmp.push(value);
    }
    
    for i in 0..n-1{
        for j in i..n{
            p_tmp.swap(i,j);
            flag = true;
            for k in 0..n-1{
                if p_tmp[k+1] < p_tmp[k]{
                    flag = false;  
                    break;
                }
            }   
            if flag == true {
                println!("YES");
                return;
            }
            p_tmp.swap(j,i);
        }
    }

    if flag == false{
        println!("NO");
    }

}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define FOR0(i,n) for(ll i=0;i<n;i++)
#define FOR1(i,n) for(ll i=1;i<=n;i++)
#define FORl(i,l,n) for(int i=l;i<n;i++)
using namespace std;
#define pi pair<ll,ll>
#define pb push_back
#define ll long long
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define mst0(x) memset(x,0,sizeof(x));
#define vi vector<ll>
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define sp <<" "<<
#define intmax 1e14
ll power(ll num,ll g,ll mod){
  if(g==0)return 1;
  if(g%2==1)return (num*power((num*num)%mod,g/2,mod))%mod;
  return power((num*num)%mod,g/2,mod);
}

int main(){
	int n,k;
	cin>>n>>k;
	int a[n];
	FOR0(i,n) cin>>a[i];
	int dp[n];
	mst0(dp);
	dp[0] = 0, dp[1] = abs(a[1]-a[0]);
	int ans = INT_MAX;
	FORl(i,2,n) {
		ans = INT_MAX;
		for(int j = i-1; j>=max(0,i-k);j--){
			ans = min(ans,dp[j]+abs(a[j]-a[i]));
		}
		dp[i] = ans;
	}
	//FOR0(i,n) cout<<i sp dp[i] <<" ";
	//cout<<endl;
	cout<<dp[n-1];
}




Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pci pair<char, int>
#define pic pair<int, char>
#define plvl pair<long long, vector<long long> >
#define pcvc pair<char, vector<char> >
#define mod 1e9 + 7
#define newl "\n"

using namespace std;

ll gcd(ll a, ll b) {
	if(b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

template <typename T>
void show1(vector<T> dp) {
	for(auto d : dp) {
		cout << d << " ";
	}
	cout << "\n";
}

template <typename T>
void show2(vector<vector<T> > dp) {
	for(auto d : dp) {
		for(auto dd : d) {
			cout << dd << " ";
		}
		cout << "\n";
	}
}

void executeCode() {
	ll n, m;
	cin >> n >> m;
	ll ans = 0;
	if(n >= 2) {
		ans += (n * (n - 1)) / 2;
	}	
	if(m >= 2) {
		ans += (m * (m - 1)) / 2;
	}
	cout << ans << newl;
}

int main() {
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
	int tt = 1;
	// cin >> tt;
	for(ll i = 1; i <= tt ; i++) {
	//	cout << "Case #" << i << ": ";
		executeCode();	
	}
	return 0;
}

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

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Unstoppable solver = new Unstoppable();
	//	int t=in.nextInt();
	//	while(t-->0)
        solver.solve(in, out);
        out.close();
    }
 
    static class Unstoppable {
        public void solve(InputReader in, PrintWriter out) {
          int n=in.nextInt();
          long ans=(n/500)*1000;
          n=n%500;
          ans+=(n/5)*5;
          out.println(ans);
        }
 
    }

 
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
 
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
 
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public long nextLong(){
            return Long.parseLong(next());
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
 
    }
}
 

Measured memory_bytes: 23380
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll n,m;
    scanf("%lld %lld",&n,&m);
    ll arr[n+1],ans=n;
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&arr[i]);
        m-=arr[i];
    }
    sort(arr,arr+n);
    ans+=(m/arr[0]);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int a=0,temp;
    rep(i,10){cin>>temp;a+=temp;}
    cout<<a<<endl;
}

Measured memory_bytes: 3064
a = list(map(int,input().split()))
N = a[0]
K = a[1]
ans = 0
for i in range(K+1, N+1):
    #a%i>=kとなるパターン数
    ans += (N // i)*(i - K) #p*i<= x < (p+1)i の中にはi-K個だけあまりがK以上のものが存在
    ans += max(0, (N % i) - max(0,(K-1))) #iの倍数までは判定が終了。よって判定すべきなのはpi+1, pi+2,..., pi+(N%i)
print(str(ans))

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

int main() {
  vector<pair<int, int>> food(5);
  for (int i = 0; i < 5; i++) {
    int f;
    cin >> f;
    food.at(i) = make_pair(f%10, f);
  }
  
  sort(food.begin(), food.end());
  
  int t = 0;
  
  for (int i = 0; i < 5; i++) {
    if (food.at(i).first == 0) {
      t += food.at(i).second;
    }
    else {
      t += food.at(i).second;
      for (int j = i + 1; j < 5; j++) {
        t = t + food.at(j).second - food.at(j).first + 10;
      }
      break;
    }
  }
  cout << t << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define pb push_back
#define rl "\n"
#define ll long long
#define x first
#define y second
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int k;cin>>k;
    while(k--)
    {
    	cout<<"ACL";
    }
    
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef vector<int> vei;
typedef vector<string> ves;
typedef vector<vector<int>> ve_vei;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define fs first
#define sc second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
 
int main() {
	//cout.precision(10);
	cin.tie(0);
	ios::sync_with_stdio(false);
    int N; cin >> N;
    ves s(N);
    int p = 0,w = 0,g = 0,y = 0;
    rep(i,N) {
        cin >> s[i];
        if (s[i] == "P") p++;
        if (s[i] == "W") w++;
        if (s[i] == "G") g++;
        if (s[i] == "Y") y++;
    }
    int cnt = 0;
    if (p > 0) cnt++;
    if (w > 0) cnt++;
    if (g > 0) cnt++;
    if (y > 0) cnt++;
    
    if(cnt == 3) cout << "Three" << endl;
    if(cnt == 4) cout << "Four" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>                                                                              
using namespace std;                                                                                  
using ll = long long;                                                                                 
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }               
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }               
                                                                                                      
int main() {                                                                                          
  int n;                                                                                              
  cin >> n;                                                                                           
  vector<int> x(n);                                                                                   
  for (int i=0; i<n; i++) {                                                                           
    cin >> x[i];                                                                                      
  }                                                                                                   
  int minH = INT_MAX;                                                                                 
  for (int p=1; p<=100; p++) {                                                                        
    int sum = 0;                                                                                      
    for (int i=0; i<n; i++) {                                                                         
      sum += (x[i] - p) * (x[i] - p);                                                                 
    }                                                                                                 
    chmin(minH, sum);                                                                                 
  }                                                                                                   
                                                                                                      
  cout << minH << endl;                                                                               
                                                                                                      
  return 0;                                                                                           
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace ALDS1_2_A{
    class Sample{
        static void Main(string[] args){
			int col = int.Parse(Console.ReadLine());
			int[] nums = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
			Bubble(col, nums);
        }

        static void Bubble(int N, int[] nums){
			int exchange = 0;
            bool flag = true;
			while(flag){
				flag=false;
				for(int j=nums.Length-1; j>=1; j--){
					if(nums[j] < nums[j-1]){
						int x = nums[j];
						nums[j] = nums[j-1];
						nums[j-1] = x;
						flag = true;
						exchange++;
					}
				}
			}
			int cnt=0;
			foreach(int x in nums){
				Console.Write(x);
				if(cnt == nums.Length-1){
					Console.WriteLine();
				} else {
					Console.Write(" ");
				}
				cnt++;
			}
			Console.WriteLine(exchange);
        }
    }
}


Measured memory_bytes: 18324
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e+18 + 10;

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

    ll value[N];
    ll weight[N];
    for (ll i = 0; i < N; i++)
    {
        cin >> weight[i] >> value[i];
    }

    vector<vector<ll>> dp(N + 10, vector<ll>(100000 + 10, INF));
    dp[0][0] = 0;

    for (ll i = 0; i < N; i++)
    {
        for (ll sum_v = 0; sum_v <= 100010; sum_v++)
        {
            if (sum_v >= value[i])
            {
                dp[i + 1][sum_v] = min(dp[i][sum_v], dp[i][sum_v - value[i]] + weight[i]);
            }
            else
            {
                dp[i + 1][sum_v] = dp[i][sum_v];
            }
        }
    }

    ll ans = 0;
    for (int i = 0; i < 100010; i++)
    {
        if (dp[N][i] <= W)
        {
            ans = i;
        }
    }

    cout << ans << endl;
    return 0;
}

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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define SORTG(v) sort(v.begin(),v.end(),greater<>())
#define SORT(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/3

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;

template<class T> void chmax(T& a, T b) {if(a<b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a>b){a=b;}}
void YesNo(int a) {if(a){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}}
void YESNO(int a) {if(a){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}}
void AorB(int a,string b,string c) {if(a){cout<<b<<endl;}else{cout<<c<<endl;}}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main(){start();
    Vs s={"AKIHABARA","AKIHABAR","AKIHABRA","AKIHABR","AKIHBARA","AKIHBAR","AKIHBRA","AKIHBR","KIHABARA","KIHABAR","KIHABRA","KIHABR","KIHBARA","KIHBAR","KIHBRA","KIHBR"};
    string t;
    cin>>t;
    REP(i,0,s.size()) if(t==s[i]){cout<<"YES"<<endl;return 0;}
    cout<<"NO"<<endl;
    return 0;
}



Measured memory_bytes: 256
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
			new BufferedReader(new InputStreamReader(System.in));

		while(true) {
			String[] input = br.readLine().split(" ");
			int a = Integer.parseInt(input[0]);
			int b = Integer.parseInt(input[2]);
			char op = input[1].charAt(0);

			if(op == '?')
				break;
			if(op == '+') {
				System.out.println(a + b);
			}
			if(op == '-') {
				System.out.println(a - b);
			}
			if(op == '*') {
				System.out.println(a * b);
			}
			if(op == '/') {
				System.out.println(a / b);
			}
		}
	}
}

Measured memory_bytes: 24372
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
using namespace std;
typedef long long int ll;

ll mod= 998244353;

ll power(ll a,ll b){
	ll res=1;
	a%=mod;
	while(b>0){
		if(b&1)res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res;
}

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	if(a[0]!=0){
		cout << 0 << endl;
		return 0;
	}
	sort(a.begin(),a.end());
	if(a[0]!=0||a[1]==0){
		cout << 0 << endl;
		return 0;
	}
	int now=1;
	ll ans=1;
	ll pre=1;
	for(int i=1;i<n;i++){
		if(now==a[i]){
			ll cnt=0;
			while(i<n&&now==a[i]){
				cnt++;
				i++;
			}
			i--;
			now++;
			ans*=power(pre,cnt);
			ans%=mod;
			pre=cnt;
		}
		else{
			cout << 0 << endl;
			return 0;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 640
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T>using vv = vector<vector<T>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 28, MOD = int(1e9) + 7; constexpr ll LINF = 1ll << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

int n; // 頂点数
vector<vector<pair<int, int>>> graph; // pair<cost,to>[from][i]
vector<ll> dist; // 最短距離[point]

bool bellman_ford(int start) {
    dist.resize(n, LINF);
    dist[start] = 0; // 始点の距離は0

    // 更新i回目
    for (int i = 0; i < n; ++i) {
        bool update = false; // お好みでどうぞ

        for (int v = 0; v < n; ++v) {
            // 既にたどり着いた(!=INF)頂点vについて
            if (dist[v] == LINF) continue;

            for (const pair<int, int>& e : graph[v]) {
                // 向かう頂点すべてのノードで更新できるか
                if (dist[v] + e.first < dist[e.second]) {
                    dist[e.second] = dist[v] + e.first;
                    update = true;

                    // n回目にも更新があるなら負の閉路
                    if (i == n - 1 && e.second == n - 1) return true;
                }
            }
        }
        if (!update) break;
    }
    return false;
}

int main() {
    int N, M;
    cin >> n >> M;
    graph.resize(n);
    rep(i, M) {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        graph[a].emplace_back(-c, b);
    }

    bool isClosed = bellman_ford(0);
    if (isClosed) write("inf");
    else write(-dist[n - 1]);
}

Measured memory_bytes: 384
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include <cinttypes>
#include <string.h>
#include <bits/stdc++.h>

#define countof(a) (sizeof(a)/sizeof(*a))

#define vi vector<int>
#define vvi vector<vector<int> >
#define pi pair<int,int>
#define fi first
#define se second

#define FOR(var, to)          for (register s64 var = 0; var < (s64)to; var++)
#define FROMTO(var, from, to) for (register s64 var = from; var <= (s64)to; var++)

#define INIT(var) FOR(i,countof(var)) var[i] = 0
#define INPUT(var) FOR(i,countof(var)) var[i] = ri()

#define SORT(v) qsort(v,countof(v),sizeof(*v),int_less)
#define SORTT(v) qsort(v,countof(v),sizeof(*v),int_greater)

#define MOD 1000000007
#define INF (1 << 30)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

using namespace std;

static inline int ri() {
  int a;
  scanf("%d", &a);
  return a;
}

static inline s64 rs64() {
  s64 a;
  scanf("%" SCNd64, &a);
  return a;
}

static inline void wi(int a) {
  printf("%d", a);
}

static inline void wu64(u64 a) {
  printf("%" PRIu64, a);
}

static inline void ws64(s64 a) {
  printf("%" PRId64, a);
}

int int_less(const void *a, const void *b) {
  return (*((const int*)a) - *((const int*)b));
}
int int_greater(const void *a, const void *b) {
  return (*((const int*)b) - *((const int*)a));
}

typedef struct {
    int x;
    int y;
    bool used;
} Point;

int x_less(const void *a, const void *b) {
  return (((const Point*)a)->x - ((const Point*)b)->x);
}
int y_greater(const void *a, const void *b) {
  return (((const Point*)b)->y - ((const Point*)a)->y);
}


int main() {
    int n = ri();
    string nn[n];
    FOR(i,n) cin >> nn[i];
    int m = ri();
    string mm[m];
    FOR(i,m) cin >> mm[i];
    
    set<string> strs;
    map<string, int> nums;
    
    FOR(i,n)
        strs.insert(nn[i]), nums[nn[i]]++;
    FOR(i,m)
        strs.insert(mm[i]), nums[mm[i]]--;
        
    int res = 0;
    for(auto& i : strs) {
        res = max(res, nums[i]);
    }
    cout << res << endl;    
 return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        StringBuilder sb = new StringBuilder();
        sb.append("2018/01/");
        sb.append(S.charAt(8));
        sb.append(S.charAt(9));
        String ans = sb.toString();
        System.out.println(ans);
    }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
// atoi : atoi(変数名.c_str())
// find(): int i = 変数名.find(“文字列”) 何番目にあるかを得る
// cout << (条件 ? "Yes" : "No") << endl;
// 降順 sort(a.begin(),a.end(),greater<int>());
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0; i<(int)(n);i++)

int main(){
  int x;
  cin >> x;
  cout << (x < 1200 ? "ABC" : "ARC") << endl;
}

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

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    int n;
    int x;
    int min;
    int m;

    cin >> n >> x;

    cin >> m;
    min = m;
    x = x - m;

    for (int i = 0; i < n-1; i++) {
        cin >> m;
        x = x - m;
        if (m < min) {
            min = m;
        }
    }

    if (x > 0) {
        n = n + (x / min);
    }

    cout << n << endl;

    return 0;
}

Measured memory_bytes: 3576
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define INF 9223372036854775807
#define MOD 1000000007
#define pb push_back
#define F first
#define S second
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<ll, ll> pll;
ll n = 0, m = 0, ans = 0, sum = 0, cnt = 0, tmp = 0;
string s;
bool flag;
#pragma endregion
#define MAX 111111



int main(void) {
  string a, b;
  a = '(';
  b = ')';
  cin >> n;
  cin >> s;
  FOR(i, 0, s.length()) {
	if (s[i] == ')') {
	  cnt--;
	}
	else {
	  cnt++;
	}
	if (cnt < 0) {
	  s = a + s;
	  cnt = 0;
	  i = -1;
	}
  }
  cnt = 0;
  RFOR(i, 0, s.length()) {
	if (s[i] == ')') {
	  cnt--;
	}
	else {
	  cnt++;
	}
	if (cnt > 0) {
	  s = s + b;
	  cnt = 0;
	  i = s.length();
	}
  }
  cout << s << endl;

  return 0;
}

Measured memory_bytes: 256
import java.io.PrintWriter

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = nextList().map(String::toInt)
fun nextLongList() = nextList().map(String::toLong)
fun nextDoubleList() = nextList().map(String::toDouble)

val pw = PrintWriter(System.out)
fun print(s: Any = "") = pw.print(s)
fun println(s: Any = "") = pw.println(s)

fun <T> Iterable<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)
fun <T> Array<T>.join(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "") = joinToString(separator, prefix, postfix)

fun main(args: Array<String>) {
    main()
    pw.flush()
}

fun main() {
    val (K, S) = nextIntList()
    var ans = 0
    for (x in 0..K) {
        for (y in 0..K) {
            val z = S - x - y
            if (z in 0..K) ans++
        }
    }
    println(ans)
}

Measured memory_bytes: 36004
#include<iostream>

using namespace std;

int main(void)
{
	string S;

	cin >> S;

	int r,i,tmp=0;

	r=S.size();

	for(i=0;i<r;i++)
	{
		if(i%2==0 && S[i]=='L')
			tmp=1;
		if(i%2==1 && S[i]=='R')
			tmp=1;

	}

	if(tmp==1)
		cout << "No" << endl;

	else
		cout << "Yes" << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int main(int argc, char* argv[]) {
    int n;
    int a,b;
    cin >> n;
    if(n==2){
        cin >> a >> b;
        cout << a+b << endl;
    }
    else{
        cout << "Hello World" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
def process(n, x):
    if n != 1:
        if n % 2 == 0:
            x += 1
            return process(n//2, x)
        else:
            x += 1
            return process(n*3+1, x)
    else:
        return x

while True:
    n = int(input())
    if n == 0: break
    print(process(n, 0))


Measured memory_bytes: 5608
#pragma G++ optimize (2)
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <queue>
#define INF 0x3f3f3f3f
#define NO 30005
#define MO 100005
typedef long long ll;
using namespace std;
inline ll read()
{
	char ch = ' ', last;
	ll ans = 0;
	while (ch < '0' || ch > '9')
		last = ch, ch = getchar();
	while (ch >= '0' && ch <= '9')
		ans = ans * 10 + int(ch - '0'), ch = getchar();
	if (last == '-')
		return -ans;
	return ans;
}
void write(ll x)
{
	if (x >= 10)
		write(x / 10);
	putchar(x % 10 + '0');
}
//head

int n;
double ans;
//variable

void init()
{
	n = read();
}
//functions

int main()
{
	init();
	for (int i = 1; i <= n; i++)
	{
		double k;
		string x;
		cin >> k >> x;
		if (x == "JPY")
			ans += k;
		else
			ans += k * 380000;
	}
	cout << ans << endl;
	return 0;
}
//main


Measured memory_bytes: 256
(n,m),*e=[[*map(int, t.split())] for t in open(0)]
t=[[]for _ in range(n+1)]
for a,b in e:t[a]+=[b];t[b]+=[a]
q=[1]
a=[0]*-~n
while q:q=[a[j]==0and(a.__setitem__(j,i)or j)for i in q for j in t[i]]
print('Yes',*a[2:])


Measured memory_bytes: 59956
import java.util.Scanner;

public class Main {
    static int n;
    static long x;
    static long[][] dp;
    static long[] a;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        x = sc.nextInt();
        a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        dp = new long[n][n];
        for (int i = 0; i < n; i++) {
            dp[0][i] = a[i];
        }
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < n; j++) {
                dp[i][j] = Math.min(dp[i-1][(n+j-1)%n], dp[i-1][j]);
            }
        }

        long ret = Long.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            long sum = 0;
            for (int j = 0; j < n; j++) {
                sum += dp[i][j];
            }
            ret = Math.min(ret, sum+x*i);
        }

        System.out.println(ret);
    }
}


Measured memory_bytes: 82528
import collections

n = int(input())
l_a = list(map(int, input().split()))
col = collections.Counter(l_a)
bef = sum(l_a)
q = int(input())
ans = []
for _ in range(q) :
    b, c = map(int, input().split())
    bef += (c - b)*col[b]
    ans.append(bef)
    col[c] += col[b]
    col[b] = 0

for value in ans :
    print(value)


Measured memory_bytes: 27112
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>
#include<queue>
#include<stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用

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

	int n;
	cin >> n;
	vector<pair<string, pair<int,int>>> s(n);
	rep(i, n)
	{
		cin >> s[i].first >> s[i].second.first;
		s[i].second.first = 100 - s[i].second.first;
		s[i].second.second = i + 1;
	}

	sort(s.begin(), s.end());
	rep(i, n)
	{
		cout << s[i].second.second << endl;
	}

}

Measured memory_bytes: 256
s = input()

if s == "SUN":
  print(7)
elif s =="SAT":
  print(1)
elif s =="FRI":
  print(2)
elif s =="THU":
  print(3)
elif s =="WED":
  print(4)
elif s =="TUE":
  print(5)
elif s =="MON":
  print(6)

  
#SUN,MON,TUE,WED,THU,FRI,SAT

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

int main(){
    int i,n,maxkane=0;
    cin >> n;
    vector<int> a(n+2,0);
    for(i=1;i<=n;i++){
        cin >> a.at(i);
        maxkane += abs(a.at(i)-a.at(i-1));
    }
    maxkane += abs(a.at(n+1)-a.at(n));
    for(i=1;i<=n;i++){
        int ans=maxkane;
        ans = ans-abs(a.at(i)-a.at(i-1))-abs(a.at(i+1)-a.at(i))+abs(a.at(i+1)-a.at(i-1));
        cout << ans << endl;
    }
    return 0;
}

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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#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 loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

vector<int>color;
vector<vector<pii>>g;

void dfs(int root, int p, int c) {
	int cnt = 1;
	for (auto e : g[root]) {
		int d = e.first;
		int id = e.second;
		if (d == p)continue;
		if (cnt == c)cnt++;
		color[id] = cnt;
		dfs(d, root, cnt);
		cnt++;
	}
}

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int N; cin >> N;
	vector<int>a(N - 1), b(N - 1); rep(i, 0, N - 1) { cin >> a[i] >> b[i]; a[i]--, b[i]--; }
	color.resize(N - 1, -1);
	g.resize(N);

	rep(i, 0, N - 1) {
		g[a[i]].eb(b[i], i);
		g[b[i]].eb(a[i], i);
	}
	dfs(0, -1, 0);
	int M = *max_element(all(color));
	cout << M << endl;
	rep(i, 0, N - 1) {
		cout << color[i] << endl;
	}


	return 0;
}


Measured memory_bytes: 10752
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
bool test(const vector<Int> &A, int prime)
{
    vector<Int> B = A;
    for (int i = B.size()-1; i >= 0; i--) {
        if (i >= prime) B[i - prime + 1] += B[i];
        else if (B[i] % prime != 0) return false;
    }
    return true;
}
void factors(Int x, vector<int>& P)
{
    if (x < 0) x *= -1;
    if (x == 0) return;
    for (Int i = 2; i*i <= x; i++) {
        if (x % i == 0) P.push_back(i);
        while (x % i == 0) x /= i;
    }
    if (x != 1) P.push_back(x);
}
vector<int> sieve(int x) // { p | p is prime, p <= x }
{
    vector<bool> B(max(2, x+1));
    B[0] = B[1] = true;
    for (int i = 2; i*i <= x; i++) {
        if (B[i]) continue;
        for (int j = i + i; j <= x; j += i) {
            B[j] = true;
        }
    }
    vector<int> ans;
    for (int i = 0; i <= x; i++) if (!B[i]) ans.push_back(i);
    return ans;
}
int main()
{
    int N; cin >> N;
    vector<Int> A(N+1); for (int i = N; i >= 0; i--) cin >> A[i];
    vector<int> primes = sieve(N);
    factors(A[N], primes);
    sort(begin(primes), end(primes));
    primes.erase(unique(begin(primes), end(primes)), end(primes));
    for (auto p : primes) if (test(A, p)) cout << p << '\n';
    return 0;
}


Measured memory_bytes: 384