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

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define M_PI 3.14159265358979323846

#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

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

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }



int main()
{
    fast_io();
    #ifdef __LOCAL
        fs::path p = __FILE__;
        fs::path input,output;
        input = output = p.parent_path();
        input += string("/input/") + string(p.stem()) + string(".txt");
        output += string("/output/") + string(p.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    int N,K;
    string S;
    cin >> N >> K >> S;
    S[K-1] = S[K-1]-'A'+'a';
    cout << S << endl;

    return 0;


}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin>>n;
  int k;
  cin>>k;
  string s;
  cin>>s;
  int lr=0,rl=0;
  rep(i,n-1)
  {
    if(s[i]=='L'&&s[i+1]=='R')lr++;
    if(s[i]=='R'&&s[i+1]=='L')rl++;
  }
  int res=0;
  rep(i,n-1)
  {
    if(s[i]=='L'&&s[i+1]=='L')res++;
    if(s[i]=='R'&&s[i+1]=='R')res++;
  }
//  cout<<res<<endl;
  if(max(lr,rl)<=k)res=n-1;
  else
  {
    res+=min(min(lr,rl),k)*2+max(0,k-min(lr,rl));
  }
//  cout<<lr<<rl<<endl;
  cout<<res<<endl;

  return 0;

}


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

using namespace std;
using namespace __gnu_pbds;

using u128 = __uint128_t;

#define int long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

void solve() {
    int n;
    cin >> n;
    string x;
    cin >> x;
    int d[n][2];
    memset(d, 0, sizeof(d));
    int w = 0, e = 0;
    for (int i = 0; i < n; i++) {
        if (x[i] == 'E') {
            e++;
        } else w++;
        d[i][0] = w;
        d[i][1] = e;
    }
    int mini = LONG_LONG_MAX;
    for(int i = 0 ; i< n; i++){
        mini = min(mini , d[i][0] - (x[i] == 'W') + d[n-1][1] - d[i][1]);
    }
    cout<<mini<<endl;
}
int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}

Measured memory_bytes: 5396
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;

    vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]--;
    }

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

    vector<int> c(n);
    for(int i = 0; i < n-1; i++) {
        cin >> c[i];
    }


    int ans;
    int prev = 0;

    ans = b[a[0]];
    prev = a[0];
    FOR(i, 1, n){
        ans += b[a[i]];
        if(a[i] == prev + 1){
            ans += c[a[i-1]];
        }
        prev = a[i];
    }


    cout << ans << endl;

}

Measured memory_bytes: 256
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

a,b,c = I()
print(len(list(set([a,b,c]))))

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

//const long double PIL = 3.141592653589793238462643383279502884L;
//const double PI = 3.14159265358979323846;

#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define what_is(x) cerr << #x << " is " << x << endl;

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vll = vector<long long>;
using vii = vector<pair<int,int>>;

int main() {
	//~ ios::sync_with_stdio(0);
	//~ cin.tie(0);
	int n;
	string s;
	cin >> n >> s;
	int m = n/2;
	if (m + m != n) {
		puts("No");
		return 0;
	}

	for (int i = 0; i < m; i++)
		if (s[i] != s[m+i]) {
			puts("No");
			return 0;
		}
	puts("Yes");
	return 0;
}


Measured memory_bytes: 256
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	sc.Scan()
	x, _ := strconv.Atoi(sc.Text())
	sc.Scan()
	y, _ := strconv.Atoi(sc.Text())
	sc.Scan()
	z, _ := strconv.Atoi(sc.Text())

	a := z
	b := x
	c := y

	fmt.Printf("%d %d %d", a, b, c)
}


Measured memory_bytes: 640
r=1<<30
H,W=gets.split.map &:to_i
M=H.times.map{gets.split.map &:to_i}
H.times{|h|W.times{|w|
s=0;H.times{|i|W.times{|j|
s+=M[i][j]*[(h-i).abs,(w-j).abs].min
}};r=[r,s].min
}}
p r


Measured memory_bytes: 8892
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
 
const double EPS = 1e-10;
const ll INF = 100000000;
const ll MOD = 1000000007;

ll n;
ll c[200001];
ll to[200001];
ll pre[200001];
ll dp[200001];

int main() {
    memset(to, -1, sizeof(to));
    memset(pre, -1, sizeof(pre));
    cin >> n;
    rep(i,n) cin >> c[i];
    rep(i,n) {
        if (pre[c[i]] != -1) {
            to[pre[c[i]]] = i;
        }
        pre[c[i]] = i;
    }
    dp[0] = 1;
    rep(i,n) {
        dp[i+1] = (dp[i+1] + dp[i]) % MOD;
        if (to[i] == -1) continue;
        if (to[i] == i+1) continue;
        dp[to[i]+1] = (dp[to[i]+1] + dp[i+1]) % MOD;
    }
    cout << dp[n] << endl;
}



Measured memory_bytes: 6528
#include<iostream>
#include<string>
#include<algorithm>
typedef long long ll;
using namespace std;
const int N=2e5+5;
int a[N];
ll sum=0;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		if((i%3) && (i%5) )sum+=i;
	}
	cout<<sum<<endl;
	return 0;
}

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

int main() {
	string str[9]; int a[9]; long b[9];
	for(int i=0;i<9;i++){
		int tmp; long TMP;
		cin >> str[i] >> tmp >> TMP ;
		a[i]=tmp+TMP;
		b[i]=tmp*200+TMP*300;
	}
	for(int i=0;i<9;i++) cout << str[i] << ' ' << a[i] << ' ' << b[i] << '\n' ;
}

Measured memory_bytes: 1204
use std::io::*;
use std::str::*;

fn read<T: FromStr>(s: &mut StdinLock) -> Option<T> {
    let s = s.by_ref()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok()
}

fn main() {
    let s = stdin();
    let mut s = s.lock();
    let a: i32 = read(&mut s).unwrap();
    let b: i32 = read(&mut s).unwrap();
    let k: i32 = read(&mut s).unwrap();
    for i in a..(b + 1) {
        if (i - a + 1) <= k || (b - i + 1) <= k {
            println!("{}", i);
        }
    }
}


Measured memory_bytes: 4352
#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;
 
using ll = long long;
 
//vector
using vi = vector<int>;
using vii = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
 
//constant
const double EPS = 1e-10;
 
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()
 
//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;
 
// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }
 
// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }
 
// DP
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
 
 
 
 
// ***************************************
 
 
int main(){
 
    ll N, K;
    cin >> N >> K;
    
    vll A(N);
    REP(i, N){
        cin >> A[i];
        A[i]--;
    }
 
    vvll visited(N);
    vll rireki = {0};
 
    ll cur = 0;
    bool flag = false;
    REP(i, K){
        cur = A[cur];
        if (!visited[cur].empty()){
            flag = true;
            break;
        }
        rireki.push_back(cur);
        visited[cur].push_back(i + 1);
    }
 
    if(!flag) {
        cout << cur + 1 << endl;
        return 0;
    }
 
    ll second = rireki.size();
    ll first = visited[cur][0];
 
    ll idx = (K - first) % (second - first);
 
    cout << rireki[first + idx] + 1 << endl;
 
 
    return 0;
}

Measured memory_bytes: 15780
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
typedef long long int ll;
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define EREP(i,n) for (int i=1;i<=(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define EVEL 1
 
#ifndef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {}
#define TF(f) {}
#define END {}
#endif
const int MOD = 1000000007;
const int INF = 2000000000;
 
    int A,B,C;
    int N,M,K,X,Y,W,H;
    int ans;
    string S;
    int temp[100]={0};
    bool f=false;
    bool fir=true;
 
int main(){
    cin>>A>>B;
    if(A>B){
        N=A;
        A=B;
        B=N;
    }
    if(A==B)f=true;
    else if(A==2||B==2)f=false;
    else if(A==4||A==6||A==9||A==11){
        if(B==4||B==6||B==9||B==11){
            f=true;
        }
    }else{
        if(B==1||B==3||B==5||B==7||B==8||B==10||B==12)f=true;
    }
    f?cout<<"Yes":cout<<"No";
 
    return 0;
 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize(2)//手动O2开关 
using namespace std;
const int maxn=17;
typedef long long ll;

int x[maxn],y[maxn],r[maxn],d[maxn],dd[maxn],cun[maxn];
ll ans[maxn];
int cnt;

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d%d",&x[i],&y[i],&r[i]);
		d[i]=min(abs(x[i]),abs(y[i]));
	}
	memset(ans,0x3f,sizeof(ans));
	for(int i=0;i<(1<<n);i++)
	{
		int now=i;
		cnt=0;
		for(int j=0;j<15;j++) 
		{
			if((now>>j)&1) cun[++cnt]=j+1; 
		}
		for(int j=0;j<(1<<cnt);j++)
		{
			ll ans_=0;
			memcpy(dd,d,sizeof(dd));
			for(int k=0;k<cnt;k++)
			{
				if((j>>k)&1)
				{
					for(int e=1;e<=n;e++)
					{
						dd[e]=min(dd[e],abs(x[e]-x[cun[k+1]]));
					}
				}
				else
				{
					for(int e=1;e<=n;e++)
					{
						dd[e]=min(dd[e],abs(y[e]-y[cun[k+1]]));
					}
				}
			}
			for(int i=1;i<=n;i++)
			{
				ans_+=1ll*dd[i]*r[i];
			}
			ans[cnt]=min(ans[cnt],ans_);
		}
	}
	for(int i=0;i<=n;i++)
	{
		printf("%lld\n",ans[i]);
	}
 } 

Measured memory_bytes: 3732
#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl

#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
#define gap cout<<endl;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(int i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c)).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())

int main(){

    int n,k;
    cin>>n>>k;
    int cnt=1;
    int tmp=n/k;
    while(tmp>0){
        tmp=tmp/k;
        cnt++;

    }
    cout<<cnt<<endl;
    

}

Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

void dfs(char now, int n, string s) {
    if (int(s.size()) == n) {
        cout << s << endl;
        return;
    }
    for (char c = 'a'; c <= now+1; ++c) {
        dfs(((c>now)?(char(now+1)):now), n, s+c);
    }
    return;
}

int main() {
    int n;
    cin >> n;
    dfs('a', n, "a");
    return 0;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> V(N+1);
    set<int> W;

    for(int i=1; i<=N; i++) {
        int a;
        cin >> a;
        V[a]++;
        W.insert(a);
    }
    int d = W.size() - K;

    if(d <= 0) {
        cout << 0 << endl;
        return 0;
    }

    int count = 0;
    sort(V.begin(), V.end());
    for(int i=1; i<=N; i++) {
        if(V[i] != 0) {
            count += V[i];
            d--;
        }
        if(d <= 0) {
            break;
        }
    }

    cout << count << endl;


}

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


int main()
{
  int N;
  int C[50], V[50];
  cin >> N;
  for(int i=0; i<N; ++i) { cin >> V[i]; }
  for(int i=0; i<N; ++i) { cin >> C[i]; }

  int X=0, Y=0;
  for(int i=0; i<N; ++i)
  {
    if(V[i] > C[i])
    {
      X += V[i];
      Y += C[i];
    }
  }
  cout << X-Y << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef double ld;
#define pll pair<ll,ll>
#define pii pair<int, int>
#define pb push_back
#define mp(x, y) make_pair((x), (y))
#define F first
#define S second
#define I insert
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define all(x) (x).begin(), (x).end()
#define sz(x) (ll)(x).size()

const ll Mod = 998244353;

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

    ll n,x,y;cin>>n>>x>>y;
    vll a(n,0);
    for(ll i=1;i<=n;i++){
        for(ll j=i;j<=n;j++){
            if(i<=x){
                if(j<=x)
                    a[j-i]++;
                else if(j>x&&j<=y){
                    a[min(j-i, x-i+y-j+1)]++;
                }else{
                    a[x-i+1+j-y]++;
                }
            }
            else if(i>=y)
                a[j-i]++;
            else{
                a[min(j-i, i-x+1+abs(y-j))]++;
            }
        }
    }
    for(ll k=1;k<n;k++)
        cout<<a[k]<<"\n";
    
    return 0;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main() {
   int n,m,sum=0; cin>>n>>m;
   vector<int> a(n,0);
   rep(i,n){
       cin>>a[i]; sum+=a[i];
   }
   sort(al(a)); reverse(al(a));
   cout<<(a[m-1]*4*m>=sum ? "Yes" : "No")<<endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Main {
	public static void main(String[] args)throws IOException {
		FastReader sc = new FastReader();
		PrintWriter pw = new PrintWriter(System.out);
		String str = "abcdefghijklmnopqrstuvwxyz";
		long n = sc.nextLong();
		String ans = "";
		if (n <= 26) {
			System.out.println(str.charAt((int)n - 1));
			return;
		}
		while (n > 0) {
			long tmp = n % 26;
			if (tmp > 0)
				ans = ans + str.charAt((int)tmp - 1);
			if (tmp == 0)
				ans = ans + str.charAt(25);
			n = n - tmp;
			n = n / 26;
			if (tmp == 0)
				n--;


		}
		System.out.println(new StringBuilder(ans).reverse());

	}

}





class FastReader {
	BufferedReader br;
	StringTokenizer st;

	public FastReader() {
		br = new BufferedReader(new
		                        InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException  e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

	double nextDouble() {
		return Double.parseDouble(next());
	}

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return str;
	}
}

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

int main() {
  int a,b,c,x;cin>>a>>b>>c>>x;
  int cnt=0;
  for(int i=0;i<=a;i++){
    for(int j=0;j<=b;j++){
      for(int k=0;k<=c;k++){
    int ans=500*i+100*j+50*k;
    if(ans==x)cnt++;
      }
    }
  }
  cout<<cnt<<endl;
}

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

using namespace std;

int main()
{
	string n_string;
	cin >> n_string;
	string nr_string;
	for(int i=n_string.size()-1;i >= 0;i --)
	{
		nr_string.push_back(n_string[i]);
	}
	

	if(n_string == nr_string)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <math.h>
#include <stdio.h>
int main(){
  int A[10000],j;
  int i,count=0,a;

  scanf("%d",&i);
  for(a=0;a<i;a++)
       scanf("%d",&A[a]);

  for(a=0;a<i;a++){
    count++;
    if(A[a]==2){
      //printf("%d   ",A[a]);
      continue;
    }
    if(A[a]%2==0){
      count--;
      continue;
    }

    for(j=3;j<=sqrt(A[a]);j=j+2){
         if(j!=A[a]&&A[a]%j==0) {
           count--;
           break;
         }
       }
    //printf("%d   ",A[a]);
    }

  printf("%d\n",count);

  return 0;
}


Measured memory_bytes: 2144
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int targets = sc.nextInt();
    int skills = sc.nextInt();

    if (skills >= targets) {
      System.out.println("0");
      return;
    }

    List<BigDecimal> enemies = new ArrayList<>();
    for (int i = 0; i < targets; i++) {
      enemies.add(new BigDecimal(sc.nextInt()));
    }

    enemies.sort(Collections.reverseOrder());

    if (skills > 0) {
      enemies.subList(0, skills).clear();
    }

    BigDecimal total = new BigDecimal(0);
    for (BigDecimal enemy : enemies) {
      total = total.add(enemy);
    }

    System.out.println(total.longValue());
  }
}


Measured memory_bytes: 100592
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n); for(ll i = 0; i < (ll)n; i++)
ll facctorialMethod(ll k){
    ll sum = 1;
    for (int i = 1; i <= k; ++i)
        sum *= i;
    return sum;
}

int main() {
  ll n; cin >> n;
  vector<P> data(n);
  rep(i, n)
    cin >> data[i].first >> data[i].second;
  sort(data.begin(), data.end());
  
  ll k = facctorialMethod(n);
  
  double ans = 0;
  do{
    rep(i, n-1){
      double dis=0;
      dis += (data[i+1].first-data[i].first)*(data[i+1].first-data[i].first);
      dis += (data[i+1].second-data[i].second)*(data[i+1].second-data[i].second);
      dis = sqrt(dis);
      ans += dis;
  }}while(next_permutation(data.begin(),data.end()));
  
  cout << fixed << setprecision(10);
  cout << ans / k << endl;
}

Measured memory_bytes: 3740
#include <bits/stdc++.h>
 
using namespace std;
 
#define INF (1<<29)
 
int main()
{
    int n, m;
    while (cin >> n >> m, n) {
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        vector<int> b(n);
        for (int i = 0; i < n; i++) {
            for (int j = 0; ; j++) {
                int c = a[i] * j;
                if (c > m) break;
                b[i] = c;
            }      
        }
        int bmin = *min_element(b.begin(), b.end());
 
        vector<int> num;
        for (int i = 0; i < n; i++) {
            if (bmin == b[i]) {
                num.push_back(i);
            }
        }
     
        if (num.size() == 1) {
            cout << num[0] + 1 << endl;
        } else {
            int amin = INF;
            for (int i = 0; i < (int)num.size(); i++) {
                amin = min(amin, a[num[i]]);
            }
            vector<int> num2;
            for (int i = 0; i < (int)num.size(); i++) {
                if (amin == a[num[i]]) {
                    num2.push_back(num[i]);
                }
            }
            if (num2.size() == 1) {
                cout << num2[0] + 1 << endl;
            } else {
                cout << n << endl;
            }
        }
    } 
    return 0;
}

Measured memory_bytes: 3100
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define ff first
#define ss second
#define INF (ll) (1e9)
#define mod (ll) (1e9 + 7)
#define endl "\n"
#define tt ll testcase; cin>>testcase; while(testcase--)
 
const int mxn = 1*(1e5) + 5;
ll n, m;
 
void solve(){
    string s;
    cin >> s;
    int c=0;
    if(s[0] =='R')    {
        c = 1;
        if(s[1] == 'R') c = 2;
        if((s[1] == 'R')&&(s[2] == 'R')) c = 3;
    } else {
        if((s[1] == 'R') || (s[2] == 'R')) c = 1;
        if((s[1] == 'R') && (s[2] == 'R')) c = 2;
    }
    cout << c;
}
 
int main(){
    fast;
    #ifndef ONLINE_JUDGE 
    freopen("input.txt", "r", stdin); 
    freopen("output.txt", "w", stdout); 
    #endif 
     // tt
        solve();
    return 0;
}

Measured memory_bytes: 3576
import java.util.*

fun main(args: Array<String>) {
    val inf = Int.MAX_VALUE

    val di = listOf(-1, 0, 1, 0)
    val dj = listOf(0, 1, 0, -1)

    val (h, w) = readLine()!!.split(' ').map { it.toInt() }
    val grid = (0 until h).map { readLine()!! }.toTypedArray()
    val cnt = grid.map { it.count { c -> c == '.' } }.sum()

    val queue = ArrayDeque<Pair<Int, Int>>()
    val visited = Array(h) { IntArray(w) { inf } }

    queue.addLast(0 to 0)
    visited[0][0] = 1

    while (queue.isNotEmpty()) {
        val (i, j) = queue.removeFirst()
        val v = visited[i][j]

        repeat(4) {
            val ni = i + di[it]
            val nj = j + dj[it]
            if (ni !in 0 until h) return@repeat
            if (nj !in 0 until w) return@repeat
            if (grid[ni][nj] == '#') return@repeat
            if (visited[ni][nj] != inf) return@repeat

            visited[ni][nj] = v + 1
            queue.addLast(ni to nj)
        }
    }

    println(visited[h - 1][w - 1].let { if (it != inf) cnt - it else -1 })
}


Measured memory_bytes: 37828
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill((T*)array, (T*)(array+N), val);
}
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


class BKEYENCEString {
public:
	void solve(std::istream& in, std::ostream& out) {
        string s;
        in >> s;
        bool res = false;
        if(s == "keyence") res = true;
        int ind = 0;
        bool flg = false;
        string t = "keyence";
        rep(i, s.length()){
            if(ind == 7){
                res = true;
                break;
            }

            if(flg){
                string st = s.substr(i, i+6-ind);
                if(st == t.substr(ind, 7)){
                    res = true;
                    break;
                }else continue;
            }

            if(s[i] == t[ind]){
                ind++;
            }else{
                flg = true;
            }
        }

        if(res) out << "YES" << endl;
        else out << "NO" << endl;
	}
};


int main() {
	BKEYENCEString solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
t = (int(x) for x in input().split(" "))
T = list(t)
K = T[0]
N = T[1]
x = (int(x) for x in input().split(" "))
X = list(x)
y = []
for i in range(0, N-1):
    y.append(X[i+1]-X[i])
y.append(X[0]+K-X[N-1])
z = max(y)
s =K - z
print(s)

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

using namespace std;

int solve(int n, const std::string& a, const std::string& b,
          const std::string& c) {
  if (a == b && b == c) {
    return 0;
  }
  int ret = 0;
  for (int i = 0; i < n; ++i) {
    auto const aa = a[i];
    auto const bb = b[i];
    auto const cc = c[i];
    int const value = static_cast<int>(aa != bb) + static_cast<int>(bb != cc) +
                      static_cast<int>(cc != aa) - 1;
    ret += std::max(value, 0);
  }
  return ret;
}

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int n;
  std::cin >> n;
  std::string a, b, c;
  std::cin >> a >> b >> c;
  std::cout << solve(n, a, b, c) << std::endl;
  return 0;
}


Measured memory_bytes: 256
N, Ma, Mb = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
DP = [0]*(N+1)
for i in range(N+1):
    DP[i] = [[float("inf")]*(10*N+1) for i in range(10*N+1)]
for i in range(N+1):
    DP[i][0][0] = 0
for i in range(N):
    for j in range(1, 10*N+1):
        for k in range(1,10*N+1):
            if DP[i+1][j][k] > DP[i][j-A[i][0]][k-A[i][1]]+A[i][2] and j-A[i][0] >= 0 and k-A[i][1] >= 0:
               DP[i+1][j][k] = min(DP[i][j-A[i][0]][k-A[i][1]]+A[i][2], DP[i][j][k])
            else:
                DP[i+1][j][k] = DP[i][j][k]
kouho = set()
for i in range(1, 10*N+1):
    if Ma*i < 10*N+1 and Mb*i < 10*N+1:
        if DP[N][Ma*i][Mb*i] == float("inf"):
            continue
        else:
            kouho.add(DP[N][Ma*i][Mb*i])
    else:
        break
if len(kouho) == 0:
    print(-1)
else:
    print(min(kouho))
                



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

int main()
{
    int M1, D1;
    cin >> M1 >> D1;
    int M2, D2;
    cin >> M2 >> D2;
    if(D2 == 1){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
# Problem XYZ Triplets

# input
N = int(input())

# initialization
ans_list = [0]*(10**6)

# calc
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            ans_list[tmp] += 1

# output
for i in range(1, N+1):
    print(ans_list[i])


Measured memory_bytes: 16924
N, K = map(int, input().split(' '))

ans = 0
for b in range(1, N+1):
    ans += max(b - K, 0) * (N // b)
    ans += max((N%b) - K + 1, 0)


if K == 0:
    ans -= N

print(ans)


# ans = 0
# for b in range(1, N+1):
#     for k in range(K, b):
#         for a in range(k, N+1, b):
#             if a > 0:
#                 ans += 1
#                 print(a, b)
#             else:
#                 pass
#                 # print(a, b)

# print(ans)


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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep1は「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//reprは「ｓからnまで」の繰り返し

typedef long long ll;

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


int main() {

    int n,m;
    cin>>n>>m;
    bool jdg=true;

    vector<int>a(n+1),b(n+1,0);
    rep(i,m){
        int s,c;
        cin>>s>>c;

        if(b[s]!=0&&a[s]!=c){
                jdg=false;
        }

        if(n>=2&&(s==1&&c==0)){
            jdg=false;
        }

        a[s]=c;
        b[s]++;

    }


    if(jdg==true){
        if(n!=1&&a[1]==0){
            a[1]=1;
        }
        rep2(i,1,n){
            cout<<a[i];
        }
        cout<<endl;
    }
    else {
        cout<<-1<<endl;
    }

}


Measured memory_bytes: 256
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        (n, m, x): (usize, usize, i32),
        data: [(i32, [i32; m]); n],
    }
    // eprintln!("{}, {:?}", data[0].0, data[0].1);
    let N = 1 << n;
    let mut dp = vec![0 as i32; N];
    let mut dp_v = vec![vec![0 as i32; m]; N];
    let mut ans = 1 << 30;
    for i in 0..n {
        let (c, v) = &data[i];
        dp[1 << i] = *c;
        for j in 0..m {
            dp_v[1 << i][j] = v[j];
        }
    }
    for s in 1..N {
        for t in 0..n {
            let i = 1 << t;
            if (i & s) != 0 {
                dp[s] = dp[i] + dp[s ^ i];
                for j in 0..m {
                    dp_v[s][j] = dp_v[i][j] + dp_v[s ^ i][j];
                }
                break;
            }
        }
        let mut ok = true;
        for i in 0..m {
            if dp_v[s][i] < x {
                ok = false;
            }
        }
        if ok {
            ans = ans.min(dp[s]);
        }
    }
    if ans < (1 << 30) {
        println!("{}", ans);
    } else {
        println!("-1");
    }
}


Measured memory_bytes: 2360
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static final int HONEST = 1, DISHONEST = 0;
    int N;
    int[][][] A;

    public Main() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        A = new int[N][][];

        for (int i = 0; i < N; i++) {
            int J = scanner.nextInt();
            A[i] = new int[J][2];

            for (int j = 0; j < J; j++) {
                A[i][j][0] = scanner.nextInt() - 1;
                A[i][j][1] = scanner.nextInt();
            }
        }

        int[] B = new int[N];
        Arrays.fill(B, DISHONEST);

        System.out.println(search(B, 0, 0));
    }

    int search(int[] B, int num, int index){
        if (index == N){

            for (int i = 0; i < N; i++) {
                int L = A[i].length;
                if(B[i] == HONEST){
                    for (int j = 0; j < L; j++) {
                        if(B[A[i][j][0]] != A[i][j][1]){
                            return -1;
                        }
                    }
                } else {
                    int T = 0;
                    for (int j = 0; j < L; j++) {
                        if(B[A[i][j][0]] == A[i][j][1]){
                            T++;
                        }
                    }

                    if (T == N) return -1;
                }
            }

            return num;
        }

        B[index] = HONEST;
        int R = search(B,num+1,index+1);
        B[index] = DISHONEST;
        R = Math.max(R, search(B,num,index+1));

        return R;
    }

    public static void main(String[] args) {
        new Main();
    }
}


Measured memory_bytes: 24744
from collections import Counter

N, K = map(int, input().split())
A = list(map(int, input().split()))
C = Counter(A)

ball = []
for k, v in C.items():
    ball.append([v, k])
ball.sort(key=lambda x: -x[0])

ans = 0
for i in range(len(ball)):
    if i>=K:
        ans += ball[i][0]

print(ans)

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

int N, ans=1;
string S;

int main () {
	cin >> N;
	cin >> S;
	for(int i=1; i<N; i++) {
		if (S[i] != S[i-1])
			ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v,i) (v).erase(remove(all(v),i),(v).end())
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define debug(x) cerr<<#x<<" = "<<(x)<<endl;
#define LINE cerr<<"LINE: "<<__LINE__<<endl;
inline int toInt(string s){int v;istringstream i(s);i>>v;return v;}
template<class T> inline string toString(T x){ostringstream o;o<<x;return o.str();}
template<class T> void pv(T a,T b){for(T it=a;it!=b;++it)cerr<<*it<<" ";cerr<<endl;}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

int main() {
	for(int H, M, S; cin >> H >> M >> S;) {
		if(H == -1) break;
		int res = 120 * 60 - H * 3600 - M * 60 - S;
		int res2 = res * 3;
		printf("%02d:%02d:%02d\n", res / 3600, res % 3600 / 60, res % 60);
		printf("%02d:%02d:%02d\n", res2 / 3600, res2 % 3600 / 60, res2 % 60);
	}
	return 0;
}

Measured memory_bytes: 0
import java.util.*;
    public class Main{
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();
            String[] s = new String[n];
            for(int i=0; i<n; i++){
                s[i] = sc.next();
            }
            int c0=0;
            int c1=0;
            int c2=0;
            int c3=0;
            for(int i=0; i<n; i++){
            switch (s[i]){
              case "AC":
                    c0++;
                    break;
              case "WA":
                    c1++;
                    break;
              case "TLE":
                    c2++;
                    break;
              case "RE":
                    c3++;
                    break;
            }
            }
            System.out.println("AC x " + c0);
            System.out.println("WA x " + c1);
            System.out.println("TLE x " + c2);
            System.out.println("RE x " + c3);
            
        }
    }        
   

Measured memory_bytes: 63868
import itertools
import math
N, D = map(int, input().split())
A = [[int(i) for i in input().split()] for j in range(N)]
B = [int(j) for j in range(N)]

count = 0
for x in itertools.combinations(B, 2):
    abs_A =[(A[x[0]][l]-A[x[1]][l])**2 for l in range(D)]
    if math.sqrt(sum(abs_A))%1 == 0 :
        count+=1
    else:
        count+=0
print(count)


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

int main(){
    int N,D;
    cin>>N>>D;
    int X[N][D];
    REP(i,N){
      REP(j,D){
        cin>>X[i][j];
      }
    }
    int ans=0;
    for(int i=0;i<N;i++){
      for(int j=i+1;j<N;j++){
        int norm=0;
        for(int k=0;k<D;k++){
          int diff=abs(X[i][k]-X[j][k]);
          norm+=diff*diff;
        }
        bool flag=false;
        for(int k=0;k<=norm;k++){
          if(k*k==norm){
            flag=true;
          }
        }
        if(flag) ans++;
      }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool change(T& a, T b) { if (a != b) { a = b; return 1; } return 0; }
using namespace std;
typedef long long ll;

ll dp[200000];

int main(){
    int n; cin >> n;
    cout << n+n*n+n*n*n <<endl;
    return 0;
}

Measured memory_bytes: 3592
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <ctime>
#define INF 1361474528
#define MOD 1000000007
using namespace std;

int main()
{
    int x,y;
    cin>>x>>y;
    cout<<x+y/2<<endl;
    return 0;
}



Measured memory_bytes: 256
mat = [['0', '0', '0', '0', '0']]
for i in range(9):
    if i%2 ==0:
        tmpc = '0' + input() + '0'

    else:
        tmpc = input()

    mat.append(list(tmpc))
mat.append(['0', '0', '0', '0', '0'])

pos = [0,1]
move = ['R']
while True:
    mdict = {'U': [2*pos[0], pos[1]], 'R': [2*pos[0]+1, pos[1]+1], 'D': [2*pos[0]+2, pos[1]], 'L': [2*pos[0]+1, pos[1]]}
    if move[-1] == 'R':
        belst = ['U', 'R', 'D', 'L']

    elif move[-1] == 'D':
        belst = ['R', 'D', 'L', 'U']

    elif move[-1] == 'L':
        belst = ['D', 'L', 'U', 'R']

    else:
        belst = ['L', 'U', 'R', 'D']
            
    for i in belst:
        if mat[mdict[i][0]][mdict[i][1]] == '1':
            be = i
            break
    
    if be == 'U':
        pos[0] -= 1
    elif be == 'R':
        pos[1] += 1
    elif be == 'D':
        pos[0] += 1
    else:
        pos[1] -= 1
    
    move.append(be)

    if pos == [0, 0]:
        break

print(''.join(move))


Measured memory_bytes: 5572
#include <stdio.h>

int main(void) {

  int hour,minite,second;
  int r_hour,r_minite,r_second;
  int r_hour3,r_minite3,r_second3;
  int time,rest;

  while(1) {

    scanf("%d %d %d",&hour,&minite,&second);

    if(hour==-1 && minite==-1 && second==-1) break;

    time=3600*hour+60*minite+second;

    rest=7200-time;

    r_second=rest%60;
    r_minite=(int)(rest/60)%60;
    r_hour=rest/3600;

    r_second3=3*rest%60;
    r_minite3=(int)(3*rest/60)%60;
    r_hour3=3*rest/3600;
    
    if(r_hour<10) printf("0");
    printf("%d:",r_hour);
    if(r_minite<10) printf("0");
    printf("%d:",r_minite);
    if(r_second<10) printf("0");
    printf("%d\n",r_second);

    if(r_hour3<10) printf("0");
    printf("%d:",r_hour3);
    if(r_minite3<10) printf("0");
    printf("%d:",r_minite3);
    if(r_second3<10) printf("0");
    printf("%d\n",r_second3);

  }

  return 0;
    

}

Measured memory_bytes: 0
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException
    {
        StringBuffer sBuffer = new StringBuffer();
        BufferedReader bReader = 
                new BufferedReader(new InputStreamReader(System.in));
        
        String str = bReader.readLine();
        sBuffer.append(str);
        System.out.println(sBuffer.reverse());
    }
}

Measured memory_bytes: 9344
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
K = min(a)+min(b)
X = 10**9
for i in range(M):
    x,y,c = map(int,input().split())
    S = a[x-1]+b[y-1]-c
    if S<X:
        X = S
if X<K:
    print(X)
else:
    print(K)


Measured memory_bytes: 18612
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;

int main(){
  string str;
  vector<string> out;
  int N;
  cin >> str >> N;
  for(int i=0;i<N;i++){
    int a, b;
    string instr, p;
    cin >> instr;
    if(instr == "print"){
      cin >> a >> b;
      out.push_back(str.substr(a, b-a+1));
    }else if(instr == "reverse"){
      cin >> a >> b;
      for(int i=0;i<=(b-a)/2;i++){
        swap(str[a+i], str[b-i]);
      }
    }else{
      cin >> a >> b >> p;
      str.replace(a, b-a+1, p);
    }
  }

  for(int i=0;i<out.size();i++){
    cout << out[i] << endl;
  }
  return 0;
}

Measured memory_bytes: 1228
//#include <bits/stdc++.h>
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower

#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < n; i++)
#define SORT(a) sort(a.begin(), a.end()) //reverse()で反転
#define lower(a, n) lower_bound(a.begin(), a.end(), n);
#define upper(a, n) upper_bount(a.begin(), a.end(), n);
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define mod 1000000007
using ll = long long;
using namespace std;
int sum(int a){
  if(a == 0) return 0;
  return sum(a - 1) + a;
}
int gcd(int a, int b){ //最大公約数
  if(a % b == 0) return b;
  return gcd(b, a % b);
}
int lcm(int a, int b){ //最小公倍数
  return a / gcd(a, b) * b;
}
int main(){
  int k;
  cin >> k;
  int ans = 0;
  rep(a, k){
    rep(b, k){
      rep(c, k){
        int temp = gcd(a + 1, b + 1);
        ans += gcd(temp, c + 1);
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3636
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r#"2018 218"# => "Yes",
r#"2763 0"# => "No",
//
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        n: i64,
    }

    (n / 3) .to_string()
}

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

double circle_area(const double r, const double pi) {
  return r * r * pi;
}

double circumference(const double r, const double pi) {
  return 2 * r * pi;
}

int main() {
  const double pi = 3.141592653589;
  double r;
  cin >> r;
  printf("%.6f %.6f\n", circle_area(r,pi), circumference(r,pi));
  return 0;
}


Measured memory_bytes: 3288
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<stack>
#include<vector>
#include<queue>
#include<set>
#include<algorithm>
#define INF 0x3f3f3f3f
#define ll long long
using namespace std;

ll a[200005]={0};

int main()
{
	int n,k;
	cin >> n >> k;
	for(int i=1;i<=n;i++){
		cin >> a[i];
	}
	for(int i=1;i<=n-k;i++){
		if(a[i]<a[i+k]){
			cout <<"Yes" << endl;
		}
		else 
			cout << "No" << endl;
	}
	return 0;
}


Measured memory_bytes: 5088