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

//using namespace __gnu_pbds;
using namespace std;

#define sz(x)                 x.size()
#define all(x)                x.begin(), x.end()
#define tr(x, it)             for(auto it = x.begin();it != x.end();it++)
#define fo(i, k, n)           for(int i = k;i < n;i++)
#define Fo(i, k, n)           for(int i = k;i >= n;i--)
#define el                    "\n"
#define ff                    first
#define ss                    second
#define ll                    long long
#define pb                    push_back
#define mp                    make_pair
#define pii                   pair<int, int>
#define vi                    vector<int>
#define mii                   map<int, int>
//#define pqb                   priority_queue<int>
//#define pqs                   priority_queue<int, vi, greater<int>>
//#define pc(x)                 putchar(x);
//#define setbits(x)            __builtin_popcountll(x)
//#define zrobits(x)            __builtin_ctzll(x)
#define mod                   1000000007
#define inf                   1e18
#define deb(x)                cout<<#x<< " = "<< x<<"\n";
//#define ps(x, y)              fixed<<setprecision(y)<<x
//#define mk(arr, n, type)      type *arr = new type[n];
//#define w(x)                  int x; cin>>x; while(x--)

void solve(){
	int n;  cin>>n;
	string a = "AC", b = "WA", c = "TLE", d = "RE";
	int an = 0, bn = 0, cn = 0, dn = 0;
	while(n--){
		string s;
		cin>>s;
		if(s == a) an++;
		if(s == b) bn++;
		if(s == c) cn++;
		if(s == d) dn++;
	}
	cout<<"AC x "<<an<<el;
	cout<<"WA x "<<bn<<el;
	cout<<"TLE x "<<cn<<el;
	cout<<"RE x "<<dn<<el;
}

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t = 1;
//	cin>>t;
	while(t--){
		solve();
		cout<<el;
	}
	return 0;
}


Measured memory_bytes: 3612
N, T = map(int, input().split())
c = []
for _ in range(N):
  x, y = map(int, input().split())
  c.append([x, y])

cost = [10001]
for i in range(N):
  if c[i][1] <= T:
    cost.append(c[i][0])

if min(cost) == 10001:
  print("TLE")
else:
  print(min(cost))

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

const int N = 2e5 + 10, mod = 1e9 + 7;



int main() {
    // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    long long n, k; cin >> n >> k;
    n %= k;
    cout << min(n, k - n) << '\n';
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
	int k, n;
	int max=0;
	vector<int> l(50);
	cin >> n>>k;
	for (int i = 0; i <n; i++) {
		cin >> l[i];
	}
	sort(l.begin(), l.end(), greater<int>());
	for (int i = 0; i < k; i++) {
		max += l[i];
	}
	cout << max;
}

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


int main(){
	double a,b,c,d,l,ac,bd,ans;
	scanf("%lf%lf%lf%lf%lf",&l,&a,&b,&c,&d);
	ac = ceil(a / c);
	bd = ceil(b / d);
	if(ac < bd){
		ans = l - bd;
	}else{
		ans = l - ac;
	}
	printf("%.0f\n",ans);
	return 0;

}

Measured memory_bytes: 648
// aribon3-3_f
// Range Query - RMQ and RAQ
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_H&lang=jp
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;


// starry sky
template<typename T>
struct LazySegmentTree{ // 区間add, 区間min
    int n;
    vector<T> val;
    vector<T> lazy;
    vector<int> width;

    explicit LazySegmentTree(int n_){
        n = 1;
        while (n < n_) n <<= 1;

        val = vector<T>(n<<1, 0);
        lazy = vector<T>(n<<1, 0);
        width = vector<int>(n<<1, 1);
        for (int i = n-2; i >= 0; i--) {
            width[i] = width[i*2+1] + width[i*2+2];
        }
    }
    void lazy_propagate(int k) {
        val[k] += lazy[k];
        if (k < n-1) {
            lazy[k*2+1] += lazy[k];
            lazy[k*2+2] += lazy[k];
        }
        lazy[k] = 0;
    }
    void add(int a, int b, int k, int l, int r, int x) {
        lazy_propagate(k);

        if (b <= l || r <= a) {
            return;
        }
        if (a <= l && r <= b) {
            lazy[k] += x;
            lazy_propagate(k);
            return;
        }
        int mid = (l+r)/2;
        add(a, b, k*2+1, l, mid, x);
        add(a, b, k*2+2, mid, r, x);
        val[k] = min(val[k*2+1], val[k*2+2]);
    }

    void add(int a, int b, int x) {
        add(a, b, 0, 0, n, x);
    }

    T get_min(int a, int b, int k, int l, int r) {
        lazy_propagate(k);

        if (b <= l || r <= a) {
            return INF;
        }
        if (a <= l && r <= b) {
            return val[k];
        }
        int mid = (l+r)/2;
        T sl = get_min(a, b, k*2+1, l, mid);
        T sr = get_min(a, b, k*2+2, mid, r);
        return min(sl, sr);
    }

    T get_min(int a, int b) {
        return get_min(a, b, 0, 0, n);
    }
};

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int N, Q;
    cin >> N >> Q;

    LazySegmentTree<ll> sst(N);

    REP(i, Q){
        int q;
        cin >> q;
        if (q == 0){
            int s, t, x;
            cin >> s >> t >> x;
            sst.add(s, t+1, x);

        } else {
            int s, t;
            cin >> s >> t;
            ll ans = sst.get_min(s, t+1);
            print(ans);
        }

    }

    return 0;
}



Measured memory_bytes: 8132
#include <iostream>
#include <string>

using namespace std;

int main() {
    string r, g, b;
    cin >> r >> g >> b;

    string s = r + g + b;
    if (stoi(r+g+b) % 4 == 0)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}

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

int main()
{
	char a1,b1,c1,d1;
	int a,b,c,d;
	int t=0;
	scanf("%c%c%c%c",&a1,&b1,&c1,&d1);
	a=(int)(a1-'0');
	b=(int)(b1-'0');
	c=(int)(c1-'0');
	d=(int)(d1-'0');
	if (a+b+c+d==7) t=1;
	else if (a+b+c-d==7) t=2;
	else if (a+b-c+d==7) t=3;
	else if (a-b+c+d==7) t=4;
	else if (a+b-c-d==7) t=5;
	else if (a-b+c-d==7) t=6;
	else if (a-b-c+d==7) t=7;
	else if (a-b-c-d==7) t=8;
	
	switch(t){
	case 1:	printf("%d+%d+%d+%d=7",a,b,c,d);break;
	case 2:	printf("%d+%d+%d-%d=7",a,b,c,d);break;
	case 3:	printf("%d+%d-%d+%d=7",a,b,c,d);break;
	case 4:	printf("%d-%d+%d+%d=7",a,b,c,d);break;
	case 5:	printf("%d+%d-%d-%d=7",a,b,c,d);break;
	case 6:	printf("%d-%d+%d-%d=7",a,b,c,d);break;
	case 7:	printf("%d-%d-%d+%d=7",a,b,c,d);break;
	case 8:	printf("%d-%d-%d-%d=7",a,b,c,d);break;
	default:printf("no answer!");break;
	}
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define INF 2147483647
#define inf 1000000007
#define SYOU(x) setprecision(x)
#define abs(x,y) (max(x,y)-min(x,y))
#define mp make_pair
#define fi first
#define se second
using namespace std;
bool i[111100];
vector<int> ii;
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a,b,c,d=1,e=1,f=0,g=1,h=1,j;
  double w;
  cin >>w;
  a=w;
  if(a%2==1) w=(a/2+1)/w;
  else
  w=w/2/w;
  cout <<fixed<<w<<'\n';
  return (0);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, x) for (ll i = 0; i < (x); i++)

using namespace std;
typedef long long int ll;

const ll OK = 0, NG = 1, DUP = 2;
ll N, ans;
vector<ll> a(1e6 + 1, NG);

int main(void) {
  cin >> N;
  rep(i, N) {
    ll x;
    cin >> x;
    if (a[x] == DUP) 
      a[x] = DUP;
    else if (a[x] == OK)
      a[x] = DUP;
    else
      a[x] = OK;
  }
  for (ll x = 1; x <= 1e6; x++) {
    if (a[x] == NG) continue;
    for (ll y = 2 * x; y <= 1e6; y += x) {
      a[y] = NG;
    }
  }
  for (ll x = 1; x <= 1e6; x++)
    if (a[x] == OK)
      ans++;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 11004
#include <iostream>
#include <algorithm>
#include <functional>
#include <cmath>
#include <string>
#include <vector>
#include <queue>

using namespace std;

int main() {
  string s; cin >> s;
  int q; cin >> q;
  string _s;

  for (int i = 0; i < q; i++) {
    int t; cin >> t;
    if (t == 1) swap(s, _s);
    else {
      int f; char c; cin >> f >> c;
      if (f == 1) _s += c;
      else s += c;
    }
  }
  reverse(_s.begin(), _s.end());
  
  cout << _s + s << endl;
  return 0;
}

Measured memory_bytes: 1248
#include <iostream>
#include <iomanip>

using std::cout;
using std::cin;
using std::endl;

int main(void) {
double r;
cin >> r;
double pi = 3.141592653589793;

cout << std::setprecision(20);
cout << pi * r * r  << " " <<  2 * pi * r << endl; 

return 0;
}

Measured memory_bytes: 3172
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define ALL(n) begin(n),end(n)
#define IN(a, x, b) (a<=x && x<b)
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T CHMIN(T & a, const T b) { return a = (a > b) ? b : a; }

const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);
const long long MOD = 1000000007;

int main(void){
    ll n;
    ll k;
    ll max_nums=0;
    vector<ll> nums;
    cin >> n >> k;
    REP(i,n){
        ll tmp;
        cin >> tmp;
        nums.push_back(tmp);
        CHMAX(max_nums, tmp);
    }
    ll gcd_now = gcd(nums[0], nums[1]);
    for(ll i=2; i<n; i++){
        gcd_now = gcd(gcd_now, nums[i]);
    }

    if( (k%gcd_now == 0) && (k<= max_nums) ){
        cout << "POSSIBLE" <<endl;
    }else{
        cout << "IMPOSSIBLE" <<endl;
    }
    return 0;
}

Measured memory_bytes: 3828
IDENTIFICATION DIVISION.
program-id. kyopuro.

data division.
working-storage section.
01 a pic xxx.
01 b pic xxx.
01 c pic xxx.
01 res pic xxx.

procedure division.
main.
    accept a.
    accept b.
    accept c.
    string
        a(1 : 1)
        b(2 : 1)
        c(3 : 1)
        into res.
    display res.
    end run.

Measured memory_bytes: 636
#include<iostream>
#include<string>
#include<map>
#include<string.h>
#include<vector>
#include<set>
#include<stdio.h>
#include<math.h>
//#include<algothm>
#include<queue>
int n,s[3][105]={ 0 },ans=0;
using namespace std;
int main()
{
	cin>>n;
	for(int i=1;i<=2;i++) 
	{
  	for(int j=1;j<=n;j++)
    { 
  		cin>>s[i][j];
    }
	}
	ans=s[1][1];
	for(int i=1;i<=2;i++)
  {	  
		for(int j=1;j<=n;j++)
		{
		s[i][j]+=max(s[i-1][j],s[i][j-1]);
		}
	}
	cout<<s[2][n]<<endl;
	system("pause");
  return 0;
}	

Measured memory_bytes: 504
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#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++)
using namespace std;

int S[10];
char C[10];

int main(){
  int N, M;
  cin >> N >> M;
  rep(i, M){
    cin >> S[i];
    S[i]--;
    cin >> C[i];
  }

  int ans = 1000;

  rep(i, 10){
    rep(j, 10){
      rep(k, 10){
        bool check = true;
        string a = to_string(stoi(to_string(k) + to_string(j) + to_string(i)));
        rep(m, M){
          if (a[S[m]]!=C[m]) check = false;
        }
        if (check && to_string(stoi(a)).size()==N) ans = min(ans, stoi(a));
      }
    }
  }
  if (ans!=1000) cout << ans << endl;
  else cout << -1 << endl;
}


Measured memory_bytes: 3648
import java.util.Scanner;


	public class Main {
		

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int n = sc.nextInt();
			int[] a = new int[n];
			int[] b = new int[n];
			
			for(int i=0;i<n;i++) {
				a[i] = sc.nextInt();
			}
			
			if(n%2==0) {
				for(int i=n-1;i>0;i-=2) {
					b[(n-i-1)/2]=a[i];
					b[(n+i)/2]=a[i-1];
				}
			}else {
				for(int i=n-1;i>=0;i-=2) {
					b[(n-i-1)/2]=a[i];
					if(i!=0) {
						b[(n+i-1)/2]=a[i-1];
					}
				}
			}
			
			for(int i=0;i<n;i++) {
				if(i!=n-1) {
					System.out.print(b[i]+" ");
				}else {
					System.out.print(b[i]);
				}
				
			}
			
		}
		
		
	}


Measured memory_bytes: 97332
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    for(int i = 1; i < s.length(); i++){
        if(s[i]==s[i-1]){
            cout << "no" << endl;
            return 0;
        }
    }
    cout << "yes" << endl;
    return 0;
}

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

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repp(i, s, e) for (int i = (s); i < (e); i++)
#define all(x) x.begin(), x.end()

#define endl "\n"

void use_cio() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

template <class L, class R>
ostream &operator<<(ostream &os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, vector<T> V) {
  os << "[";
  for (auto x : V) os << x << ", ";
  return os << "]";
}

//--------------------------------------------------//

int main() {
  use_cio();
  int n, k;
  cin >> n >> k;
  if (k > (n - 1) * (n - 2) / 2) return !(cout << "-1\n");
  cout << n - 1 + (n - 1) * (n - 2) / 2 - k << endl;
  rep(i, n - 1) cout << 1 << " " << i + 2 << endl;
  int rem = (n - 1) * (n - 2) / 2 - k;
  repp(i, 2, n + 1) {
    repp(j, i + 1, n + 1) {
      if (rem == 0) exit(0);
      cout << i << " " << j << endl;
      rem--;
    }
  }
}


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

using namespace std;

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)

signed main(){

	lli n,m;
	cin>>n>>m;

	lli data[100];
	REP(i,0,100)data[i]=0;

	REP(i,0,m){
		lli a,b;
		cin>>a>>b;
		a--,b--;
		data[a]++;
		data[b]++;
	}

	REP(i,0,n){
		cout<<data[i]<<endl;
	}


	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
constexpr ll mod = 1e9 + 7;
#define endl '\n'
 
ll Lo(ll A, ll B) {
  ll ans = A;
  B -= ans;
  A = 1;
  assert((B-A)%2==0);
  return ans + (B-A)/2;
}

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
 
  ll N,A,B;
  cin >> N >> A >> B;
  if (A > B) swap(A,B);
  if ((B-A)%2 == 0) {
    cout << (B-A)/2 << endl;
    return 0;
  }
  ll ans = min(B-1, N-A);
  ans = min(ans, Lo(A,B));
  ans = min(ans, Lo(N+1-B,N+1-A));
  cout << ans << endl;
}


Measured memory_bytes: 3628
def factors(N): #約数を全て求める。ただし、順不同
    from collections import deque
    ret = deque()
    middle = int( N**(1/2))
    for i in range(1, middle):
        if N%i == 0:
            ret.append(i)
            ret.append(N//i)
            
    if N%middle == 0:
        ret.append(middle)
        if middle != N//middle:
            ret.append(N//middle)
    return ret

#import sys
#input = sys.stdin.readline
def main():
    N = int( input())
    ans = 0
    F = factors(N)
    for k in F:
        if k == 1:
            continue
        x = N
        while x%k == 0:
            x //= k
        x %= k
        if x == 1:
            ans += 1
    G = factors(N-1)
    for k in G:
        if k == 1:
            continue
        x = N
        while x%k == 0:
            x //= k
        x %= k
        if x == 1:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()


Measured memory_bytes: 39152
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        int N = ni();
        int K = ni();
        if(K==0){
            out.println(N*1L*N);
            return;
        }
        long ans = 0;
        for (int b = K+1; b <= N; b++) {
            ans += (N/b) * (b-K);
            if(N%b!=0) ans += Math.max(0,N%b - (K-1));
            // System.out.println(ans);
        }
 
        out.println(ans);
    }

    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);

    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 32864
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp6
{
    class Program
    {
        static void Main(string[] args)
        {
            var imp = Console.ReadLine().Split(' ');
            int A = int.Parse(imp[0]);
            int B = int.Parse(imp[1]);
            int C = int.Parse(imp[2]);
            if (A <= C && C <= B)
            {
                Console.Write("Yes");
            }
            else if (B <= C && C <= A)
            {
                Console.Write("Yes");
            }
            else
            {
                Console.Write("No");
            }
        }
    }
}


Measured memory_bytes: 11092
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <queue>
#pragma warning( disable:4996 )
using namespace std;
 
#define SWAP(a,b) (a += b,b = a - b,a -= b)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
 
long long f_gcd(long long a, long long b) {
	if (a < b)return f_gcd(b, a);
	long long r;
	while (r = a % b) {
		a = b;
		b = r;
	}
	return b;
}
 
int is_prime(long long n) {
	if (n == 2)return 1;
	for (int i = 2; i < sqrt(n) + 1; i++) {
		if (n % i == 0) {
			return 0;
		}
	}
	return 1;
}
#define MAX 10000000
int main(void) {
	long long a, b, count = 0;
	scanf("%lld %lld", &a, &b);
	long long gcd = f_gcd(a, b);
	long long list[100000];
	for (long long i = 2; i * i <= gcd; i++) {
		if (gcd % i == 0) {
			list[count] = i;
			count++;
			while (gcd % i == 0) { gcd /= i; }
		}
	}
	if (gcd != 1) {
		list[count] = gcd;
		count++;
	}
	printf("%lld\n", count+1);
	return 0;
}

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

int main()
{
  int k,x;
  cin>>k>>x;
  
  if(k*500 >= x)
  {
    cout<<"Yes"<<endl;
  }
  
  else 
  {
    cout<<"No"<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
n=int(input())
l=list(map(int,input().split()))

ans=0

if n<3:
  print(ans)

else:
  for x in range(0,n-2):
    for y in range(x,n-1):
      for z in range(y,n):
        if l[x]!=l[y] and l[x]!=l[z] and l[y]!=l[z]:
          if l[x]<l[y]+l[z] and l[y]<l[x]+l[z] and l[z]<l[x]+l[y]:
            ans+=1
            
  print(ans)

Measured memory_bytes: 9212
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define FILL(Itr,n) fill((Itr).begin(),(Itr).end(),n)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;
#define MOD 1000000007

int main(){
    
    int N; cin>>N;
    cout<<800*N-N/15*200<<endl;
    
    
    return 0;
}


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

int main(){
    int  A,B,C;
    long long int X,Y;
    cin >> A >> B >> C;
    cin >> X >> Y;
    int num_x=0;
    int num_y=0;
    int num_dob=0;
    int res_pas=0;
    int res_end=0;
    int result_ini=A*X+Y*B;
    int res_dob_max=0;
    int dob=A+B;
        if(X>Y){
            res_pas=2*C*Y;
            res_dob_max=2*C*X;
            if(A<=2*C){
                res_pas+=A*(X-Y);
            }
            else{
                res_pas+=2*C*(X-Y);
            }
        }
        else{
            res_pas=2*C*X;
            res_dob_max=2*C*Y;
            if(B<=2*C){
                res_pas+=B*(Y-X);
            }
            else{
                res_pas+=2*C*(Y-X);
            }
        }
    if(res_pas>0){
    if(result_ini>=res_pas){
        result_ini=res_pas;
    }
}
    if(res_dob_max>0){
    if(result_ini>=res_dob_max){
        result_ini=res_dob_max;
    }
}
    res_end=result_ini;
    cout << res_end <<endl;
}

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

typedef long long ll;
typedef pair<int,int> P;
#define INF 1000000100
#define rep(i,n) for (int i=0;i<n;i++)

int main(){
    int N;
    cin >> N;
    cout << pow(N,3) << endl;
    return 0;
}

Measured memory_bytes: 3604
// -*- coding: utf-8 -*-
// Last-Updated : <2014/06/20 08:35:59 by samui>

#include <algorithm>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <bitset>

#define MP(a, b) std::make_pair(a, b)
#define X first
#define Y second
#define rep(i,n) for(int (i) = 0; (i) < (int)(n); ++(i))
#define rer(i,l,n) for(int (i) = l; (i) <= (int)(n); ++(i))
#define reu(i,l,n) for(int (i) = l; (i) < (int)(n); ++(i))
template<typename T,typename U> inline void amin(T &x,U y){ if(y<x) x = y;}
template<typename T,typename U> inline void amax(T &x,U y){ if(x<y) x = y;}
template<typename TYPE,std::size_t SIZE>
std::size_t len(const TYPE (&array)[SIZE]){return SIZE;}

// 幾何ライブ
typedef long double LD;
const LD INF = 1e100;
const LD EPS = 1e-8;
const LD PI = acos(-1);
typedef std::pair<LD,LD> PLD;
typedef std::vector<std::pair<LD,LD>> VPLD2;

class Point{
public:
  LD x,y;
  Point(LD x = 0,LD y = 0): x(x),y(y){ };
  Point operator + (Point p) {return Point(x+p.x,y+p.y);};
  Point operator - (Point p) {return Point(x-p.x,y-p.y);};
  Point operator * (LD a) {return Point(x*a,y*a);};
  Point operator / (LD a) {return Point(x/a,y/a);};
  LD abs(){return std::sqrt(x*x+y*y);};
  Point unit(){LD u = abs();return Point(x,y)/u; };
};
typedef Point Vector2D;
LD dotProduct(const Vector2D a,const Vector2D b){
  return a.x*b.x+a.y*b.y;
}
LD crossProduct(const Vector2D a, const Vector2D b){return a.x*b.y-a.y*b.x;}
LD angle(Vector2D a,Vector2D b){
  return acos(dotProduct(a,b)/(a.abs()*b.abs()));
}
LD norm(Vector2D a){return a.x*a.x+a.y*a.y;}
Point projection(Point a1,Point a2,Point a3){
  // 点a3にたいする線分a1-a2上への射影をもとめる。
  LD d = dotProduct(a3-a1,a2-a1)/norm(a2-a1);
  return (a1+(a2-a1)*d);
}
Point reflection(Point a1,Point a2,Point a3){
  return (a3+(projection(a1,a2,a3)-a3)*2);
}
int ccw(Point a1,Point a2,Point a3){
  Vector2D a = a2-a1;
  Vector2D b = a3-a1;
  if(crossProduct(a,b) > EPS) return 1; // a1,a2,a3が反時計まわり
  if(crossProduct(a,b) < -EPS) return -1;//a1,a2,a3が時計まわり
  if(dotProduct(a,b) < -EPS) return +2; //a3--a1--a2 で直線
  if(norm(a)< norm(b)) return -2; // a1--a2--a3 の順で直線
  return 0; // a1--a3--a2の順番
}


int main(int argc, char *argv[])
{
  int a[45];
  a[0] = 0;
  a[1] = 1;
  reu(i,2,46){
    a[i] = a[i-1]+a[i-2];
  }
  int t;
  std::cin>>t;
  std::cout<<a[t+1]<<std::endl;

  return 0;
}

Measured memory_bytes: 1160
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("1 3 2");
            //Yes
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("6 5 4");
            //No
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("2 2 2");
            //Yes
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] wkArr = InputList[0].Split(' ').Select(X => int.Parse(X)).ToArray();

        int A = wkArr[0];
        int B = wkArr[1];
        int C = wkArr[2];

        if (A <= C && C <= B)
            Console.WriteLine("Yes");
        else Console.WriteLine("No");
    }
}


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

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

    if (a == 7 && b == 5 && c == 5 || a == 5 && b == 7 && c == 5 || a == 5 && b == 5 && c == 7) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
def divisors(N):
    U = int(N ** 0.5) + 1
    L = [i for i in range(1, U) if N % i == 0]
    return L + [N // i for i in reversed(L) if N != i * i]

def is_prime(N):
    if N < 2 or N % 2 == 0:
        return (N == 2)
    i = 3
    while i * i <= N:
        if N % i == 0:
            return False
        i += 2
    return True

A, B = map(int, input().split())

if A > B:
    A, B = B, A

D = divisors(A)

ans = 0
for d in D:
    if B % d == 0 and is_prime(d):
        ans += 1

print(ans + 1)


Measured memory_bytes: 3316
import java.util.*;

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

        int n = sc.nextInt();
        int k = sc.nextInt();

        int total = 0;

        boolean[] sunuke = new boolean[n];
        for(int i=0; i<k; i++){
            int d = sc.nextInt();
            for(int j=0; j<d; j++){
                int a = sc.nextInt();
                sunuke[a-1] = true;
            }
        }
        for(boolean i : sunuke){
            if(!i){
                total++;
            }
        }
        System.out.println(total);
    } 
}

Measured memory_bytes: 46388
#include <iostream>
#include <algorithm>
#include <vector>
#include <tuple>
using namespace std;

int main(){
    int N;
    cin>>N;
    int ans=0;
    vector<int> C(N),V(N);
    for(auto &v:V) cin>>v;
    for(auto &c:C) cin>>c;
    for(int i=0;i<N;i++) ans+=max(0,V[i]-C[i]);
    cout<<ans<<endl;


    return 0;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 1e2 + 7;
const int mod = 1e9+7;
int a[N];
int n,ans;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    sort(a+1,a+1+n);
    ans=1e9;
    for(int i=-100;i<=100;i++){
        int now=0;
        for(int j=1;j<=n;j++){
            now+= (a[j]-i)*(a[j]-i);
        }
        ans=min(ans,now);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>
#include <set>
#include <deque>
#include <queue>
#include <bitset>
#include <stack>
#include <regex>

#define mod 1000000007
#define INF2 9999999999
#define INF (1 << 30)
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define P pair<int, int>

using namespace std;
using ll = int64_t;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int DX[] = {1, 1, 0, -1, -1, -1, 0, 1};
int DY[] = {0, -1, -1, -1, 0, 1, 1, 1};

void solve(){
    int n;
    int res = 0;
    cin >> n;
    for(int i = 0; i < n; i++){
        int temp;
        cin >> temp;
        res += temp-1;
    }
    cout << res << endl;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
#define ALL(a)  (a).begin(),(a).end()
const ll INF = 1e18+18;
const ll MAX = 200000;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;

void out(int i){
    if(i==1)cout<<1;
    if(i==-1)cout<<0;
}

int main(){
   ll H, W, A, B;
   cin>>H>>W>>A>>B;
   A;
   B;
   rep(i, H){
       rep(j, W){
           int K=1;
           if(i>=B)K*=-1;
           if(j>=A)K*=-1;
           out(K);
       }
       cout<<endl;
   }
}



Measured memory_bytes: 1280
import Control.Applicative
import Data.List
import qualified Control.Monad as Monad
import Text.Printf

main :: IO ()
main = calcCircle  

calcCircle :: IO()
calcCircle = do 
  input <- getLine  
  let r = read input :: Double
  let s = realToFrac(r) ^ 2 * realToFrac(pi) :: Double 
  let c = realToFrac(r) * 2 * realToFrac(pi) :: Double 
  printf "%.7f %.7f" s c


Measured memory_bytes: 4032
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int
#define pb push_back
#define fi first
#define se second
using namespace std;
const int MOD=1000000007;
const ll MAX=9187201950435737471;
const int N=100005;
const ll INF=1e14;

ll s[102],v[102];
ll dp[102][N];

int main() {
    fastio

    int n,w;
    cin>>n>>w;
    for(int i=1;i<=n;i++){
        cin>>s[i]>>v[i];
    }
    for(int i=1;i<=n;i++){
        for(int j=0;j<=w;j++){
            dp[i][j]=dp[i-1][j];
            if(s[i]<=j){
                dp[i][j]=max(dp[i-1][j],dp[i-1][j-s[i]]+v[i]);
            }
        }
    }

    ll ans=0;
    for(int i=1;i<=n;i++)ans=max(ans,dp[i][w]);
    cout<<ans;
	return 0;
}



Measured memory_bytes: 78464
import collections

N = int(input())

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

Q = int(input())

B = []
C = []
for i in range(Q):
    b, c = map(int,input().split())
    B.append(b)
    C.append(c)

# print(N,A,Q,B,C)


a = []

a = dict(collections.Counter(A))

s = 0
for k in a:
    s += k * a[k]
# print(s)

# sに対する増減だけ管理する

for i in range(Q):
    # 変更後
    after = {B[i]: 0, C[i]: a.setdefault(B[i], 0) + a.setdefault(C[i], 0)}
    # print(a, after)

    s = s + (C[i] - B[i] ) * a[B[i]]

    print(s)

    a.update(after)




Measured memory_bytes: 30664
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<queue>
using namespace std;
using Graph=vector<vector<int>>;
template<class T> inline bool chmax(T &a, T b){ if(a<b){ a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, T b){ if(a>b){ a=b; return 1; } return 0; }

int main(){
    char x;
    cin>>x;
    char t,l;
    t='A';
    l='a';
    /*cout<<(int)t<<endl;
    cout<<(int)l<<endl;*/
    if((int)x>=(int)l) cout<<'a'<<endl;
    else cout<<'A'<<endl;
}

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

string S;
string a;
string b;

vector<string> V;

int main() {
  int N;
  scanf("%d", &N);
  for (int i=0; i<N; i++) {
    cin >> S;
    V.clear();
    for (unsigned int j=1; j<=S.size()-1; j++) {
      a = S.substr(0, j);
      b = S.substr(j, S.size());
      V.push_back(a+b);
      V.push_back(b+a);
      reverse(a.begin(), a.end());
      V.push_back(a+b);
      V.push_back(b+a);
      reverse(b.begin(), b.end());      
      V.push_back(a+b);
      V.push_back(b+a);
      reverse(a.begin(), a.end());
      V.push_back(a+b);
      V.push_back(b+a);
    }
    sort(V.begin(), V.end());
    int count = 0;
    S = "";
    for (unsigned int i=0; i<V.size(); i++) {
      string T = V[i];
      if (S.compare(T) != 0) {
	count++;
	S = T;
      }
    }
    printf("%d\n", count);
  }
}

Measured memory_bytes: 1364
#include <bits/stdc++.h>
    using namespace std;
    #define ll long long int
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int32_t main()
    {
        ll i,j,k,l,n,m,q,t,max1,min1,flag1=0,flag2=0;
        cin>>n>>m;
        if(n<10&&m<10)
        {
            cout<<n*m;
        }
        else
        {
            cout<<-1;
        }
       return 0;
    }






Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define PI 3.1415926535
#define EPS (1e-10)

int main()
{
    ll k, n;
    cin >> k >> n;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    ll maxid = 0;
    for(ll i = 0; i < n - 1; i++){
        if(a[maxid + 1]  -a[maxid] < a[i + 1]  - a[i]) maxid = i;
    }
    ll ans = a[maxid] + k - a[maxid + 1];
    ans = min(a[n - 1] - a[0], ans);
    cout << ans << endl;
}

Measured memory_bytes: 1792
using static System.Math;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System;

class Program
{
    #region Reader
    static string ReadStr => Console.ReadLine();
    static string[] ReadStrs => Console.ReadLine().Split(' ');
    static int ReadInt => Convert.ToInt32(Console.ReadLine().Trim());
    static int[] ReadInts => Console.ReadLine().Trim().Split(' ').Select(s => Convert.ToInt32(s)).ToArray();
    static long ReadLong => Convert.ToInt64(Console.ReadLine().Trim());
    static long[] ReadLongs => Console.ReadLine().Trim().Split(' ').Select(s => Convert.ToInt64(s)).ToArray();
    #endregion
    #region Method
    const int mod = 1000000007;
    public static int Mod(int a, int mod) { return a % mod >= 0 ? a % mod : a % mod + mod; }
    public static long Mod(long a, long mod = mod) { return a % mod >= 0 ? a % mod : a % mod + mod; }
    #endregion

    static void Main()
    {
        string S = ReadStr;
        string T = ReadStr;


        int ans = 1000000;
        for (int s = 0; s < S.Length - T.Length+1; s++)
        {
            int count = 0;
            for (int t = 0; t < T.Length; t++)
            {
                if (S[s + t] != T[t]) count++;
            }
            ans = Min(ans, count);
        }
        WriteLine(ans);
    }
}



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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  
  if(a <= b){
    if(a <= c && c <= b){
    cout << "Yes" << endl;
    }
    else{
    cout << "No" << endl;
    }
  }

  if(b <= a){
    if(b <= c && c <= a){
    cout << "Yes" << endl;
    }
    else{
    cout << "No" << endl;
    }
  }

}


Measured memory_bytes: 256
# 前の提出は1が葉のときまずかったので再提出。

import sys
input = sys.stdin.readline

n,m=map(int,input().split())
W=[0]+list(map(int,input().split()))
E=[tuple(map(int,input().split())) for i in range(m)]
S=1

ELIST=[[] for i in range(n+1)]
EW=[0]*(n+1)

for x,y in E:
    ELIST[x].append(y)
    ELIST[y].append(x)

    EW[x]+=1
    EW[y]+=1


from collections import deque
Q=deque()
USED=[0]*(n+1)

for i in range(1,n+1):
    if EW[i]==1 and i!=S:
        USED[i]=1
        Q.append(i)

EW[S]+=1<<50
USED[S]=1

while Q:
    x=Q.pop()
    EW[x]-=1

    for to in ELIST[x]:
        if USED[to]==1:
            continue
        EW[to]-=1

        if EW[to]==1 and USED[to]==0:
            Q.append(to)
            USED[to]=1

#print(EW)
LOOP=[]

ANS=0
for i in range(1,n+1):
    if EW[i]!=0:
        ANS+=W[i]
        LOOP.append(i)

SCORE=[0]*(n+1)
USED=[0]*(n+1)

for l in LOOP:
    SCORE[l]=ANS
    USED[l]=1

Q=deque(LOOP)

while Q:
    x=Q.pop()

    for to in ELIST[x]:
        if USED[to]==1:
            continue

        SCORE[to]=W[to]+SCORE[x]
        Q.append(to)
        USED[to]=1

print(max(SCORE))



Measured memory_bytes: 40196
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;

int main() {
	int N, Y;
	cin >> N >> Y;

	int A = -1;
	int B = -1;
	int C = -1;

	for (int i = 0; i <= N; i++) {					//iが一万円
		for (int j = 0; j <= N; j++) {				//jが五千円
			int k = N - (i + j);					//kが千円の枚数
			if (i + j + k == N && (10000 * i)+(5000 * j) + (1000 * k) == Y && 0 <= i && 0 <= j && 0 <= k && k <= N) {
				 A = i;
				 B = j;
				 C = k;
			}
		}
	}
	cout << A << " " << B << " " << C << " " << endl;
}


Measured memory_bytes: 256
#include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>

    #define INF 1e7
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))

    using namespace std;
    int MAX(int a,int b){
      if(a<b){
        int tmp = a;
        a = b;
        b = tmp;
      }
      int r = a%b;
      while(!r){
        a = b;
        b = r;
        r = a%b;
      }
      return r;
    }

    int main(){
      int n;
      cin>>n;
      auto s = vec(int,n);
      int sum = 0;
      rep(i,n){
        cin>>s[i];
        sum += s[i];
      }
      sort(s.begin(),s.end());
      if(sum%10 != 0){
        cout<<sum<<endl;
        return 0;
      }
      else rep(i,n){
        if((sum-s[i])%10 == 0)continue;
        else {
          cout<<sum-s[i]<<endl;
          return 0;
        }
      }
      cout<<0<<endl;
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long int lld;
#define sq(x) x*x
#define fr(i,m,n) for(i=m;i<n;i++)
#define vec vector<int>
#define sint set<int>
#define qint queue<int>
#define mip map<int,int>
#define pint priority_queue<int>
#define pb push_back
#define pp pop_back()
#define ft first
#define sd second
#define full(v) v.begin(),v.end()

int main()
{
    int i,j,k,a,b,c,x,y,z,n,m,t;
    string s,u,v;
    cin>>n;bool ans=false;
    fr(i,1,10){
        if(n%i==0 && (n/i)<10) ans=true;
    }
    if(ans) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


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

int main() {
  int n, k;
  cin >> n >> k;
  int i = 0;
  while (pow(k,i) <= n) {
    i++;
  }
  cout << i << endl;
  
  return 0;
}

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

using namespace std;

int main()
{
	int AC = 0, WA = 0, TLE = 0, RE = 0;
	int n;
	string s;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s;
		if (s == "AC") AC++;
		else if (s == "WA") WA++;
		else if (s == "TLE") TLE++;
		else if (s == "RE") RE++;
	}
	cout << "AC x " << AC << "\n" << "WA x " << WA << "\n" << "TLE x " << TLE << "\n" << "RE x " << RE << "\n";
	return 0;
}



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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll a;
  string s;
  cin >> a >> s;

  cout << (a < 3200 ? "red" : s) << "\n";
}

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

#define INX(x) (cin >> x)
#define OUTX(x) (cout << x << endl)

#define ADD emplace_back
#define MP make_pair

#define BASEP 998244353


ll powmod(ll x, ll pow, ll mod)
{
    ll result = 1;
    while (pow > 0)
    {
        if(pow & 1)
        {
            result *= x;
            result %= mod;
        }

        x *= x;
        x %= mod;

        pow >>= 1;
    }
    return result;
}


int main()
{
    ll N, M, K;
    cin >> N >> M >> K;

    ll Ndash = N - 1;
    ll Mdash = M - 1;
    
    //累乗を求めておく
    vector<ll> vpow(Ndash + 1);
    vpow[0] = 1;
    for (ll i = 0; i < Ndash; i++)
    {
        vpow[i + 1] = (vpow[i] * Mdash) % BASEP;
    }

    //階乗を求めておく
    //vector<ll> vfact(Ndash + 1); //ここvectorだとなぜかデストラクタ？で例外が起きる
    ll vfact[Ndash + 1];
    vfact[0] = 1;
    for (ll i = 0; i <= Ndash;)
    {
        ll back = vfact[i];
        i++;
        vfact[i] = (back * i) % BASEP;
    }

    //階乗の逆元を求めておく
    vector<ll> vinv(Ndash + 1);
    for (ll i = 0; i <= Ndash; i++)
    {
        vinv[i] = powmod(vfact[i], BASEP - 2, BASEP);
    }
    
    //組み合わせnCkを求めておく
    vector<ll> vnck(Ndash + 1);
    vnck[0] = vnck[Ndash] = 1;
    for (ll i = 1; i <= Ndash / 2; i++)
    {
        ll result = (vfact[Ndash] * vinv[i]) % BASEP;
        result = (result * vinv[Ndash - i]) % BASEP;
        vnck[i] = vnck[Ndash - i] = result;
    }


    //目的の数式を計算する
    ll result = 0;
    for (ll i = 0; i <= K; i++)
    {
        result += (vnck[i] * vpow[Ndash - i]) % BASEP;
        result %= BASEP;
    }
    result *= M;
    result %= BASEP;
    OUTX(result);


    return 0;
}


Measured memory_bytes: 9500
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static int MOD = 1000000007;
	static int[] mh4 = { 0, -1, 1, 0 };
	static int[] mw4 = { -1, 0, 0, 1 };

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {

			long a = in.nextLong(), b = in.nextLong(), c = in.nextLong();
			long k = in.nextLong();

			if (k % 2 == 0) {
				out.println(a-b);
			} else {
				out.println(b-a);
			}

		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}


Measured memory_bytes: 21332
import sys
import math
import copy
import queue
input = sys.stdin.readline
def LI(): return [int(x) for x in input().split()]
INF = 10**15
DD = ((1,0),(0,1),(-1,0),(0,-1))

n,a,b = LI()

x = n // (a+b)
y = n % (a+b)
print (x * a + (y if y <= a else a))


Measured memory_bytes: 40428
// C.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <cstring>

using namespace std;

int main(int argc, char *argv[]) {
	long long n, len = 0, ans = 0;
	cin >> n;
	char d[16] = {};
	while (true) {
		int pos = 12;
		while (true) {
			if (!d[pos]) {
				++len;
				d[pos] = '3';
				break;
			} else if (d[pos] == '3') {
				d[pos] = '5';
				break;
			} else if (d[pos] == '5') {
				d[pos] = '7';
				break;
			} else if (d[pos] == '7') {
				d[pos] = '3';
				--pos;
			}
		}
		if (atoll(d + 13 - len) > n) {
			break;
		}
		int f = 0;
		for (int i = 0; i < len; ++i) {
			if (d[12 - i] == '3') f |= 1;
			else if (d[12 - i] == '5') f |= 2;
			else f |= 4;
		}
		ans += f == 7;
	}
	cout << ans << endl;
	return 0;
}


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

int main(){
    int n ;
    cin >> n ;
    int t[n] , x[n] , y[n] ;
    rep(i,n){
        cin >> t[i]  >> x[i] >> y[i] ;
        if( i == 0 ){
            if(t[i] >= x[i] + y[i] && t[i]%2 ==  (x[i] + y[i])%2 ) continue ;
            else{
                cout << "No" <<endl;
                return 0 ;
            }
        }
        if(t[i] - t[i-1] >= abs(x[i] + y[i] - (x[i-1] + y[i-1]) )&& ( t[i] - t[i-1] )%2 ==  abs(x[i] + y[i]- (x[i-1] + y[i-1]) )%2 ) continue ;
            else{
                cout << "No" <<endl;
                return 0 ;
            }
    }
    cout << "Yes" <<endl;
}

Measured memory_bytes: 1408