akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>

struct count {
	int cnt;
	char moji;
};

int main() {
	int N, K, i, j, max = 0, sum = 0, k;
	char S[100001];
	struct count c[100000];

	memset(c, 0, sizeof(c));

	scanf("%d %d", &N, &K);
	scanf("%s", S);

	i = 0;
	j = 0;
	while (i < N) {
		c[j].moji = S[i];
		do {
			c[j].cnt++;
			i++;
		} while (i < N && c[j].moji == S[i]);
		j++;
	}
	
	k = K;
	for (i = 0; i < j && k > 0; i++) {
		if (c[i].moji == '0') k--;
		sum += c[i].cnt;
	}

	if (i == j) {
		printf("%d", sum);
		return 0;
	}
	
	sum += c[i].cnt;
	max = sum;
	if (i >= K * 2) sum -= c[i - K * 2].cnt;
	sum -= c[i - K * 2 + 1].cnt;

	for (i = i + 1; i < N; i++) {
		sum += c[i].cnt;
		if (++i < N) sum += c[i].cnt;
		if (sum > max) max = sum;
		sum -= c[i - K * 2].cnt;
		sum -= c[i - K * 2 + 1].cnt;
	}

	printf("%d", max);

	return 0;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

int main() {
	string str;
	char a;
	while(cin >> a){
		int last = str.size() - 1;
		if(last >= 0 && str[last] == 'S' && a == 'T'){
			str.erase(last, 1);
		}else{
			str += a;
		}
	}

	while(true){
		int index = str.find("ST");
		if(index == -1) break;
		str.erase(index, 2);
	}
	cout << str.size() << endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> P;
typedef string str;
typedef vector<P> vp;
typedef vector<string> vs;
typedef vector<bool> vb;

const ll mod=1e9+7;
const ll inf=1e16;

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m-1;i>=n;i--)
#define fi first
#define se second
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define eb(x) emplace_back(x)
#define pb(x) pop_back(x)
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define sum(x) accumulate(all(x),0)
#define pc(x) __builtin_popcount(x)
#define gll greater<ll>()

void solve(){
  string s,t,u;
  cin >> s >> t >> u;
  cout << s[0] << t[0] << u[0] << endl;
}

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

Measured memory_bytes: 3544
#include<iostream>
using namespace std;
int main(){

	int N=0;
	int a[100];
	
	int hozon=0;
	
	int i=0;
	int c=0;

        cin>>N;
	for(i=0;i<N;i++){
		cin>>a[i];
        }
	
	for(i=0;i<N;i++){
	
		for(c=0;c<N-1;c++){
			if(a[c]<a[c+1]){
				hozon=a[c];
				a[c]=a[c+1];
				a[c+1]=hozon;
			}
		}
	
	}

	cout<<a[0]-a[N-1];


}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    private static void solve() {
        final Scanner scanner = new Scanner(System.in);

        while (true) {
            final int n = scanner.nextInt();
            if (n == 0) {
                break;
            }
            final String[] names = new String[n];
            final boolean[][] table = new boolean[n][30];
            final int[] sum = new int[30];
            for (int i = 0; i < n; i++) {
                names[i] = scanner.next();
                final int m = scanner.nextInt();
                for (int j = 0; j < m; j++) {
                    final int d = scanner.nextInt();
                    table[i][d] = true;
                    sum[d]++;
                }
            }
            int minimum = Integer.MAX_VALUE;
            int minIndex = -1;
            for (int i = 0; i < n; i++) {
                int score = 0;
                for (int j = 0; j < table[i].length; j++) {
                    if (table[i][j]) {
                        score += n - sum[j] + 1;
                    }
                }
                if (score < minimum) {
                    minimum = score;
                    minIndex = i;
                } else if (score == minimum && names[i].compareTo(names[minIndex]) < 0) {
                    minimum = score;
                    minIndex = i;
                }
            }
            System.out.println(String.format("%d %s", minimum, names[minIndex]));
        }
    }

    public static void main(String... args) {
        solve();
    }
}

Measured memory_bytes: 12000
#include <algorithm>
#include <cstdint>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>

using namespace std;

using lint=int64_t;
using uint=uint32_t;
using ulint=uint64_t;

template<class T>
using vector2d=vector<vector<T>>;

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

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

template <class T>
void OutVec(const vector<T>& vec){
  for(int i = 0; i < vec.size() - 1; ++i){
    cout<<vec[i]<<" ";
  }
  cout<<vec.back()<<endl;
}

template <class T>
void OutVec2d(const vector2d<T>& vec){
  for(auto v:vec){
    OutVec(v);
  }
}

int main(){
  cout << std::fixed << std::setprecision(16);
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  std::sort(a.begin(), a.end());
  for(int i=0;i<n-1;i++){
    if(a[i]==a[i+1]){
      cout<<"NO"<<endl;
      return 0;
    }
  }
  cout<<"YES"<<endl;


  return 0;
}




Measured memory_bytes: 1024
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
        int k = in.nextInt();
      
        int[] arr = new int[n];
      for(int i=0;i<arr.length;i++){
          arr[i]=in.nextInt();
      }
      
      int[] dp = new int[n];
      Arrays.fill(dp, Integer.MAX_VALUE);
      dp[0]=0;
      dp[1]=Math.abs(arr[1]-arr[0]);
      
		for(int i=2;i<n;i++){
          for(int j=1;j<=k;j++){
            if(i>=j){
                 dp[i]=Math.min(dp[i], Math.abs(arr[i]-arr[i-j])+dp[i-j]);
            }
          }
        }
      
      
      
      System.out.print(dp[n-1]);
      
      
	}
}

Measured memory_bytes: 51036
from collections import Counter

N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]
sl = Counter(s)
tl = Counter(t)
ans = [0]

for i in range(len(sl)):
    if list(sl)[i] in tl:
        ans.append(sl[list(sl)[i]] - tl[list(sl)[i]])
    else:
        ans.append(sl[list(sl)[i]])

print(max(ans))

Measured memory_bytes: 3316
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(in.readLine());
        int H = Integer.parseInt(st.nextToken());
        int W = Integer.parseInt(st.nextToken());
        int K = Integer.parseInt(st.nextToken());
        String[] board = new String[H];
        for (int h = 0; h < H; h++) {
            board[h] = in.readLine();
        }
        int[] C = new int[W];
        int[] R = new int[H];
        int total = 0;
        for (int r = 0; r < H; r++) {
            for (int c = 0; c < W; c++) {
                char ch = board[r].charAt(c);
                if (ch == '#') {
                    total++;
                    C[c]++;
                    R[r]++;
                }
            }
        }

        int ans = 0;
        for (int maskR = 0; maskR < 1<<H; maskR++) {
            for (int maskC = 0; maskC < 1<<W; maskC++) {
                if (valid(maskR, maskC, total, K, R, C, board)) {
                    ++ ans;
                }
            }
        }

        System.out.println(ans);
    }

    static boolean valid(int maskR, int maskC, int total, int k, int[] R, int[] C, String[] board) {
        int c = 0;
        ArrayList<Integer> rows = new ArrayList<>();
        for (int bit = 0; bit < 6; bit++) {
            if ((maskR & (1<<bit)) != 0) {
                c += R[bit];
                rows.add(bit);
            }
        }
        ArrayList<Integer> cols = new ArrayList<>();
        for (int bit = 0; bit < 6; bit++) {
            if ((maskC & (1<<bit)) != 0) {
                c += C[bit];
                cols.add(bit);
            }
        }
        for (int i = 0; i < rows.size(); i++) {
            for (int j = 0; j < cols.size(); j++) {
                int row = rows.get(i);
                int col = cols.get(j);
                if (board[row].charAt(col) == '#') --c;
            }
        }
        return (total - c) == k;
    }

}


Measured memory_bytes: 35852
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
bool climb(vector<pair<int,int>> vec){
    int minlayer=0,nowlayer=0;
    for(auto P:vec){
        minlayer=nowlayer+P.first;
        nowlayer+=P.second;
        if(minlayer<0){
            return false;
        }
    }
    return true;
}
void Main(){
    ll n;cin>>n;
    ll bk=0;
    vector<string> s(n);
    vector<pair<int,int>> left,right;
    For(i,0,n){
        cin >> s[i];
        int p=0,q=0;
        For(j,0,s[i].size()){
            if(s[i][j]=='(') {
                p++;
            }
            else if(s[i][j]==')') {
                p--;
            }
            q=min(p,q);
        }
        bk+=p;
        if(p>0){
            left.emplace_back(q,p);
        }
        else{
            right.emplace_back(q-p,-p);
        }
    }
    sort(right.rbegin(),right.rend());
    sort(left.rbegin(),left.rend());
    if(bk==0 && climb(left) && climb(right)) cout << "Yes" << endl;
    else cout << "No" << endl;
}
int main(){
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

Measured memory_bytes: 49988
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	} 
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	k := scanInt()

	fmt.Fprintln(wr, min(n%k,k-n%k))
}


Measured memory_bytes: 640
#include <iostream>
#include <set>
#include <vector>

using namespace std;
typedef long long ll;
int main(int argc, const char * argv[]) {
  int N, T;
  cin >> N >> T;
  
  ll t[N];
  for (int i = 0; i < N; i++) {
    cin >> t[i];
  }

  vector<pair<ll,ll> > vec;
  vec.push_back({t[0], t[0] + T});
  for (int i = 1; i < N; i++) {
    if (t[i] - t[i - 1] < T) {
      vec.back().second = t[i] + T;
    } else {
        vec.push_back({t[i], t[i] + T});
    }
  }

  ll sum = 0;
  for (auto itr = vec.begin(); itr != vec.end(); itr++) {
    sum += (itr->second - itr->first);
  }
  cout << sum << endl;
  
  return 0;
}


Measured memory_bytes: 6256
use whiteread::parse_line;

fn main() {
    let (a, b, x): (f64, f64, f64) = parse_line().unwrap();
    println!("{}", search(x, a, b) / std::f64::consts::PI * 180.0)
}

fn search(x: f64, a: f64, b: f64) -> f64 {
    let mut max = std::f64::consts::FRAC_PI_2;
    let mut min = 0.0;
    for _ in 1..10000 {
        let mid = (min + max) / 2.0;
        if volume(a, b, mid) < x {
            max = mid
        } else {
            min = mid
        }
    }
    max
}
fn volume(a: f64, b: f64, theta: f64) -> f64 {
    let h = b * (std::f64::consts::FRAC_PI_2 - theta).tan();
    if h <= a {
        a * b * h / 2.0
    } else {
        let res = a * a * theta.tan() / 2.0;
        a * (a * b - res)
    }
}


Measured memory_bytes: 3060
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>

using namespace std;
#define MAXN 100005
#define MAXM 500005
#define INF 0x7fffffff
#define ll long long

int A[MAXN];
inline int read(){
	int x=0,f=1;
	char c=getchar();
	for(;!isdigit(c);c=getchar())
		if(c=='-')
			f=-1;
	for(;isdigit(c);c=getchar())
		x=x*10+c-'0';
	return x*f;
}

int main(){
	int N=read(),ans=0;
	for(int i=1;i<=2*N;i++)
		A[i]=read();
	sort(A+1,A+1+2*N);
	for(int i=1;i<=2*N;i+=2)
		ans+=A[i];
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

using namespace std;

int main() {
    

    long long k,a,b;
    cin >> k >> a >> b;
    if(a <= b){
        if(k <= a){
            cout << 1 << endl;
        }else{
            cout << -1 << endl;
        }
    }else{
        if( k<=a){
            cout << 1 << endl;
        }
        else if((k-a)%(a-b) == 0){
            cout << 2 * ((k-a) / (a-b)) + 1 << endl;
        }else{
            cout << 2 * ((k-a) / (a-b) + 1) + 1 << endl;
        }

    }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

static int gcd(int x, int y) {
  if (x == 1 || y == 1) {
    return 1;
  }
  int amari = 0;
  if (x >= y) {
    amari = x % y;
    if (amari == 0) {
      return y;
    } else {
      return gcd(y, amari);
    }
  } else {
    amari = y % x;
    if (amari == 0) {
      return x;
    } else {
      return gcd(x, amari);
    }
  }
}

int main() {
  int x, y;

  cin >> x >> y;
  cout << gcd(x, y) << endl;

  return 0;
}



Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
int n,m,i,j,d,k,a,c,h;
string s;
int main()
{
  for(cin>>h>>n;i<n;i++){
    cin>>a;c+=a;
    if(c>=h)return cout<<"Yes",0;
  }
  cout<<"No";
}

Measured memory_bytes: 256
from collections import deque, Counter as cnt
from collections import defaultdict as dd
from operator import itemgetter as ig
from bisect import bisect_right as bsr
from math import factorial, ceil, floor
import sys
sys.setrecursionlimit(1000000)

# お約束
args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def nlist(n, v):
    if not n:
        return [] if type(v) is list else v
    return [nlist(n[1:], v) for _ in range(n[0])]


def yesno(v, yes="Yes", no="No", upper=False):
    if upper:
        print([yes.upper(), no.upper()][not v])
    else:
        print([yes, no][not v])


def main():
    """エントリーポイント"""
    A, B = input(str, str)
    print(sorted([A * int(B), B * int(A)])[0])


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()


Measured memory_bytes: 3316
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include"bits/stdc++.h"
using namespace std;
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define int long long
#define ends ' '
#define endl '\n'
#define pb emplace_back
#define x first
#define y second
#define pii pair<int, int>
#define sz(x) (int)(x).size()

int32_t main()
{
	// #ifndef ONLINE_JUDGE
	// 	freopen("input.txt", "r", stdin);
	// 	freopen("output.txt", "w", stdout);
	// #endif
	IOS;

	int u, v;
	cin >> u >> v;

	cout << u*v/__gcd(u, v);

	return 0;
}

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

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

    int count = 0;
   rep(i, s.size()) {
      if (s[i] == t[i]) count++;
   }

   cout << count << endl;
}

Measured memory_bytes: 256
use std::io;
use std::str::FromStr;

fn input_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}


fn main() {
    let (_, m) = input_tuple();
    let mut min = 0u64;
    let mut max = std::u64::MAX;
    for _ in 0..m {
        let (a, b) = input_tuple();
        if a > min {
            min = a;
        }
        if b < max {
            max = b;
        }
    }
    if min > max {
        println!("0");
        return;
    }
    println!("{}", max - min + 1);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int64_t n;
  cin>>n;
  std::vector<int64_t> a(n),b(n);
  for (int i = 0; i < n; ++i)
  {
    cin>>a[i]>>b[i];
  }
  int64_t cnt=0;
  for (int i = n-1; i >= 0; --i)
  {
    a[i]+=cnt;
    if(a[i]%b[i]!=0){
      cnt+=b[i]-a[i]%b[i];
    }
    else continue;
  }
  cout<<cnt;
}

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

int n;
char s[100001] = {}, a[100001] = {}; // a -> animals; s -> answers
string ans;

bool solve(char x, char y){
	a[1] = x;
	a[2] = y;
	bool p, q;
	for(int i = 2; i <= n-1; i++)
		a[i] == 'S'?
			s[i] == 'o' ? a[i+1] = a[i-1] :
				a[i-1] == 'S' ? a[i+1] = 'W' : a[i+1] = 'S' :
			s[i] == 'x' ? a[i+1] = a[i-1] :
				a[i-1] == 'S' ? a[i+1] = 'W' : a[i+1] = 'S';
	p = a[n] == 'S' ?
		s[n] == 'o' ?
			a[n-1] == a[1] ? true : false : 
		a[n-1] != a[1] ? true : false : 
		// a[n] == 'W'
		s[n] == 'o' ?
			a[n-1] == a[1] ? false : true : 
		a[n-1] != a[1] ? false : true ;
	q = a[1] == 'S' ?
		s[1] == 'o' ?
			a[n] == a[2] ? true : false : 
		a[n] != a[2] ? true : false : 
		// a[n] == 'W'
		s[1] == 'o' ?
			a[n] == a[2] ? false : true : 
		a[n] != a[2] ? false : true ;
	return p && q;
	
	
}

int main() {
	cin >> n;
	for(int h = 1; h <= n; h++) a[h] = '_';
	for(int i = 1; i <= n; i++){
		cin >> s[i];
	}
	
	if(solve('S', 'S')){
		for(int k = 1; k <= n; k++) cout << a[k];
		cout << endl;
	} else if(solve('S', 'W')){
		for(int k = 1; k <= n; k++) cout << a[k];
		cout << endl;
	} else if(solve('W', 'S')){
		for(int k = 1; k <= n; k++) cout << a[k];
		cout << endl;
	} else if(solve('W', 'W')){
		for(int k = 1; k <= n; k++) cout << a[k];
		cout << endl;
	} else cout << "-1" << endl;
	
	return 0;
}

Measured memory_bytes: 512
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

string s;
int p;
int at(int x) {
  return x < sz(s) ? s[x] : -1;
}
pii Min(pii a,pii b) {
  return pii(min(a.fi,b.fi),min(a.se,b.se));
}
pii Max(pii a,pii b) {
  return pii(max(a.fi,b.fi),max(a.se,b.se));
}

pii parse() {
  if(at(p) == '_' || at(p) == '^') {
    int type = at(p) == '_';
    ++p;
    ++p;
    pii a = parse();
    ++p;
    pii b = parse();
    ++p;
    return type ? Min(a , b) : Max(a , b);
  } else if(at(p) >= '0' && at(p) <= '9') {
    ++p;
    if(at(p) >= '0' && at(p) <= '9') {
      int t = at(p) - '0' + (at(p - 1) - '0') * 10;
      ++p;
      return mp(t,t);
    }
    if(at(p - 1) == '0' || at(p) != -1) {
      int t = at(p - 1) - '0';
      return mp(t,t);
    }
    int t = at(p - 1) - '0';
    return mp(t , t * 10 + 9);
  }
  return pii(0,99);
}

int main(){
  int Q;
  cin >> Q;
  rep(i,0,Q) {
    string s;
    cin >> s;
    int l = 0 , r = sz(s);
    while(l + 1 < r) {
      int mid = (l + r) >> 1;
      p = 0;
      ::s = s.substr(0 , mid);
      pii t = parse();
      if(t.fi == t.se) r = mid;
      else l = mid;
    }
    p = 0;
    ::s = s;
    printf("%d %d\n",parse().fi,r);
  }
  return 0;
}


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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 1000000000000
#define MOD 1000000007
using ll = long long;
using Graph = vector<vector<int>>;

int main(){
  int n;
  cin>>n;
  double res = 0;
  rep(i,n){
    double x;
    string u;
    cin>>x>>u;
    if(u=="JPY")res+=x;
    else res+=380000*x;
  }
  cout<<setprecision(30)<<res<<endl;
  return 0;
}

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

int main(){
  char s[10], t[10];
  int a,b;
  char u[10];
  scanf("%s%s", s, t);
  scanf("%d%d", &a, &b);
  scanf("%s", u);
  if (strcmp(s,u) == 0){
    printf("%d %d\n", a-1, b);
  }else{
    printf("%d %d\n", a, b-1);
  }
  return 0;
}

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

int main() {
// int c11,c12,c13,c21,c22,c23;
//cin>>c11>>c12>>c13>>c21>>c22>>c23;
//  if(c11==c23&&c12==c22&&c13==c21){
  string r1,r2;
    cin>>r1>>r2;
      if(r1[0]==r2[2]&&r1[1]==r2[1]&&r1[2]==r2[0]){
  cout<<"YES";
      }
  else{
  cout<<"NO";
  }
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
const int MOD = 1000000007;

ll modFact[111111];
ll modInv[111111];
ll modFactInv[111111];

// calc nCr % mod
ll comb(int n, int r) {
  return modFact[n] * (modFactInv[r] * modFactInv[n - r] % MOD) % MOD;
}

int main() {
  modFact[0] = modFact[1] = 1;
  modFactInv[0] = modFactInv[1] = 1;
  modInv[1] = 1;
  REP (i, 2, 111111) {
    modFact[i] = modFact[i - 1] * i % MOD;
    modInv[i] = MOD - modInv[MOD % i] * (MOD / i) % MOD;
    modFactInv[i] = modFactInv[i - 1] * modInv[i] % MOD;
  }

  int N, M;
  cin >> N >> M;

  map<int, int> pCnts;
  int m = M;
  for (int i = 2; i * i <= M; i++) {
    while (m % i == 0) {
      m /= i;
      pCnts[i]++;
    }
  }
  if (m != 1) pCnts[m]++;

  ll ans = 1;
  for (auto pCnt : pCnts) {
    ans = (ans * comb(N - 1 + pCnt.S, N - 1)) % MOD;
  }

  cout << ans << endl;
}


Measured memory_bytes: 2816
s = list(input())

for _ in range(len(s)):
  if len(s) % 2 == 0:  
    s.pop()
    s.pop()
    if s[:(len(s))//2] == s[len(s)// 2:]:
      print(len(s))
      break
  else:
    s.pop()
    if s[:(len(s))//2] == s[len(s)// 2:]:
      print(len(s))
      break   

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
set<int> s;
int n,a,ans;
 
int main(){
  cin>>n;
  while(n--){
    cin>>a;
    if(s.find(a)==s.end()){
      ans++;
      s.insert(a);
    }
    set<int>::iterator ite=s.end();
    ite--;
    while(1){
      if(*ite>a)s.erase(*ite);
      else break;
      ite--;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 10564
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    x = int(input())
    ans = 0

    p, q = divmod(x, 500)
    ans += 1000 * p
    ans += q // 5 * 5

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <cstring>
#include <iostream>

using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int used[n + 1];
  memset(used, 0, sizeof(used));
  int ans = 0;
  while (k--) {
    int d;
    int temp;
    cin >> d;
    for (int i = 0; i < d; i++) {
      cin >> temp;
      if (used[temp] == 0) {
        ans++;
        used[temp] = 1;
      }
    }
  }
  cout << n - ans << endl;
}

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

using namespace std;

int main()
{
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  int tx = -100, ty = 100;
  for (int i = 0; i < n; i++)
  {
    int tmp;
    cin >> tmp;
    tx = max(tx, tmp);
  }
  for (int i = 0; i < m; i++)
  {
    int tmp;
    cin >> tmp;
    ty = min(ty, tmp);
  }
  if (ty > tx && x < ty && ty < y)
    cout << "No War" << endl;
  else
    cout << "War" << endl;

  return 0;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int n;
    cin>>n;
    vector<string> w(n);
    rep(i,n) cin>>w[i];
    bool f=1;
    rep(i,n-1){
        char k=w[i][w[i].size()-1];
        if(k!=w[i+1][0]){
            f=0;
            break;
        }
    }
    set<string> a;
    rep(i,n) a.insert(w[i]);
    if(n>a.size()) f=0;
    f?Yes:No;
}

Measured memory_bytes: 256
import qualified Data.ByteString.Char8 as C
import qualified Data.IntSet as S
import Data.List
import Data.Maybe

main = C.interact $ put . sol . get

get = unfoldr (C.readInt . C.dropWhile (<'0'))

put = C.pack . show

sol (x:_:ps) = fromMaybe x $ find (`S.notMember` s) qs 
  where
  qs = map (+x) $ 0:concatMap (\i -> [-i,i]) [1..99]
  s = S.fromList ps

Measured memory_bytes: 3760
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const ll MOD = 1e9+7; ll LLINF = 1LL << 60; int INF = INT_MAX;

//

int main(){
      ll n; cin>>n;
      ll ans=0;
      vector<ll> box(1e5+10,0);
      rep(i,0,n){
            ll x;
            cin>>x;
            if(x>1e5){
                  ans++;
                  continue;
            }
            box[x]++;
      }
      rep(i,0,box.size()){
            if(box[i]==0){
                  continue;
            }else if(box[i]<i){
                  ans+=box[i];
            }else{
                  ans+=box[i]-i;
            }
      }
      cout<<ans<<endl;
}

Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

long long inf = 1e18L + 5;

long long knapsack_high_capacity(int cap, const vector<int>& weights, const vector<int> values)
{
	int total_sum = accumulate(values.begin(), values.end(), 0);
	vector<long long> dp(total_sum + 1, inf);
	dp[0] = 0;
	for (int item = 0; item < (int)values.size(); ++item) {
		for(int w = total_sum; w >= 0; w--) {
			if (w >= values[item])
				dp[w] = min(dp[w], dp[w - values[item]] + weights[item]);
		}
	}
	for (int i = total_sum; i >= 0; i--)
		if (dp[i] <= cap)
			return i;
	return 0;
}

int main()
{
	int N, cap;
	cin >> N >> cap;
	vector <int> weights(N);
	vector <int> values(N);
	for(int i = 0; i < N ; i++) {
		cin >> weights[i] >> values[i];
	}
	//cout << knapsack(cap, weigths, values) << endl;
	cout << knapsack_high_capacity(cap, weights, values) << endl;
	return 0;
}


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

int main(){
  int n,s,r[20200];

  while(cin >> n >> s,n){
    for(int i=0;i<n;i++)cin >> r[i];
    sort(r,r+n);

    int ans = 0;
    for(int i=0;i<n;i++){
      ans += n - (upper_bound(r+i+1,r+n,s-r[i]) - r);
    }
    cout << ans << endl;
  }
}

Measured memory_bytes: 1220
#include<stdio.h>
int main(void)
{
	int n,a[10],max=0,c=0,i;
	scanf("%d", &n);
	for(i=0; i<n; i++)
	{
		scanf("%d", &a[i]);
		if(max<a[i])
		max=a[i];
	}
	int k=max;
	while(1)
	{
		for(i=0; i<n; i++)
		{
			if(k%a[i]!=0)
			break;
			if(i==n-1)
			c=1;
		}
		if(c>0)
		{
			printf("%d\n", k);
			break;
		}
		k+=max;
	}
	
	return 0;
}


Measured memory_bytes: 2132
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int x[14][14], n; string S[14];
string dp[14][16384];
bool erased[14]; vector<int>vec;
int SSS(string S, string T) {
	for (int i = min(S.size(), T.size()); i >= 0; i--) {
		if (S.substr(S.size() - i, i) == T.substr(0, i))return i;
	}
}
int main() {
	while (true) {
		cin >> n; vec.clear(); if (n == 0)break; for (int i = 0; i < n; i++)cin >> S[i];
		for (int i = 0; i < 14; i++) {
			erased[i] = false;
			for (int j = 0; j < 16384; j++) { dp[i][j] = "$"; }
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (S[i].size() > S[j].size()) {
					for (int k = 0; k <= S[i].size() - S[j].size(); k++) {
						if (S[i].substr(k, S[j].size()) == S[j])erased[j] = true;
					}
				}
			}
		}
		for (int i = 0; i < n; i++) { if (erased[i] == false)vec.push_back(i); }
		n = vec.size(); for (int i = 0; i < n; i++)S[i] = S[vec[i]];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (i != j)x[i][j] = SSS(S[i], S[j]);
			}
		}
		for (int i = 0; i < n; i++) { dp[i][(1 << i)] = S[i]; }
		for (int j = 0; j < (1 << n); j++) {
			for (int i = 0; i < n; i++) {
				if (dp[i][j] == "$")continue;
				int bit[14]; for (int k = 0; k < n; k++)bit[k] = (j / (1 << k)) % 2;
				for (int k = 0; k < n; k++) {
					if (bit[k] == 1)continue;
					string W1 = dp[i][j] + S[k].substr(x[i][k], S[k].size() - x[i][k]);
					if (dp[k][j + (1 << k)] == "$") { dp[k][j + (1 << k)] = W1; }
					if (dp[k][j + (1 << k)].size() > W1.size()) { dp[k][j + (1 << k)] = W1; }
					if (dp[k][j + (1 << k)].size() == W1.size() && dp[k][j + (1 << k)] > W1) { dp[k][j + (1 << k)] = W1; }
				}
			}
		}
		string minx = dp[0][(1 << n) - 1];
		for (int i = 0; i < n; i++) {
			if (minx.size() > dp[i][(1 << n) - 1].size()) { minx = dp[i][(1 << n) - 1]; }
			if (minx.size() == dp[i][(1 << n) - 1].size() && minx > dp[i][(1 << n) - 1]) { minx = dp[i][(1 << n) - 1]; }
		}
		cout << minx << endl;
	}
	return 0;
}

Measured memory_bytes: 15836
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long c = sc.nextLong();
		long p = Math.min(a+b+1, c);
		System.out.println(b+p);
	}
}

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

const int N = 305;
const int mod = 1e9 + 7;

int dp[N][N][N], n, m;
int mx[N][4], mn[N][4];

inline void modadd(int &x, int y) {
  x += y;
  if (x >= mod) x -=  mod;
}

inline bool legal(int R, int G, int B) {
  if (R == G && R) return 0;
  if (R == B && R) return 0;
  if (G == B && G) return 0;
  int now = max(R, max(G, B));
  for (int i = 1; i <= 3; i ++)
    if (mn[now][i] &&
	((R >= mn[now][i]) + (G >= mn[now][i]) + (B >= mn[now][i]) != i
	|| (R >= mx[now][i]) + (G >= mx[now][i]) + (B >= mx[now][i]) != i)) return 0;
  return 1;
}

int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, l, r, x; i <= m; i ++) {
    scanf("%d%d%d", &l, &r, &x);
    if (mn[r][x]) mn[r][x] = min(mn[r][x], l);
    else mn[r][x] = l;
    mx[r][x] = max(mx[r][x], l);
  }
  int now;
  dp[0][0][0] = 1;
  for (int R = 0; R < n; R ++)
    for (int G = 0; G < n; G ++)
      for (int B = 0; B < n; B ++) {
	if (!legal(R, G, B) || !dp[R][G][B]) continue;
	now = max(R, max(G, B)) + 1;
	modadd(dp[now][G][B], dp[R][G][B]);
	modadd(dp[R][now][B], dp[R][G][B]);
	modadd(dp[R][G][now], dp[R][G][B]);
      }
  int ans = 0;
  for (int i = 0; i < n; i ++)
    for (int j = 0; j < n; j ++) {
      if (legal(n, i, j)) modadd(ans, dp[n][i][j]);
      if (legal(i, n, j)) modadd(ans, dp[i][n][j]);
      if (legal(i, j, n)) modadd(ans, dp[i][j][n]);
    }
  printf("%d\n", ans);
  return 0;
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	long double ans = 0;
	ll n, k;cin >> n >> k;

	REP(i, n){
		long double tmp = 1. / n;
		ll now = i + 1;
		while(now < k){
			tmp /= 2;
			now *= 2;
		}
		ans += tmp;
	}

	cout << Decimal << ans << endl;

	return 0;
}


Measured memory_bytes: 256
//master
import java.io.*;
import java.util.*;
public class Main {
    static int[][] memo;
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        int[] b = new int[m];
        int l = 0; 
        int r = n;
        for(int i = 0; i<m; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
            l = Math.max(l,a[i]);
            r = Math.min(r,b[i]);
        }
        p(Math.max(0,r-l+1));
    }

    public static <T> void p(T message) {
        System.out.println(message);
    }

    public static <T> void pe(T message) {
        System.err.println(message);
    }

    public static <T> void pp(T message) {
        System.out.print(message);
    }
    
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


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

int K=0;
vector<int> t;
vector<int> b;
vector<int> d;
void PB(int A,int B,int C){
  t.push_back(A);
  b.push_back(B);
  d.push_back(C);
  K++;
}

int main() {
  int L;
  cin>>L;
  int Q=1;
  while(L>0){
    int Y=L%3;
    for(int j=0;j<Y;j++){
      L--;
      PB(Q,20,L);
    }
    if(L<=0){
      Q++;
      break;
    }
    L/=3;
    PB(Q,Q+1,0);
    PB(Q,Q+1,L);
    PB(Q,Q+1,L*2);
    Q++;
  }
  while(Q<19){
    PB(Q,Q+1,0);
    Q++;
  }
  cout<<20<<" "<<K<<endl;
  for(int i=0;i<K;i++){
    cout<<t[i]<<" "<<b[i]<<" "<<d[i]<<endl;
  }
}

Measured memory_bytes: 3600
#include <iostream>
#include <unordered_set>
#include <cstdint>
#include <vector>
#include <string>
#include <climits>
#include <set>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <numeric>
using namespace std;

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

	for (int i = 0; i < n; i++)
		cout << s[i] << t[i];
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
#include <tr1/unordered_map>
#define ll long long
#define il inline
const ll inf = 1e9;

namespace io {

#define in(a) a = read()
#define out(a) write(a)
#define outn(a) out(a), putchar('\n')

#define I_int ll
inline I_int read() {
    I_int x = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-') f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        x = x * 10 + c - '0';
        c = getchar();
    }
    return x * f;
}
char F[200];
inline void write(I_int x) {
    if (x == 0) return (void) (putchar('0'));
    I_int tmp = x > 0 ? x : -x;
    if (x < 0) putchar('-');
    int cnt = 0;
    while (tmp > 0) {
        F[cnt++] = tmp % 10 + '0';
        tmp /= 10;
    }
    while (cnt > 0) putchar(F[--cnt]);
}
#undef I_int

}
using namespace io;

using namespace std;

#define N 2000100

int v[N];
int n,m,len;
char s[N];
char c[N][2];

bool check(int x) {
	for(int i = 1; i <= m; ++i) {
		if(c[i][0]==s[x]) {if(c[i][1]=='L')--x;else++x;}
		if(x<1)return 1;
	}
	return 0;
}

bool check1(int x) {
	for(int i = 1; i <= m; ++i) {
		if(c[i][0]==s[x]) {if(c[i][1]=='L')--x;else++x;}
		if(x>n)return 1;
	}
	return 0;
}

int main() {
	in(n),in(m);scanf("%s",s+1);
	for(int i = 1; i <= n; ++i)v[i]=1;
	for(int i = 1; i <= m; ++i) {
		char s1[5],s2[5];
		scanf("%s%s",s1,s2);
		c[i][0]=s1[0],c[i][1]=s2[0];
	}
	int l = 1, r = n, ans = 0;
	while(l <= r) {
		int mid = (l + r) >> 1;
		if(check(mid)) l = mid + 1, ans = mid;
		else r = mid - 1;
	}
	for(int i = 1; i <= ans; ++i) v[i]=0;
	l=1,r=n,ans=n+1;
	while(l<=r) {
		int mid = (l + r) >> 1;
		if(check1(mid)) r = mid - 1, ans = mid;
		else l = mid + 1;
	}
	for(int i = n; i>=ans; --i) v[i]=0;
	ans=0;for(int i = 1; i <= n; ++i) ans += v[i];
	outn(ans);
}

/*
  AABCBDBA
0:11111111
1:10111120
2:01020202
3:01020200
*/


Measured memory_bytes: 6784
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;

template <typename T>
T beki(T x, ll n){
  T res = 1;
  while(n > 0){
    if(n & 1) res *= x;
    x = x * x;
    n >>= 1;
  }
  return res;
}

int main(){
  int N;
  cin >> N;
  if(N == 1){
    cout << 'a' << endl;
    return 0;
  }
  queue<string> a;
  a.push ("aa");
  a.push ("ab");
  bool flag = true;
  while(1){
    string s = a.front();
    int ssize = s.size();
    if(ssize == N) break;
    a.pop();
    
    string s2 = s;
    sort(ALL(s2));
    char last = s2.at(ssize-1);
    for(int i = 'a'; i <= last + 1; i++){
      char c = i;
      string ss = s + c;
      a.push(ss);
    }

  }
  vector<string> s(0);
  while(a.size()){
    s.push_back(a.front());
    a.pop();
  }
  sort(ALL(s));
  for(auto x: s) cout << x << endl;
}

Measured memory_bytes: 8948
#include <bits/stdc++.h>
#define boost ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define M 1000000007
#define eb emplace_back
#define watch(x) cout << (#x) <<" is "<< x <<"\n";


using namespace std;
//const int N = 1e6;

int32_t main(){
  boost;
  int tc = 1; //cin >> tc;
  while(tc--)
  {
    double d, t,s;
    cin >> d >> t >> s;
    double tt = d/s;
    if(tt <= t)
      cout << "Yes\n";
    else
      cout <<"No\n";
  }
}



Measured memory_bytes: 3736
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) int((x).size())
#define OUT(x) cout << (x) << endl;
typedef long long ll;
typedef vector<int> V;
typedef vector<vector<int>> VV;
typedef pair<int, int> P;
typedef map<string, int> M;
typedef unordered_map<int, int> HM;
typedef set<int> S;
typedef queue<int> Q;

int main(){
    int n;
    cin >> n;
    V a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    V b(n);
    int x = 0, y = n-1;
    bool sw = true;
    for (int i = n-1; i >= 0; i--)
    {
        if (sw)
        {
            b[x] = a[i];
            x++;
            sw = false;
        }
        else
        {
            b[y] = a[i];
            y--;
            sw = true;
        }
    }
    for (int i = 0; i < n; i++)
    {
        cout << b[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 3840
a = [ int(i) for i in input().split() ]
a1 = [ [a[0],0,0], [a[1],1,0], [a[2],0,1],[a[3],1,1] ]
a1 = sorted(a1)
# fs ss se fe
# fs ss fe se
# fs fe ss se
# ss fs fe se
if a1[0][2] == a1[3][2]:
    print( a1[2][0] - a1[1][0] )
elif a1[0][2] == a1[2][2]:
    print( a1[2][0] - a1[1][0] )
else:
    print(0)        


Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

namespace LogicSummoner
{
    class Program
    {
        static void Main(string[] args)
        {
            var num = GetNumber();
            var span = new DateTime(TimeSpan.FromSeconds(num).Ticks);
            Console.WriteLine(span.ToString("H:m:s"));
        }

        static int GetNumber()
        {
            return int.Parse(Console.ReadLine().Trim());
        }

        static List<int> GetNumbers()
        {
            return Console.ReadLine().Trim().Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToList();
        }

        static List<string> GetStrings()
        {
            return Console.ReadLine().Trim().Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
        }
    }
}

Measured memory_bytes: 9664
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MAX = 1000;
const int INF = 1e9;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
#define PI 3.14159265358979323846264338327950L

int main() {
	int N; cin >> N;
	vector<int> L;

	rep(i,N) {
		int temp; cin >> temp;
		L.push_back(temp);
	}
	sort(L.begin(),L.end());
	int cnt = 0;
	for (int i = 0; i < N; i++) {
		for(int j = i + 1; j < N; j++) {
			for (int k = j + 1; k < N; k++) {
				if(L[i]==L[j] || L[j]==L[k] || L[k]==L[i]) continue;
				if((L[i]+L[j]<=L[k])||(L[j]+L[k]<=L[i])||(L[k]+L[i]<=L[j])) {
					continue;
				}
				cnt++;
			}
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define me(a,b) memset(a,b,sizeof(a))
#define INIT() std::ios::sync_with_stdio(false)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int>P;
const int MAX_N=10+5;
const int MAX_M=100000+5;
const int INF=0x7fffffff;
const int inf=1000000000;
const double EPS=1e-6;
const ull base=123;
const ll mod=1e9+7;
const double pi=4*atan(1.0);
int main()
{
	int n;
	cin>>n;
	ll ans=1;
	int i;
	for(i=1;i<=n;i++)
	{
		ans=ans*10%mod;
	}
	ll x=1;
	for(i=1;i<=n;i++)
	{
		x=x*8%mod;
	}
	ans=(ans+x)%mod;
	x=1;
	for(i=1;i<=n;i++)
	{
		x=x*9%mod;
	}
	ans=(ans-x+mod)%mod;
	ans=(ans-x+mod)%mod;
	cout<<ans<<endl;
	//system("pause");
}

Measured memory_bytes: 3632
#include<stdio.h>
 
int main(void){
   int a,b,c,i;
   scanf("%d%d%d",&a,&b,&c);
     if(a>b){
       i=a; a=b; b=i;
     }
     if(b>c){
       i=b; b=c; c=i;
     }
     if(a>b){
       i=a; a=b; b=i;
     }
  printf("%d %d %d\n",a,b,c);
  return 0;
}


Measured memory_bytes: 2092
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>

using namespace std;

#define debug(x) cerr << #x" = " << x << endl

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;

const int N = 3e5 + 10;
int a[N];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 3 * n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a, a + 3 * n);
  int64 ret = 0;
  for (int i = n; i < 3 * n; i += 2) {
    ret += a[i];
  }
  printf("%lld\n", ret);
  return 0;
}


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

#define N 200
#define MAX 1000000

int main(){
  int x, y;
  int tail=0, times=0;
  int compute[N];
  char symbol[MAX];
  

  while(scanf("%s", symbol)!=EOF){
    
    if(symbol[0]=='+'){
      x=compute[--tail];
      y=compute[--tail];
      compute[tail++]=y+x;
    }
    else if(symbol[0]=='-'){
      x=compute[--tail];
      y=compute[--tail];
      compute[tail++]=y-x;
    }
    else if(symbol[0]=='*'){
      x=compute[--tail];
      y=compute[--tail];
      compute[tail++]=x*y;
    }
    else {
      x=atoi(symbol);
      if(x==0 && symbol[0]!='0') exit(1);
      compute[tail++]=x;
    }

  }

  printf("%d\n", compute[tail-1]);

  return 0;
}

Measured memory_bytes: 556