akhauriyash/Code-Regression huggingface dataset:
//  ____            _                  _                       _       _
// |  _ \ _   _ ___| |_    ___ _ __   | |_ ___ _ __ ___  _ __ | | __ _| |_ ___
// | |_) | | | / __| __|  / __| '_ \  | __/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \
// |  _ <| |_| \__ \ |_  | (__| |_) | | ||  __/ | | | | | |_) | | (_| | ||  __/
// |_| \_\\__,_|___/\__|  \___| .__/___\__\___|_| |_| |_| .__/|_|\__,_|\__\___|
//                            |_| |_____|               |_|

//https://github.com/manta1130/Competitive_Programming_Template_Rust

#[macro_use]
mod input {

    use std;
    use std::io;

    const SPLIT_DELIMITER: char = ' ';

    #[macro_export]
    #[allow(unused_macros)]
    macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

    #[allow(dead_code)]
    pub fn input_line_str() -> String {
        let mut s = String::new();
        io::stdin().read_line(&mut s).unwrap();
        s.trim().to_string()
    }

    #[allow(dead_code)]
    pub fn p<T>(t: T)
    where
        T: std::fmt::Display,
    {
        println!("{}", t);
    }

    #[allow(dead_code)]
    pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
    where
        T: std::str::FromStr,
    {
        let mut v: Vec<Vec<T>> = Vec::new();

        for _ in 0..line {
            let vec_line = input_vector();
            v.push(vec_line);
        }
        v
    }

    #[allow(dead_code)]
    pub fn input_vector<T>() -> Vec<T>
    where
        T: std::str::FromStr,
    {
        let mut v: Vec<T> = Vec::new();

        let s = input_line_str();
        let split_result = s.split(SPLIT_DELIMITER);
        for z in split_result {
            let buf = match z.parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            v.push(buf);
        }
        v
    }

    #[allow(dead_code)]
    pub fn input_vector_row<T>(n: usize) -> Vec<T>
    where
        T: std::str::FromStr,
    {
        let mut v = Vec::with_capacity(n);
        for _ in 0..n {
            let buf = match input_line_str().parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            v.push(buf);
        }
        v
    }

    pub trait ToCharVec {
        fn to_charvec(&self) -> Vec<char>;
    }

    impl ToCharVec for String {
        fn to_charvec(&self) -> Vec<char> {
            self.to_string().chars().collect::<Vec<_>>()
        }
    }
}

use input::*;

fn main() {
    let (n,m):(usize,usize);
    input!(n,m);
    if n==m{
        println!("Yes");
    }else{
        println!("No");
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N,K;
    cin >> N >> K;
    vector<int> V(N);
    rep(i,0,N)cin >> V[i];
    ll ans = 0,sum = 0,accua = 0,accub = 0;
    rep(i,0,N)sum += V[i] > 0 ? V[i] : 0;
    rep(i,0,K){
        accua += V[i];
        accub += V[i] > 0 ? V[i] : 0;
    }
    if(accua > 0)ans = sum - accub + accua;
    else ans = sum - accub;
    rep(i,K,N){
        //cout << ans << endl;
        accua += V[i] - V[i-K];
        accub += V[i] > 0 ? V[i] : 0;
        accub -= V[i-K] > 0 ? V[i-K] : 0;
        if(accua > 0){
            ans = max(ans, sum - accub + accua);
        }else{
            ans = max(ans, sum - accub);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
#define pll pair<lld,lld>
#define pb push_back
#define ss second
#define ff first
#define mp make_pair
#define mod 1000000007
#define answer(x) cout<<endl<<"answer : "<<x<<endl<<endl;
#define op(x) cout<<x<<endl;
#define maxn 500005
#define messi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
vec adj[maxn];
bool viz[maxn];
lld cnt;
void dfs(lld x)
{
    viz[x]=true;
    cnt++;
    for(auto u:adj[x])
        if(!viz[u]) dfs(u);
    return;
}
int main() {messi lld t=1;//cin>>t;
    while(t--)
    {
        lld n=0,m=0,k=0,i=0,j=0,p=0,q=0,x=0,y=0,z=0,ans=0,l=0,r=0,mid=0,lo=0,hi=0;string s;bool flag=false;
        cin>>n>>m;
        for(i=0;i<m;i++)
        {
            cin>>p>>q;
            adj[p].pb(q); adj[q].pb(p);
        }
        for(i=1;i<=n;i++)
            viz[i]=false;
        for(i=1;i<=n;i++)
        {
            cnt = 0;
            if(viz[i]==false)
                dfs(i);
            ans = max(ans,cnt);
        }
        op(ans);
    }
	return 0;
}
/*  CODED BY:-
 ________________________________________
|            __        __                |
|  /\   /\  |__)  /\  |  \ |__| \ /  /\  |
| /~~\ /~~\ |  \ /~~\ |__/ |  |  |  /~~\ |
|________________________________________|

*/


Measured memory_bytes: 27980
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;

int h, w;
string s[2222];

int hc[2222][2222], wc[2222][2222];

int main(){

  cin >> h >> w;
  for(int i=0; i < h; i++) {
    cin >> s[i];
  }

  for(int i=0; i < h; i++) {
    for(int j=0; j < w; j++) hc[i][j] = 0;
    for(int j=0; j < w; j++) {

      int cnt = 0;
      while(j+cnt < w && s[i][j+cnt] == '.')cnt++;
      for(int k=0; k < cnt; k++) {
        hc[i][j+k] = cnt;
      }
      j+=max(0, cnt-1);

    }
  }

  for(int i=0; i < w; i++) {
    for(int j=0; j < h; j++) wc[j][i] = 0;
    for(int j=0; j < h; j++) {

      int cnt = 0;
      while(j+cnt < h && s[j+cnt][i] == '.')cnt++;
      for(int k=0; k < cnt; k++) {
        wc[j+k][i] = cnt;
      }
      j+=max(0, cnt-1);
      
    }
  }

  int ans = 0;
  for(int i=0; i < h; i++) {
    for(int j=0; j < w; j++) {
      if(s[i][j] == '.')ans = max(ans, hc[i][j]+wc[i][j]-1);
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 41216
#include <bits/stdc++.h>
#define ll long long
using namespace std;
template<class T>inline void read(T &res)
{
    char c;
    T flag=1;
    while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;
    res=c-'0';
    while((c=getchar())>='0'&&c<='9')res=res*10+c-'0';
    res*=flag;
}
void gcd(ll a,ll b,ll &d,ll &x,ll &y)
{
    if(!b)
    {
        d=a;
        x=1;
        y=0;
    }
    else
    {
        gcd(b,a%b,d,y,x);
        y-=x*(a/b);
    }
}
ll in(ll a,ll mod)
{
    ll d,x,y;
    gcd(a,mod,d,x,y);
    return d==1?(x+mod)%mod:-1;
}

ll qp(ll a,ll x,ll mod)
{
    ll ans=1;
    while(x)
    {
        if(x%2==1)
            ans=(ans*a)%mod;
        a=(a*a)%mod;
        x/=2;
    }
    return ans;
}
int cmp(ll a,ll b)
{
    return a<b;
}
int main()
{
    string s;
    cin>>s;
    if(s[0]=='R')
    {
        if(s[1]=='R')
            if(s[2]=='R')
                cout<<3<<endl;
            else
                cout<<2<<endl;
        else
            cout<<1<<endl;
    }
    else if(s[1]=='R')
    {
        if(s[2]=='R')
            cout<<2<<endl;
        else
            cout<<1<<endl;
    }
    else if(s[2]=='R')
        cout<<1<<endl;
    else
        cout<<0<<endl;
    return 0;

}




Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N, M;
	cin >> N >> M;
	map<int, int> MAP[100001];
	rep1(i, M) {
		int P, Y;
		cin >> P >> Y;
		MAP[P][Y] = i;
	}

	int kotae1[100001], kotae2[100001];
	rep1(i, N) {
		int kari = 1;
		for (auto itr : MAP[i]) {
			kotae1[itr.second] = i;
			kotae2[itr.second] = kari;
			kari++;
		}
	}

	rep1(i, M) {
		cout << setfill('0') << setw(6) << kotae1[i] << setw(6) << kotae2[i] << "\n";
	}

	Would you please return 0;
}

Measured memory_bytes: 12736
// Words are flowing out like endless rain into a paper cup
// They slither while they pass they slip away across the universe
// Pools of sorrow, waves of joy are drifting through my open mind
// Possessing and caressing me

#include <bits/stdc++.h>
using namespace std;

using LL = long long;

namespace _buff {

const size_t BUFF = 1 << 19;
char ibuf[BUFF], *ib = ibuf, *ie = ibuf;
char getc() {
    if (ib == ie) {
        ib = ibuf;
        ie = ibuf + fread(ibuf, 1, BUFF, stdin);
    }
    return ib == ie ? -1 : *ib++;
}

}

LL read() {
    using namespace _buff;
    LL ret = 0;
    bool pos = true;
    char c = getc();
    for (; (c < '0' || c > '9') && c != '-'; c = getc()) {
        assert(~c);
    }
    if (c == '-') {
        pos = false;
        c = getc();
    }
    for (; c >= '0' && c <= '9'; c = getc()) {
        ret = (ret << 3) + (ret << 1) + (c ^ 48);
    }
    return pos ? ret : -ret;
}

const size_t N = 2e5 + 5;

int n;
LL k;
LL a[N], f[N];

bool check(LL x) {
    LL sum = 0;
    for (int i = 0; i < n; ++i) {
        sum += max(a[i] - x / f[i], 0LL);
    }
    return sum <= k;
}

int main() {
    n = read(); k = read();
    generate_n(a, n, read);
    generate_n(f, n, read);
    sort(a, a + n);
    sort(f, f + n, greater<LL>());

    LL lb = 0, rb = 1e12, ans = -1;
    while (lb <= rb) {
        LL mid = (lb + rb) >> 1;
        if (check(mid)) {
            ans = mid;
            rb = mid - 1;
        } else {
            lb = mid + 1;
        }
    }
    cout << ans;
    return 0;
}


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

using namespace std;

typedef long long ll;
int n;
int p;
int even,odd;
ll nCr[51][51];


void init() {
  nCr[0][0] = 1;

  for(int i = 1; i < 51; i++) {
    for(int j = 0; j <= i; j++) {
      if(j == 0 || i == j) nCr[i][j] = 1;
      else nCr[i][j] = nCr[i-1][j-1] + nCr[i-1][j];
    }
  }
}

ll C(int n, int r) {
  return nCr[n][r];
}

int main() {
  cin >> n >> p;
  
  init();
  ll ans = 1;
  for(int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if(a % 2 == 0) {
      even++;
      ans *= 2;
    }
    else odd++;
  }

  
 
  ll tmp = 0;

  if(p == 1) {
    if(odd == 0) {
      cout << "0" << endl; return 0;
    }

    for(int i = 1; i <= odd; i += 2) {
      tmp += C(odd,i);
    }
    ans *= tmp;
    cout << ans << endl;
  }
  else {
    for(int i = 0; i <= odd; i += 2) {
      tmp += C(odd,i);
    }
    if(odd != 0) ans *= tmp;
    cout << ans << endl;
    
  }
}
    
  
  


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

int main(){
    int a, b, x;
    cin >> a >> b;

    for(int i= b-a+1; i<=b+a-1; i++){
	if(i<-1000000 || 100000<i)
	    continue;
	cout << i << " ";
    }
    cout << endl;
    return 0;
}


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

using namespace std;

int main(void){
	int n;

	cin >> n;

	vector<int> alp(26, 1000);


	string s;
	for (int i = 0; i < n; i++){
		cin >> s;
		vector<int> temp(26, 0);

		for (int j = 0; j < s.size(); j++){
			temp[s[j] - 'a']++;
		}

		for (int j = 0; j < 26; j++){
			alp[j] = min(alp[j], temp[j]);
		}
	}



	for (int i = 0; i < 26; i++){
		for (int j = 0; j < alp[i]; j++)
			cout << (char)('a' + i);
	}

	cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define PII pair<int, int>
#define PLL pair<LL, LL>
#define VI vector<int>
#define VPII vector<PII>
#define LL long long
#define LD long double
#define f first
#define s second
#define MP make_pair
#define PB push_back
#define pb pop_back
#define ALL(c) (c).begin(), (c).end()
#define SIZ(c) (int)(c).size()
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, b, e) for(int i = (b); i <= (int)(e); ++i)
#define FORD(i, b, e) for(int i = (b); i >= (int)(e); --i)

#define Sim template<class n
Sim, class s> ostream & operator << (ostream &p, pair<n, s> x)
{return p << "<" << x.f << ", " << x.s << ">";}
Sim> auto operator << (ostream &p, n y) -> 
typename enable_if<!is_same<n, string>::value, decltype(y.begin(), p)>::type 
{int o = 0; p << "{"; for(auto c: y) {if(o++) p << ", "; p << c;} return p << "}";}
void dor() {cerr << endl;}
Sim, class...s> void dor(n p, s...y) {cerr << p << " "; dor(y...);}
Sim, class s> void mini(n &p, s y) {if(p>y) p = y;}
Sim, class s> void maxi(n &p, s y) {if(p<y) p = y;}
#ifdef DEB
#define debug(...) dor(__FUNCTION__, ":", __LINE__, ": ", __VA_ARGS__)
#else
#define debug(...)
#endif 

#define I(x) #x " = ", (x), " "
#define A(a, i) #a "[" #i " = ", i, "] = ", a[i], " "
const int M = 1024;

int T[M][M];

void jebaj(int x1, int x2, int y1, int y2, int l)
{
	int a = l / 2;
	T[x1 + a][y1 + a] = 1;
	if (l > 1)
	{
		jebaj(x1, x1 + a - 1, y1, y1 + a - 1, a - 1);
		jebaj(x1 + a + 1, x2, y1, y1 + a - 1, a - 1);
		jebaj(x1, x1 + a - 1, y1 + a + 1, y2, a - 1);
		jebaj(x1 + a + 1, x2, y1 + a + 1, y2, a - 1);
	}
}

int32_t main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	int lol = (1<<10);
	jebaj(1, lol - 1, 1, lol - 1, lol - 1);
	FOR(i, 1, (1<<n) - 1)
	{
		FOR(j, 1, (1<<m) - 1)
		{
			printf("%d", T[i][j]);
		}
		printf("\n");
	}
}














Measured memory_bytes: 5376
#include<bits/stdc++.h>
#define dbug printf("I am here\n");
#define Fast ios_base::sync_with_stdio(false); cin.tie(0);
#define vs            v.size()
#define ss            s.size()
#define sot(v)        sort(v.begin(),v.end())
#define rev(v)        reverse(v.begin(),v.end())
#define ii            pair<int, int>
#define int           long long
#define ull           unsigned long long
#define pb            push_back
#define mpp           make_pair
#define Okay          0
#define pi            3.14159

const int inf = 1e6;
const int cont = 1e18;
using namespace std;

bool graph[10][10];

void solve(){
    int n, m;
    cin>>n>>m;
    for(int i=0; i<m; i++){
        int a, b;
        cin>>a>>b;
        a--, b--;
        graph[a][b] = graph[b][a] = true;
    }

    vector<int>order(n);
    for(int i=0; i<n; i++)order[i] = i;
    int ans = 0;

    do{
        if(order[0] != 0)break;
        bool ok = true;
        for(int i=0; i<n-1; i++){
            int from = order[i];
            int to = order[i+1];
            if(graph[from][to] == 0)ok = false;
        }
        if(ok)ans++;
    }while(next_permutation(order.begin(), order.end()));

    cout<<ans<<endl;

}

int32_t main() {
   Fast;
   int tst;

    solve();
    return Okay;
}



Measured memory_bytes: 3632
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    if n<=999:
        print('ABC')
    else:
        print('ABD')
if __name__ == '__main__':
    do()

Measured memory_bytes: 3060
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include<vector>
#include<iostream>
#include<set>
#include<map>
#include<algorithm>
using namespace std;


long long int divide(long long int h,long long w){
	if(h %2 == 0){
		return (h/2)*w;
	}
	if(w %2 == 0){
		return (w/2)*h;
	}
	
	long long int mi = min(h,w);
	long long int ma = max(h,w);
	return (ma/2)*mi;
	
}

long long int calcRes(long long int rect1,long long int rect2,long long int rect3){
	long long int ma = max(rect1,max(rect2,rect3));
	long long int mi = min(rect1,min(rect2,rect3));
	
	return ma - mi;
}

int main() {
	long long int h,w;
	cin >> h >> w;
	
	long long int allSum = h*w;
	long long int res = h*w;
	for(long long int i=1;i<h;++i){
		long long int rect1 = w*i;
		long long int rect2 = divide(w,h-i);
		long long int rect3 = allSum - rect1 - rect2;
		
		res = min(res,calcRes(rect1,rect2,rect3));
	}
	
	for(long long int i=1;i<w;++i){
		long long int rect1 = h*i;
		long long int rect2 = divide(w-i,h);
		long long int rect3 = allSum - rect1 - rect2;
		
		res = min(res,calcRes(rect1,rect2,rect3));
	}
	
	cout << res <<endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main() {
    char S[11],T[12];
    int i;
    
    scanf("%s %s",S,T);
    
    for (i = 0;S[i] != '\0';i++){
        if (S[i] != T[i]){
            printf("No\n");
            return 0;
        }
    }

    printf("Yes\n");
    return 0;
}


Measured memory_bytes: 1588
#include <iostream>
#include <cstdio>
#include <math.h>

using namespace std;

typedef long long int ll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
const int MOD = 1000000007;
const int INF = INT_MAX;



int main(int argc, char const *argv[])
{
    
    
    ll h, n;
    cin >> h >> n;
    ll a[n];
    for (int i=0; i < n; i++){
        cin >> a[i];
    }

    ll sum = 0;
    for (int i=0; i < n; i++){
        sum += a[i];
    }
    if (sum < h){
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
    }

    



    return 0;
}




//              g++ -std=c++1z  

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

int main(){
  int n;cin >> n;
  vector<int> a(n),l(n+1),r(n+2);
  rep(i,n){
    cin >> a[i];
    l[i+1] = __gcd(l[i],a[i]);
  }
  for(int i = n;i >= 1;i--){
    r[i] = __gcd(r[i+1],a[i-1]);
  }
  //rep(i,n)  cout << r[i+1] << endl;
  int ans = 0;
  rep(i,n){
    ans = max(ans,__gcd(l[i],r[i+2]));
  }

  cout << ans << endl;
}

Measured memory_bytes: 4580
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int s,w;
	cin>>s>>w;
	if(w>=s)
		cout<<"unsafe";
	else
		cout<<"safe";
	return 0;
}

Measured memory_bytes: 3648
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<math.h>
#include<map>
typedef long long int ll;
using namespace std;
#define maxn 0x3f3f3f3f
const ll o=1e18;
const int mm=1e6;
ll d[mm];
ll dd[mm];
ll ans[mm];
int main()
{
	ll n,m,i,j,k,kk,a,b,t,ss,s;
	cin>>n;
    s=0;
    for(i=1;i<=n;i++)
    {
    	if(i%3!=0&&i%5!=0)
    	s+=i;
	}
	cout<<s<<endl;
}


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

int main() {

    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);  
    long long x;
    cin>>x;
    long long start = 100;
    long long count = 0;
    while(start <= x) {
    	count++;
    	start += 0.01 * start;
    	if(start == x)
    		break;
    }
    cout<<count;


	return 0;		
}


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

#define FAST_IO                       \
	ios_base::sync_with_stdio(false); \
	cin.tie(0);                       \
	cout.tie(0);

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;

const int MOD = 1e9 + 7;

int main()
{

	FAST_IO;


	int A, B;
	cin >> A >> B;
	for (int i = 1; i <= 1000; ++i) {
		if (floor(i * 0.1) == B && floor(i * 0.08) == A) {
			cout<<i;
			return 0;
		}
	}
	cout<<"-1";
	return 0;
}


Measured memory_bytes: 256
import Control.Applicative
import Data.List
import Control.Monad
strToInt s = (read :: String -> Int) s

main :: IO ()
main = do
    -- スペース区切り整数の入力
    [n, a, b] <- map strToInt . words <$> getLine

    putStrLn . show . sum $ filter (\n ->(sumOfDs n) >= a && (sumOfDs n) <= b) [1..n]

sumOfDs :: Int -> Int
sumOfDs n = sum . map (`mod` 10) $ zipWith div (repeat n) [10^a | a <- [0..4]]


Measured memory_bytes: 636
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define Rep1(i,k,n) for(int i=k ; i<=n ; i++)
#define rrep(i,n) for(int i=n ; i>=0 ; i--)
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
//#define int ll
typedef long long ll;

const int md = 1000000007;
const int INF = 1<<30;
using namespace std;


int main(){
    ll r,d,x; cin >> r >> d >> x;

    rep(i,10){
        x = r * x - d;
        cout << x << endl;
    }



}


Measured memory_bytes: 256
import scala.io.StdIn

object Main extends App {

  val n = StdIn.readInt
  val f = Iterator.continually(StdIn.readLine)
    .take(n)
    .map(_.split(" ").map(_.toInt))
    .toArray
  val p = Iterator.continually(StdIn.readLine)
    .take(n)
    .map(_.split(" ").map(_.toInt))
    .toArray

  var ans = Int.MinValue

  for(key <- 1 until 1 << 10) {
    var score = 0
    for(i <- 0 until n) {
      var d = 0
      for(j <- 0 until 10) {
        if(((key>>j & 1) & f(i)(j)) == 1) d += 1
      }
      score += p(i)(d)
    }
    if(ans < score) ans = score
  }
  
  println(ans)
}

Measured memory_bytes: 35528
h, w = gets.split.map(&:to_i)
arr = Array.new(w + 1){[0, 0]}
ans = 0

h.times do |i|
    s = gets
    k = 0
    (w + 1).times do |j|
        if s[j] == "."
            arr[j][0] += 1
        else
            k.upto(j-1) {|l| arr[l][1] = j - k if arr[l][1] < j - k}
            k = j + 1
            ans < (sum = arr[j][0] + arr[j][1]) and ans = sum
            arr[j] = [0, 0]
        end
    end
end

arr.each {|a, b| ans = a + b if ans < a + b}
puts ans - 1

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}  

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n,a,b;cin>>n>>a>>b;
  vector<ll>p(n);
  rep(i,0,n){
    cin>>p[i];p[i]--;
  }
  vector<ll>idx(n);
  rep(i,0,n)idx[p[i]]=i;
  auto dp=vec(n+1,n+1,INF);
  //dp[i][j]小さい方からi個目まで見て左からj個目まで右に移動を選択
  dp[0][0]=0;
  vector<ll>s(n,1);
  rep(i,0,n){
    s[idx[i]]=0;
    vector<ll>t(n+1);
    rep(j,0,n)t[j+1]=t[j]+s[j];
    rep(j,0,n+1){
      if(dp[i][j]==INF)continue;
      if(idx[i]<=j)chmin(dp[i+1][j],dp[i][j]);
      else{
        chmin(dp[i+1][j],dp[i][j]+b);
        chmin(dp[i+1][idx[i]+1],dp[i][j]+a*(t[idx[i]+1]-t[j]));
      }
    }
  }
  //debug(dp,n+1,n+1);
  cout<<*min_element(ALL(dp[n]))<<endl;;
  return 0;
}

Measured memory_bytes: 195968
#include<iostream>
#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
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
   ll dp[2000000];
 int gcd(int a, int b)
{
  if (a%b == 0)
{
return(b);
}
else
{
return(gcd(b,a%b));
}
}
  vector<vector<bool>>d(5001,vector<bool>(5001));
int main(){
  string a;cin>>a;
  if(a[0]==a[2])cout<<"Yes";
  else cout<<"No";
}



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

int main(){
    int N;
    cin >> N;
    string *str;
    str = new string[N];
    long long number[5];
    for(int i=0;i<5;i++) number[i] = 0;
    for(int i=0;i<N;i++){
        cin >> str[i];
        if(str[i][0]=='M') number[0] ++;
        else if(str[i][0]=='A') number[1] ++;
        else if(str[i][0]=='R') number[2] ++;
        else if(str[i][0]=='C') number[3] ++;
        else if(str[i][0]=='H') number[4] ++;
    }
    long long p,q,r,s,t;
    p = number[0];
    q = number[1];
    r = number[2];
    s = number[3];
    t = number[4];
    long long answer = (long long)(p * (q*(r+s+t)+r*(s+t)+s*t) + q * (r*(s+t)+s*t) + r*s * t);
    cout << answer<<"\n";
    return 0;
}

Measured memory_bytes: 6144
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>

using namespace std;

int N, R;

int main(void) {

	cin >> N >> R;
	int ans = R;

	if (N <= 9) { ans += 100 * (10 - N); }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define VI vector<int> 
#define SI set<int>
#define QI queue<int> 
#define PII pair<int, int>
#define MP make_pair
#define PB push_back
#define REP(i,a,b) for(int i = a; i < b; ++i)
#define F for(int i = 0; i < n; ++i)
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long int
#define M 1000000007
using namespace std;

int main() 
{
    int n; cin>>n;
    if (n >= 30)
    {
        cout<<"Yes"<<endl;
    }
    else cout<<"No"<<endl;

    return 0;
}

Measured memory_bytes: 3672
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let n: usize = read();
    let mut a: Vec<i32> = (0..n).map(|_| read()).collect();

    let mut alice = 0;
    let mut bob = 0;

    a.sort();
    a.reverse();

    for (i, &a_i) in a.iter().enumerate() {
        if i % 2 == 0 {
            alice += a_i;
        } else {
            bob += a_i;
        }
    }
    println!("{}", alice - bob);
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}



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

int main(){
  int W, H;
  while(1){
    cin >> H >> W;
    cin.ignore();
    if((H == 0)&&(W == 0)){
      break;
    }
    else{
      for(int j = 0;j < H;j++){
	for(int k = 0;k < W;k++){
	  if((j+k)%2 == 0){
	    cout << "#";
	  }else{
	    cout << ".";
	  }
	}
	cout << endl;
      }
      cout << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3052
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<bitset>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
typedef long long ll;
typedef long double ld;
#define str string
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
ll ari(ll a, ll b, ll c) {
	return (a + b)*c / 2;
}//等差数列の和
ll fact(ll x, ll k, ll p) {//最大値、個数、あまり
	ll sum = 1;
	for (int i = 0; i < k; i++) {
		sum *= (x--);
		sum %= p;
	}
	return sum;
}//階乗(正）
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res*x%p;
		x = x*x%p;
		n >>= 1;
	}
	return res;
}//x^n%p
int ctoi(char a) {
	return (int)a - '0';
}
#define int long long
const long long Inf = 4523372036854775807;
const int inf = 15000000000;
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
int a[26];
signed main() {
	string s;
	while(cin>>s){
		for(int i=0;i<s.size();i++){
			if(s[i]>='A'&&s[i]<='Z'){
				s[i]=(char)((int)s[i]+(int)'a'-'A');
			}
			if(s[i]>='a'&&s[i]<='z')
				a[(int)s[i]-'a']++;
		}
	}
	for(int i=0;i<26;i++){
		printf("%c : %d\n",(char)i+'a',a[i]);
	}
}



Measured memory_bytes: 3224
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> s(h);
    for (int i = 0; i < h; i++) {
        cin >> s[i];
    }
    bool possible = true;
    for (int i = 0; i < h && possible; i++) {
        for (int j = 0; j < w && possible; j++) {
            if (s[i][j] == '#') {
                possible = !(((i == 0) || s[i - 1][j] == '.') &&
                             ((j == 0) || s[i][j - 1] == '.') &&
                             ((i == h - 1) || s[i + 1][j] == '.') &&
                             ((j == w - 1) || s[i][j + 1] == '.'));
            }
        }
    }
    cout << (possible ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,m,q;
int a[MAXN],b[MAXN];
string str;
void add(int &a,int b) {a+=b; if(a>=MOD) a-=MOD;}
void dec(int &a,int b) {a-=b; if(a<0) a+=MOD;}
int pow_mod(int a,int i)
{
    int s=1;
    while(i)
    {
        if(i&1) s=1LL*s*a%MOD;
        a=1LL*a*a%MOD;
        i>>=1;
    }
    return s;
}
int main()
{
    scanf("%d%d%d",&n,&m,&q);
    int ans=INF;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=m;i++) scanf("%d",&b[i]);
    for(int i=0;i<q;i++)
    {
        int u,v,w;
        scanf("%d%d%d",&u,&v,&w);
        ans=min(ans,a[u]+b[v]-w);
    }
    sort(a+1,a+n+1);
    sort(b+1,b+m+1);
    ans=min(ans,a[1]+b[1]);
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int main()
{
int grid[10];
for (int i=1; i <10;i++)cin>>grid[i];
if(grid[1]-grid[4]==grid[2]-grid[5]&&grid[2]-grid[5]==grid[3]-grid[6]&&grid[1]-grid[7]==grid[2]-grid[8]&&grid[2]-grid[8]==grid[3]-grid[9]&&grid[4]-grid[7]==grid[5]-grid[8]&&grid[5]-grid[8]==grid[6]-grid[9]){

    cout<<"Yes";
}
else cout <<"No";



    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define MAX 1000000

int data[MAX];
void insert() {
	int i;
	for (i = 0; i < MAX; ++i) {
		data[i] = i;
	}
}
int find(int a) {
	if (a == data[a]) {
		return a;
	}
	return data[a] = find(data[a]);
}
int search(int a, int b) {
	if (find(a) == find(b)) {
		return 1;
	} else {
		return 0;
	}
}
void swap(int a, int b) {
	a = find(a);
	b = find(b);
	if (a == b) return;
	data[b] = a;
}
int main() {
	int n, m, q, i, j, k;

	insert();
	scanf("%d %d", &n, &m);
	for (i = 0 ; i < m ; ++i) {
		scanf("%d %d", &j, &k);
		swap(j, k);
	}
	scanf("%d", &q);
	for (i = 0 ; i < q ; i++) {
		scanf("%d %d", &j, &k);
		if (search(j, k)) {
			printf("yes\n");
		} else {
			printf("no\n");
		}
	}
	return 0;
}



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

int main(){
long long n,k,s=0;
cin >> n>>k;
long long h[n];
rep(i,n)cin>>h[i];
sort(h,h+n);
rep(i,n-k){
    s+=h[i];
}
cout << s<<endl;
return 0;
}


Measured memory_bytes: 1792
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

def main():
    N, A, B = map(int, input().split())
    
    sum = 0

    for n in range(N+1):
        tmp = digitSum(n)
        if A <= tmp and tmp <= B:
            sum += n

    print(sum)

if __name__ == '__main__':
    main()


Measured memory_bytes: 41324
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception{
		int num = 998244353;

		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
 		int n = Integer.parseInt(bf.readLine());
 		StringTokenizer st = new StringTokenizer(bf.readLine());
 		int[] array = new int[n];
 		for(int j =0;j<n;j++){
 			array[j] = Integer.parseInt(st.nextToken());
 		}
 		StringTokenizer st1 = new StringTokenizer(bf.readLine());
 		int[] newarray = new int[n];
 		for(int j = 0;j<n;j++){
 			newarray[n-1-j] = Integer.parseInt(st1.nextToken());
 		}
 		int start = Integer.MAX_VALUE;
 		int end = -1;
 		int val = 0;
 		for(int j =0;j<n;j++){
 			if (array[j] == newarray[j]){
 				start = Math.min(start,  j);
 				val = array[j];
 				end = Math.max(end,  j);
 			}
 		}
 		
 		int curr = 0;
 		ArrayList<Integer> indices = new ArrayList<Integer>();
 		for(int j = 0;j<n;j++){
 			if ((j < start || j > end) && array[j]!= val && newarray[j]!= val){
 				indices.add(j);
 			}
 		}
 		if (indices.size() >= end-start+1){
 			out.println("Yes");
 			for(int j = start;j<=end;j++){
 				//swap indices.get(j-start) and j
 				int temp = newarray[j];
 				newarray[j] = newarray[indices.get(j-start)];
 				newarray[indices.get(j-start)] = temp;
 			}
 			for(int j : newarray){
 				out.print(j + " ");
 			}
 			out.println();
 		}
 		else{
 			out.println("No");
 		}
 		
 		
 		
 		out.println();
	 		
 		out.close();
 		
 		
 		
 	}
}
 	
 
//StringJoiner sj = new StringJoiner(" "); 
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is

 		
 		
 		
 		
	




Measured memory_bytes: 56024
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll p[2000005],a[2000005],n;
int main(){
	scanf("%lld",&n);
	for(ll i=0;i<n;i++){
		scanf("%lld",&a[i]);
		p[a[i]]++;
	}
	ll sum=0;
	for(ll i=0;i<2000001;i++){
		sum+=p[i]*(p[i]-1)/2;
	}
	for(ll i=0;i<n;i++){
		ll ans=sum-p[a[i]]*(p[a[i]]-1)/2;
		ans+=(p[a[i]]-1)*(p[a[i]]-2)/2;
		printf("%lld\n",ans);
	}
	return 0;
}

Measured memory_bytes: 8192
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int main()
{
    int N;
    string c;
    cin >> N >> c;
    queue<int> r;
    queue<int> w;
    int ans = 0;
    REP(i,N){
        if('W' == c[i])w.push(i);
        if('R' == c[N-1-i])r.push(N-1-i);
    }
    int M = min((int)r.size(),(int)w.size());
    REP(i,M){
        if(r.front() > w.front()){
            ans++;
            r.pop();
            w.pop();
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 4372
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm>
#include <numeric>
#include <typeinfo>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

void explode(vs& field,int x,int y)
{
	field[y][x]='0';
	for(int i=1;i<=3;i++){
		int nx,ny;
		nx=x+i;ny=y;
		if(0<=nx && nx<8 && 0<=ny && ny<8 && field[ny][nx]=='1')
			explode(field,nx,ny);
		nx=x-i;ny=y;
		if(0<=nx && nx<8 && 0<=ny && ny<8 && field[ny][nx]=='1')
			explode(field,nx,ny);
		nx=x;ny=y+i;
		if(0<=nx && nx<8 && 0<=ny && ny<8 && field[ny][nx]=='1')
			explode(field,nx,ny);
		nx=x;ny=y-i;
		if(0<=nx && nx<8 && 0<=ny && ny<8 && field[ny][nx]=='1')
			explode(field,nx,ny);
	}
}

int main()
{
	int n;
	cin>>n;
	for(int tc=1;tc<=n;tc++){
		vs field(8);
		rep(i,8)
			cin>>field[i];
		int x,y;
		cin>>x>>y;
		explode(field,x-1,y-1);
		cout<<"Data "<<tc<<":"<<endl;
		rep(i,8)
			cout<<field[i]<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
//        long startTime = System.currentTimeMillis();
        Scanner scanner = new Scanner(System.in);
        int P = scanner.nextInt();
        int Q = scanner.nextInt();
        int R = scanner.nextInt();
        scanner.close();

        int min =Integer.MAX_VALUE;

        min = Math.min((P+Q),min);
        min = Math.min((Q+R),min);
        min = Math.min((R+P),min);

        System.out.println(min);

//        System.out.println(System.currentTimeMillis() - startTime);
    }

}


Measured memory_bytes: 23764
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)
	s := getString()

	prev := s[0]
	pos := 0
	cnt := 0
	a := make([]int, len(s))
	for i := 0; i < len(s); i++ {
		// out(string(s[i]))
		if s[i] == prev {
			cnt++
		} else if s[i] == 'L' {
			// out("L", i, cnt)
			a[i-1] += cnt/2 + cnt%2
			a[i] += cnt / 2
			prev = 'L'
			pos = i
			cnt = 1
			// out(a)
		} else {
			// out(i, pos, cnt)
			a[pos-1] += cnt / 2
			a[pos] += cnt/2 + cnt%2
			prev = 'R'
			cnt = 1
			pos = 0
			// out(a)
		}
	}
	// out(pos)
	a[pos-1] += cnt / 2
	a[pos] += cnt/2 + cnt%2

	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	for i := 0; i < len(s); i++ {
		fmt.Fprint(w, a[i], " ")
	}
	fmt.Fprintln(w)
}


Measured memory_bytes: 4352
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

bool palindrome(string s){
    int cnt=0;
    for(int i=0;i<s.size()/2;i++)
      if(s[i]==s[s.size()-i-1])cnt++;

    if(cnt==s.size()/2)return true;
    else return false;
}

int main(void){
  string s;
  int ans=0;
  while(cin >> s)
    if(palindrome(s))ans++;

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1188
n=int(input())
arr=[int(i) for i in input().strip().split(" ")]
arr=sorted(arr)
arr=arr[::-1]
# newArr=[arr[0]]
ans=0
# for i in range(1,n//2):
#     newArr.append(arr[i])
#     newArr.append(arr[i])
for i in range(1,n):
    # print()
    ans+=arr[i//2]
print(ans)






Measured memory_bytes: 31548
#include <iostream>

using namespace std;

//
const int MAX = 25;
const int NIL = -1;

struct Node {
    int parent = NIL;
    int left = NIL;
    int right = NIL;
};

Node T[MAX];

//
void preorder(int u) {
    cout << " " << u;
    if (T[u].left != NIL) preorder(T[u].left);
    if (T[u].right != NIL) preorder(T[u].right);
}

void inorder(int u) {
    if (T[u].left != NIL) inorder(T[u].left);
    cout << " " << u;
    if (T[u].right != NIL) inorder(T[u].right);
}

void postorder(int u) {
    if (T[u].left != NIL) postorder(T[u].left);
    if (T[u].right != NIL) postorder(T[u].right);
    cout << " " << u;
}

//
int main() {

    int n;
    cin >> n;

    for (int i = 0; i < n; i++) {
        int id;
        cin >> id;
        cin >> T[id].left;
        cin >> T[id].right;
        T[T[id].left].parent = T[T[id].right].parent = id;
    }

    for (int i = 0; i < n; i++) {
        if (T[i].parent == NIL) {
            //
            cout << "Preorder" << endl;
            preorder(i);
            cout << endl;
            //
            cout << "Inorder" << endl;
            inorder(i);
            cout << endl;
            //
            cout << "Postorder" << endl;
            postorder(i);
            cout << endl;
        }
    }
}


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

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

int n, m, K;
vector<int> g[N];

int low[N], ord[N];
stack<pair<int, int>> stk;
vector<vector<pair<int, int>>> cc;

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

int add(int x, int y) {
	x += y;
	return x >= mod ? x - mod : x;
}

int mul(int x, int y) {
	return int64_t(x) * y % mod;
}

int modpow(int a, long long b) {
	if (b == 0) return 1;
	return mul(modpow(mul(a, a), b / 2), b & 1 ? a : 1);
}

int modinv(int a) {
	return modpow(a, mod - 2);
}

void dfs(int u, int p, int &k) {
	low[u] = ord[u] = k++;

	for (int v : g[u]) {
		if (ord[v] == -1) {
			stk.emplace(u, v);
			dfs(v, u, k);
			low[u] = min(low[u], low[v]);
			if (p == -1 || ord[u] <= low[v]) {
				cc.push_back(vector<pair<int, int>>());
				while (!stk.empty()) {
					auto e = stk.top();
					stk.pop();
					cc.back().emplace_back(e);
					if (e.first == u) break;
				}
			}
		} else if (v != p && ord[v] < ord[u]) {
			stk.emplace(u, v);
			low[u] = min(low[u], ord[v]);
		}
	}
}

int main() {
	cin >> n >> m >> K;

	for (int i = 0; i < m; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		u--; v--;
		g[u].push_back(v);
		g[v].push_back(u);
	}

	memset(ord, -1, sizeof(ord));
	int k = 0;

	for (int i = 0; i < n; i++) {
		if (ord[i] == -1) dfs(i, -1, k);
	}

	static int C[500][500];
	for (int i = 0; i < 500; i++) {
		for (int j = 0; j <= i; j++) {
			if (i == 0 || j == 0) C[i][j] = 1;
			else C[i][j] = add(C[i - 1][j - 1], C[i - 1][j]);
		}
	}

	int ans = 1;
	for (auto c : cc) {
		int m = c.size();

		if (m == 1) {
			ans = mul(ans, K);
			continue;
		}
		
		set<int> vs;
		for (auto e : c) {
			vs.insert(e.first);
			vs.insert(e.second);
		}
		
		if (m == vs.size()) {
			int sum = 0;
			for (int i = 0; i < m; i++) {
				sum = add(sum, modpow(K, gcd(m, i)));
			}
			sum = mul(sum, modinv(m));
			ans = mul(ans, sum);
		} else {
			// H(k,m)=C(k+m-1,m)
			ans = mul(ans, C[K + m - 1][m]);
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forin(in, n) for(int i=0; i<n; i++) cin>>in[i]
#define forout(out, n) for(int i=0; i<n; i++) cout<<out[i]<<endl
#define rep(i, n) for(int i=0; i<(n); i++)

int main(){
    int n, m; cin>>n>>m;
    vector<int> h(n);

    forin(h, n);

    vector<bool> good(n, true);

    rep(i, m){
        int a, b;
        cin>> a >> b;
        a--;
        b--;

        if(h[a] <= h[b]) good[a] = false;
        if(h[b] <= h[a]) good[b] =false;
    }
    int ans=0;
    rep(i, n) if(good[i]) ans++;

    cout<<ans<<endl;
}

Measured memory_bytes: 3780
#include<iostream>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstring>
#include<climits>
#include<deque>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<chrono>
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> p64;
typedef vector<ll> v64;
const int N = 2 * 1e5 + 10;
const ll inf = 1e18 + 100;
const ll mod = 1e9 + 7;
 
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i,s,e) for(long long i=s;i<=e;i++)
#define brep(i,s,e) for(long long i=s;i>=e;i--)
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x))
#define DANGER std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
 
void solve() {
    ll a, b;
    cin>>a>>b;
    if(a > b) {
        for(int i = 0; i < a ;i++) {
            cout<<b;
        }
    } else {
        for(int i = 0 ; i < b; i++) {
            cout<<a;
        }
    }
}
int main()
{
    ll t = 1;
    //cin>>t;
    while(t--) {
        solve();
    }
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n;
long long k;
int a[N], lst[N], nxt[N];
long long used[N];
int main() {
	scanf("%d%lld", &n, &k);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	for (int i = 1; i <= 200000; i++) lst[i] = n + 1;
	for (int i = n; i >= 1; i--) {
		nxt[i] = lst[a[i]];
		lst[a[i]] = i;
	}
	long long cnt = 1, id = 1;
	while (true) {
		if (!used[id]) {
			used[id] = cnt;
		} else {
			long long x1 = used[id], x2 = cnt;
			long long want = (k - x1) % (x2 - x1) + x1;
			int gay = 0;
			for (int i = 1; i <= 200000; i++) if (used[i] == want) {gay = i; break;}
			cnt = k;
			id = gay;
			break;
		}
		if (nxt[id] == n + 1) {
			if (cnt == k) {
				break;
			}
			cnt++;
			id = lst[a[id]];
		} else {
			id = nxt[id];
		}
		id++;
		if (id == n + 1) {
			if (cnt == k) {
				return 0;
			}
			cnt++;
			id = 1;
		}
	}
	while (true) {
		if (id > n) break;
		if (nxt[id] <= n) {
			id = nxt[id] + 1;
		} else {
			printf("%d ", a[id]);
			id++;
		}
	}
	return 0;
}

Measured memory_bytes: 5120
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		String ans="";
		while(n!=0){
			if(n%2!=0){
				n--;
				ans="1"+ans;
			}else{
				ans="0"+ans;
			}
			n/=-2;
		}
		if(ans==""){
			ans="0";
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23252