akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
typedef unsigned long long int ull;
typedef long long lint;

int main(void){
    int N;
    cin >> N;
    int A[N];
    rep(i,N) cin >> A[i];
    int ans=N;
    int now=1;
    rep(i,N){
        if(A[i]==now) ans--,now++;
    }
    if(ans==N) cout << -1 << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 1024
from sys import stdin
input = stdin.readline

MOD = 1000000007
H, W = map(int, input().split())
grid = stdin.read().splitlines()
dp = [[1] * W for _ in range(H)]

for h in range(H):
    for w in range(W):
        if grid[h][w] == '#':
            dp[h][w] = 0
            continue
        if h != 0 and w != 0:
            dp[h][w] = dp[h - 1][w] + dp[h][w - 1]
            if dp[h][w] >= MOD:
                dp[h][w] -= MOD
        if h == 0 and w != 0:
            dp[h][w] = dp[h][w - 1]
        if h != 0 and w == 0:
            dp[h][w] = dp[h - 1][w]

print(dp[H - 1][W - 1])


Measured memory_bytes: 68640
#!/usr/bin/python3
 
cmdvar_str=input()
cmdvar_num=input()
strchois=input()
str_splited=cmdvar_str.split()
num_splited=cmdvar_num.split()

if strchois == str_splited[0]:
    print(int(num_splited[0])-1,num_splited[1])
if strchois == str_splited[1]:
    print(num_splited[0],int(num_splited[1])-1)

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

int n;



int main() {
	cin>>n;
	int arr[n];
	for(int i=0;i<n;i++) cin>>arr[i];
	sort(arr, arr+n);
	double ans = arr[0];
	for(int i=1;i<n;i++){
	    ans = (1.0* ans  + arr[i])/2;
	}
	
	cout<<setprecision(10)<<ans;
	
	return 0;
}

Measured memory_bytes: 256
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define range_for(i, b, e) for(int i=(b), i##_len=(e); i<=i##_len; ++i)
# define ALL(x) (x).begin(), (x).end()
# define RALL(x) (x).rbegin(), (x).rend()
# define pb push_back
# define len(x) ((int)(x).size())
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define debug(x) std::cerr<<#x<<": "<<(x)<<endl;
# define LINT_MAX (LONG_LONG_MAX)
# define cauto const auto
using namespace std;
using lint = long long;
template <class Type> inline constexpr bool InRange(const Type& x, const Type& i, const Type& a) { return (i <= x) && (x <= a); }
template<class Integer>bool chmax(Integer &a, const Integer &b) { if (a<b) { a=b; return 1; } return 0; }
template<class Integer>bool chmin(Integer &a, const Integer &b) { if (b<a) { a=b; return 1; } return 0; }
template<class Integer>bool IsOdd(Integer &n) { return n & 1; }
template<class Integer>bool IsEven(Integer &n) { return !(n & 1); }
int ctoi(const char c) { return ('0' <= c && c <= '9') ? (c - '0') : -1; }
string YesNo(bool b) { return b ? "Yes" : "No"; }
string YESNO(bool b) { return b ? "YES" : "NO"; }
string yesno(bool b) { return b ? "yes" : "no"; }
int dy[4] = {0, 1, 0, -1};
int dx[4] = {1, 0, -1, 0};

// 整数の桁数を返す ( log(N) )
template <class Integer> Integer GetDigit(Integer n) {
    if (n == 0) return 1;
    Integer d = 0;
    while (n) {
        n /= 10;
        d++;
    }
    return d;
}

// 素数かどうかを返す ( O(sqrt(N)) )
template <class Integer>
constexpr bool IsPrime(const Integer n) noexcept {
    if (n < 4) return n == 2 || n == 3;
    if (n % 2 == 0 || n % 3 == 0 || (n % 6 != 1 && n % 6 != 5)) return false;
    for (Integer i = 5; i * i <= n; i += 6) if (n % i == 0 || n % (i + 2) == 0) return false;
    return true;
}

// 1e4
int main()
{
    int N; cin >> N;
    string S; cin >> S;

    int ans = 0;
    range_for (n, 0, 999)
    {
        string sub(3-GetDigit(n), '0');
        sub += to_string(n);

        int cur = 0;
        rep (i, N)
        {
            if (S[i] == sub[cur]) cur++;
            if (cur == 3)
            {
              ans++;
              break;
            }
        }
    }

    cout << ans << endl;

    return 0;
}



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

const int MOD=1000000007;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, a[114514];
	cin>>n;
	REP(i, n){
		cin>>a[i];
	}
	sort(a, a+n);
	bool ok=false;
	ll b=0, c=0;
	FORR(i, 0, n){
		int cnt=1;
		while(i>0 && a[i-1]==a[i]){
			++cnt;
			--i;
		}
		if(cnt>=2 && ok){
			c=a[i];
			break;
		}
		else if(cnt>=4){
			b=c=a[i];
			break;
		}
		else if(cnt>=2){
			b=a[i];
			ok=true;
		}
	}
	cout<<b*c<<'\n';
	return 0;
}


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

int main(){
  bool g[1000][1000];
  int p[2][1000],i,j,h,w,n,t;
  while(scanf("%d%d%d",&h,&w,&n) && (h||w||n)){
    for(i=0;i<h;i++)
      for(j=0;j<w;j++){
	scanf("%d",&t);
	g[i][j]=t?true:false;
	p[i&1][j]=0;
      }

    p[0][0]=n-1;
    for(i=0;i<h;i++)
      for(j=0;j<w;j++){
	t=i&1;
	n=p[t][j];
	p[1-t][j]+=n/2;
	p[t][j+1]+=n/2;
	if(n&1){
	  g[i][j]?p[t][j+1]++:p[1-t][j]++;
	  g[i][j]=!g[i][j];
	}
	p[t][j]=0;
      }

    i=j=0;
    while(i<h && j<w)g[i][j]?j++:i++;
    printf("%d %d\n",i+1,j+1);
  }
}

Measured memory_bytes: 1748
#include <algorithm>
#include <array>
#include <assert.h>
#include <chrono>
#include <bitset>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <random>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<ld> vld;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<ld>> vvld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector<pll> vpll;

#ifdef OLBOEB
mt19937 rnd(228 + 1488 + 238 + 24111997 % 322);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

void print_time() {
#ifdef OLBOEB
    cout.flush();
    cerr << "\ntime: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
#endif
}

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

template<class T1, class T2>
ostream& operator<< (ostream &out, pair<T1, T2> pair) { return out << "(" << pair.first << ", " << pair.second << ")";}
template<class T> ostream& operator<<(ostream& out, vector<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class T> ostream& operator<<(ostream& out, set<T> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }
template<class L, class R> ostream& operator<<(ostream& out, map<L, R> vec) { out<<"("; for (auto& v: vec) out<<v<<", "; return out<<")"; }

#include <complex.h>

typedef complex<ld> comp;

comp trig(ld angle) {
    return comp(cos(angle), sin(angle));
}

const ld PI = 3.14159265358979323846264338327950288;
const ld PI_2 = 1.57079632679489661923132169163975144;

int main() {
    cout << fixed << setprecision(20);
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    ll n;
    ld l;
    cin >> n >> l;
    vld t(n);
    for (ll i = 0; i < n; ++i) {
        cin >> t[i];
    }
    comp ans(0, 0);
    vector<comp> a(n);
    comp sum_om(0, 0);
    comp sum_m0(0, 0);

    for (ll i = 0; i < n; ++i) {
        a[i] = trig(t[i] / l * 2 * PI);
        if (i >= 2) {
            comp r = trig((l - t[i]) / l * PI);
            r = comp(1., 0.) / r;
            ans += sum_om + sum_m0 * r;
        }
        for (ll j = 0; j < i; ++j) {
            comp mi = trig((t[i] + t[j]) / l * PI);
            sum_om += mi;
            comp mj = a[j] - mi;
            mj /= trig(t[j] / l * PI);
            sum_m0 += mj;
        }
    }
    ld cnt = n * (n - 1) * (n - 2) / 6;
    ans /= cnt;
    cout << ans.real() << " " << ans.imag() << endl;

    print_time();
    return 0;
}



Measured memory_bytes: 384
#include <atcoder/scc>
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 998244353;

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

    scc_graph g(N);

    for (int i = 0; i < M; i++) {
        int A, B; cin >> A >> B;
        g.add_edge(A-1, B-1);
        g.add_edge(B-1, A-1);
    }

    auto scc = g.scc();

    printf("%d\n", int(scc.size()) - 1);
}

Measured memory_bytes: 11156
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, M; cin >> N >> M;
  vector<int> kaidan(N+2,0);
  vector<int> broken(M);
  for(int i=0;i<M;i++){
    cin >> broken.at(i);
    kaidan.at(broken.at(i)+1)=1;
  }
  vector<int> ans(N+2);
  ans.at(0)=0;
  ans.at(1)=1;
  for(int i=2;i<N+2;i++){
    if(kaidan.at(i)==1){
      ans.at(i)=0;
    }
    else ans.at(i)=ans.at(i-1)+ans.at(i-2);
    ans.at(i)=ans.at(i)%1000000007;
  }
  cout << ans.at(N+1) << endl;
}

Measured memory_bytes: 1408
#include<iostream>
#include<vector>

using namespace std;

int main(){
  int N=0, r=0, b=0;
  string s;
  cin >> N;
  cin >> s;
  for( int i = 0; i < N; ++i ){
    if( s.at(i) == 'R' ){
      ++r;
    }else if( s.at(i) == 'B' ){
      ++b;
    // }else{
    //   cerr << "error" << endl;
    }
  }
  if( r > b ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}



Measured memory_bytes: 256
from _collections import deque


h,w=map(int,input().split())
cx,cy=map(int,input().split())
dx,dy=map(int,input().split())
s=[[] for _ in range(h+2)]
for i in range(h):
    x=list(input())
    x.insert(0,"#")
    x.append("#")
    s[i+1]=x
s[0]=s[-1]=["#"]*(w+2)




dep=[[10**10]*(w+2) for _ in range(h+2)]
dep[cx][cy]=0
data=deque([[cx,cy,0]])
while len(data)>0:
  xy=data.popleft()
  x,y=xy[0],xy[1]
  if xy[2]==dep[x][y]:
    if s[x-1][y]=="." and dep[x-1][y]>dep[x][y]:
        dep[x-1][y]=dep[x][y]
        data.appendleft([x-1,y,dep[x][y]])
    if s[x+1][y] == "." and dep[x+1][y] > dep[x][y]:
        dep[x+1][y] = dep[x][y]
        data.appendleft([x + 1,y,dep[x][y]])
    if s[x][y-1] == "." and dep[x][y-1] > dep[x][y]:
        dep[x][y-1] = dep[x][y]
        data.appendleft([x,y-1,dep[x][y]])
    if s[x][y+1] == "." and dep[x][y+1] > dep[x][y]:
        dep[x][y+1] = dep[x][y]
        data.appendleft([x,y+1,dep[x][y]])

    for i in range(5):
        for j in range(5):
            if 0<=x-2+i<=h+1 and 0<=y-2+j<=w+1 and s[x-2+i][y-2+j]=="." and dep[x-2+i][y-2+j]>dep[x][y]+1:
                dep[x-2+i][y-2+j]=dep[x][y]+1
                data.append([x-2+i,y-2+j,dep[x][y]+1])

print(dep[dx][dy] if dep[dx][dy]<10**10 else -1)



Measured memory_bytes: 143000
#include<stdio.h>

void showArray(int A[],int N){
	int i;
	for(i=0;i<N-1;i++)
		printf("%d ",A[i]);
	printf("%d\n",A[N-1]);
}

void bubbleSort(int A[],int N){
	int i;
	int flag=1;
	int count=0;
	while(flag){
		flag=0;
		for(i=N-1;i>0;i--){
			if(A[i]<A[i-1]){
				int temp=A[i];
				A[i]=A[i-1];
				A[i-1]=temp;
				flag=1;
				count++;
			}
		}
	}
	
	showArray(A,N);
	printf("%d\n",count);
}



int main(void){
		int n;
		int array[101];
		scanf("%d",&n);
		for(int i=0;i<n;i++)
			scanf("%d",&array[i]);

		bubbleSort(array,n);
		
			
		return 0;
}

Measured memory_bytes: 1760
#include <cassert>

#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>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// 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>
#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>
// #include <boost/foreach.hpp>
// #include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1e9
#define LINF 1e18
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define int long long
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
// int dx[]={0,1,0,-1};
// int dy[]={1,0,-1,0};
struct edge{int to,cost;};
//typedef pair<int,int> P;

const long long MOD=1000000007LL;
bool isupper(char c){if('A'<=c&&c<='Z')return 1;return 0;}
bool islower(char c){if('a'<=c&&c<='z')return 1;return 0;}
bool isPrime(int x){if(x==1)return 0;if(x==2)return 1;if(x%2==0)return 0;for(int i=3;i*i<=x;i++)if(x%i==0)return 0;return 1;}
bool iskaibun(string s){for(int i=0;i<s.size()/2;i++)if(s[i]!=s[s.size()-i-1])return 0;return 1;}
bool isnumber(char c){return ('0'<=c&&c<='9');}
bool isalpha(char c){return (isupper(c)||islower(c));}
template<typename T> 
void print(vector<T> v){
    for(int i=0;i<v.size();i++){
        if(i)cout<<" ";
        cout<<v[i];
    }
    cout<<endl;
}

template<typename T>
void printendl(vector<T> v){
    for(auto date:v)cout<<date<<endl;
}

template<typename T>
void printvv(vector<vector<T>> v){
    for(int i=0;i<v.size();i++){
        for(int j=0;j<v[i].size();j++){
            if(j)cout<<" ";
            cout<<v[i][j];
        }
        cout<<endl;
    }
}
int gcd(int a,int b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    else return gcd(b,a%b);
}

struct S{
    int num,x;
};


signed main (){
    int a,b;
    cin>>a>>b;
    cout<<(a*3+b)/2<<endl;

}
/*

*/


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

using namespace std;

int main()
{
	string W, T;

	cin >> W;

	int ans = 0;

	while(1){
		cin >> T;
		if (T == "END_OF_TEXT")
			break;

		int periodPos = T.find(".");
		if (periodPos >= 0)
			T.replace(periodPos, 1, "");
		for (int i = 0; i < T.length(); i++)
			T[i] = tolower(T[i]);

		if (T == W)
			ans++;

	}

	cout << ans << endl;

	return 0;
}



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

int main() {
  char word;
  cin >> word;
  
  if (word == 'a' || word == 'e' || word == 'i' || word == 'o' || word == 'u') {
    cout << "vowel" << endl;
  }
  else {
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int64_t N, M;
  cin >> N >> M;
  if (N == 2 && M == 1) {
    cout << 0 << endl;
  }
  if (N == 2 && M == 1) {
    cout << 0 << endl;
  }
  if (N == 1 && M == 1) {
    cout << 1 << endl;
  }
  if (N == 2 && M == 2) {
    cout << 0 << endl;
  }
  if (N < 2 && M > 2) {
    cout << M - 2 << endl;
  }
  if (N > 2 && M < 2) {
    cout << N - 2 << endl;
  }
  if (N == 2 && M > 2) {
    cout << 0 << endl;
  }
  if (N > 2 && M == 2) {
    cout << 0 << endl;
  }
  if (N > 2 && M > 2) {
    cout << (N - 2) * (M - 2) << endl;
  }
}

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

#define endl '\n'

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

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

	int n;
	cin >> n;

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

	vector<int> dp(n);
	dp[1] = abs(v[1] - v[0]);

	for(int i = 2; i < n; ++i)
		dp[i] = min(dp[i - 1] +
				abs(v[i] - v[i - 1]), dp[i - 2] + abs(v[i] - v[i - 2]));

	cout << dp.back() << endl;

	return 0;
}


Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            if(a[0] <= a[2] && a[0]+a[1] >= a[2])
            {
                Console.WriteLine("YES");
            }
            else Console.WriteLine("NO");
        }
    }
}

Measured memory_bytes: 11092
n, m = map(int, input().split())
a = [int(x) for x in input().split()]
ps = [0]*(m+2)  # 0,1,2,...,m,m+1

for i in range(n-1):
    if a[i] < a[i+1]:
        ps[a[i]+1] += 1
        ps[a[i+1]] -= 1
    else:
        ps[0] += 1
        ps[a[i+1]] -= 1
        ps[a[i]+1] += 1
        ps[m+1] -= 1

aps = [0]
for x in ps[:-1]:
    aps.append(aps[-1]+x)
aps = aps[2:]


def dist(src, tar):
    return (m+tar-src) % m


freq = [0]*m
for i, x in enumerate(a):
    if i == 0:
        continue
    freq[x-1] += dist(a[i-1], a[i])-1


ans = [0]*m
for i in range(n-1):
    ans[0] += min(dist(a[i], a[i+1]), 1+dist(1, a[i+1]))

for i in range(1, m):
    ans[i] = ans[i-1] + freq[i-1] - aps[i-1]

print(min(ans))


Measured memory_bytes: 96684
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
int a,b,c;
cin >> a >> b >> c;
int de=a+b+c;
int ans  = mINF;
ans = max(ans,de+9*a);
ans = max(ans,de+9*b);
ans = max(ans,de+9*c);
cout << ans << endl;
return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,d;
    int e,f,g,h;
    cin >> a >> b >> c >> d;
    cin >> e >> f >> g >> h;
    int x = a+b+c+d;
    int y = e+f+g+h;
    if(x>y){
        cout << x << endl;
    }
    else{
        cout << y << endl;
    }
}



Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size());
typedef long long ll;
const int n = 8000;
int main(){
  string s;
  cin >> s;
  int x,y;
  cin >> x >> y;
  if (s.back() == 'F') s += 'T';

  vector<vector<bool> > dpx(2,vector<bool>(2*n+2,false)), dpy(2,vector<bool>(2*n+2,false));
  vector<int> cx,cy;
  int cf = 0;
  int p = 0;
  rep(i,s.length()) {
    if (s[i] == 'T') {
      if (p % 2 == 0) cx.push_back(cf);
      else cy.push_back(cf);
      cf = 0;
      p++;
    }
    else cf++;
  }

  //ｘ軸方向のdp
  int nx = sz(cx);
  dpx[0][n] = true;
  for (int i = 0; i < nx; i++) {
    for (int j = 0; j <= 2 * n; j++) {
      if (dpx[i%2][j]) {
        dpx[(i+1)%2][j+cx[i]] = dpx[i%2][j];
        if (i > 0) dpx[(i+1)%2][j-cx[i]] = dpx[i%2][j];
        dpx[i%2][j] = 0;
      }    
    }
  }

  //ｙ軸方向のdp
  int ny = sz(cy);
  dpy[0][n] = true;
  for (int i = 0; i < ny; i++) {
    for (int j = 0; j <= 2 * n; j++) {
      if (dpy[i%2][j]) {
        dpy[(i+1)%2][j+cy[i]] = dpy[i%2][j];
        dpy[(i+1)%2][j-cy[i]] = dpy[i%2][j];
        dpy[i%2][j] = false; 
      }   
    }
  }

  if (dpx[nx%2][n+x] && dpy[ny%2][n+y]) puts("Yes");
  else puts("No");

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define endl "\n"

int main()
{
  i64 N, M, K;
  cin >> N >> M >> K;
  vector<i64> A(N), B(M);
  for (i64 i = 0; i < N; i++)
    cin >> A[i];
  for (i64 i = 0; i < M; i++)
    cin >> B[i];
  for (i64 i = 0; i < N - 1; i++)
    A[i + 1] += A[i];
  for (i64 i = 0; i < M - 1; i++)
    B[i + 1] += B[i];
  i64 ans = 0;
  i64 l = M;
  for (i64 i = 0; i <= N; i++)
    for (i64 j = l; 0 <= j; j--)
    {
      i64 t = 0;
      if (i != 0)
        t += A[i - 1];
      if (j != 0)
        t += B[j - 1];
      if (t <= K)
      {
        ans = max(ans, i + j);
        break;
      }
      else
        l = j;
    }
  cout << ans << endl;
  return 0;
}


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

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

}


Measured memory_bytes: 3620
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

typedef struct{
	char before;
	char after;
} MAT;

int main(void){
	int i,j,flag,n,m;
	char input,buf[32];
	MAT *arr;
	while(scanf("%d",&n)!=EOF){
		if(n==0) break;
		arr=(MAT *)calloc(n,sizeof(MAT));
		fgets(buf,sizeof(buf),stdin);
		for(i=0;i<n;i++){
			fgets(buf,sizeof(buf),stdin);
			buf[strlen(buf)-1]='\0';
			arr[i].before=buf[0];
			arr[i].after=buf[2];
		}
		scanf("%d",&m);
		fgets(buf,sizeof(buf),stdin);
		for(i=0;i<m;i++){
			fgets(buf,sizeof(buf),stdin);
			input = buf[0];
			flag=0;
			for(j=0;j<n;j++){
				if(input==arr[j].before){
					printf("%c",arr[j].after);
					flag=1;
				}
			}
			if(!flag) printf("%c",input);
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,d;
	cin>>n>>d;
	if(n%(2*d+1)==0){
		cout<<n/(2*d+1);
	}
	else{
		cout<<n/(2*d+1)+1;
	}
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,a,n) for(ll i=a;i<n;i++)
typedef long long ll;
using namespace std;
const ll INF = 1e+9;
int main(){
  ll n,k;cin>>n>>k;
  ll h[n];
  rep(i,0,n)cin>>h[i];
  sort(h,h+n);
  ll ans=INF;
  //rep(i,0,n)cout<<h[i]<<" ";
  //cout<<endl;
  rep(i,0,n-k+1){
    if(h[i+k-1]-h[i]<ans)ans=h[i+k-1]-h[i];
    //cout<<ans<<" ";
  }
  //cout<<endl;
  cout<<ans<<endl;
}

Measured memory_bytes: 1024
n = int(input())

# 各ロボットの左腕の端(la)と右腕の端(ra)をリストにして入れる
arms = []
for i in range(n):
    x, l = map(int, input().split())
    la = x-l
    if la<0:
        la = 0
    arms.append([la, x+l])

# 右腕の値が小さい順にsort
arms.sort(key=lambda arm: arm[1])

# 残せるロボットの数
robo_n = 0
# 最後に選んだ右腕の座標
ra = 0
for arm in arms:
    # 最後に選んだ右腕の座標より、今の左腕の座標の方が大きいとき値を更新
    if ra <= arm[0]:
        ra = arm[1]
        robo_n += 1

print(robo_n)


Measured memory_bytes: 21336
#include <stdio.h>
#include <stdlib.h>
int compare(int *a,int *b){
  return *(int*)a-*(int*)b;
}
int main(){
  int i,N,K,h[100000],ans;
  scanf("%d %d",&N,&K);
  for(i=0;i<N;i++)
  scanf("%d",&h[i]);

  qsort(h,N,sizeof(int),compare);
  ans=h[K-1]-h[0];

  for(i=0;i<N-K+1;i++)
  if(ans>h[i+K-1]-h[i])
  ans=h[i+K-1]-h[i];

  printf("%d",ans);
}


Measured memory_bytes: 892
import java.util.*;
import java.math.*;
import java.io.*;
import java.text.*;
class Main {
    static class Node implements Comparable<Node>{
        int id;
        int p;
        int t;
        public Node(int id,int p,int t){
            this.p=p;
            this.t=t;
            this.id=id;
        }
        public int compareTo(Node c){
            return this.p-c.p;
        }
    }
    //public static PrintWriter pw;
    public static PrintWriter pw = new PrintWriter(System.out);

    public static void solve() throws IOException {
//	pw=new PrintWriter(new FileWriter("C:\\Users\\shree\\Downloads\\small_output_in"));
        FastReader sc = new FastReader();
        char s[]=sc.next().toCharArray();
        for(int i=0;i<s.length;i++){
            if(s[i]=='9'){
                pw.println("Yes");
                pw.close();
                return;
            }
        }
        pw.println("No");




        pw.close();

    }


    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                try {

                    solve();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();

    }

    static BufferedReader br;
    static long M = (long) 1e9 + 7;

    static class FastReader {

        StringTokenizer st;

        public FastReader() throws FileNotFoundException {
            //br=new BufferedReader(new FileReader("C:\\Users\\shree\\Downloads\\B-small-practice.in"));
            br = new BufferedReader(new InputStreamReader(System.in));

        }

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

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

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

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

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

        public boolean hasNext() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                String s = br.readLine();
                if (s == null) {
                    return false;
                }
                st = new StringTokenizer(s);
            }
            return true;
        }

    }
}

Measured memory_bytes: 27348
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n>>m;
    if(n>8 || m>8)
    {
        cout<<":("<<endl;
    }
    else
    {
        cout<<"Yay!"<<endl;
    }
    return 0;
}


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

int main() {
    int A[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;
    cin >> k;
    cout << A[k-1] << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <math.h>
#include <queue>
using namespace std;
typedef long long ll;
 
 
int main() {
  double R;
  cin >> R;
 
  double ret = 2 * R * M_PI;
  printf("%lf\n", ret);
  return 0;
}

Measured memory_bytes: 3812
#include <iostream>
#include <cmath>
using namespace std;
 
int main(void)
{
    int n;
    cin >> n;
    
    string invbin = "";
    /*
     * -2進数の求め方として，2進数の求め方と同様にする
     * C++の%演算子を用いた剰余が-1となる場合，剰余が1となるようにするため商に1を加える
     */
    while(n != 0){
        if(n % -2 == 0){
            n = n / -2;
            invbin = "0" + invbin;
        }else if(n % -2 == 1){
            n = n / -2;
            invbin = "1" + invbin;
        }else{
            n = (n / -2) + 1;
            invbin = "1" + invbin;
        }
    }
    
    if(invbin == ""){
        invbin = "0";
    }
    
    cout << invbin << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        String s,t;
        int con;
        s=scan.next();
        t=scan.next();
        con=0;
        for(int i=0;i<3;i++){
            if(s.charAt(i)==t.charAt(i)) con+=1;
        }
        System.out.println(con);
    }
}

Measured memory_bytes: 23764
#include <vector>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
using namespace std;

int main(){
    string a;
    int n,c,sum=0;
    cin >> n >> a;
    for(int i=1;i<=a.length()-1;i++){
        c=0;
        if(count(a.begin(),a.begin()+i,'a')>0&&(count(a.begin()+i,a.end(),'a'))>0) c++;
        if(count(a.begin(),a.begin()+i,'b')>0&&(count(a.begin()+i,a.end(),'b'))>0) c++;
        if(count(a.begin(),a.begin()+i,'c')>0&&(count(a.begin()+i,a.end(),'c'))>0) c++;
        if(count(a.begin(),a.begin()+i,'d')>0&&(count(a.begin()+i,a.end(),'d'))>0) c++;
        if(count(a.begin(),a.begin()+i,'e')>0&&(count(a.begin()+i,a.end(),'e'))>0) c++;
        if(count(a.begin(),a.begin()+i,'f')>0&&(count(a.begin()+i,a.end(),'f'))>0) c++;
        if(count(a.begin(),a.begin()+i,'g')>0&&(count(a.begin()+i,a.end(),'g'))>0) c++;
        if(count(a.begin(),a.begin()+i,'h')>0&&(count(a.begin()+i,a.end(),'h'))>0) c++;
        if(count(a.begin(),a.begin()+i,'i')>0&&(count(a.begin()+i,a.end(),'i'))>0) c++;
        if(count(a.begin(),a.begin()+i,'j')>0&&(count(a.begin()+i,a.end(),'j'))>0) c++;
        if(count(a.begin(),a.begin()+i,'k')>0&&(count(a.begin()+i,a.end(),'k'))>0) c++;
        if(count(a.begin(),a.begin()+i,'l')>0&&(count(a.begin()+i,a.end(),'l'))>0) c++;
        if(count(a.begin(),a.begin()+i,'m')>0&&(count(a.begin()+i,a.end(),'m'))>0) c++;
        if(count(a.begin(),a.begin()+i,'n')>0&&(count(a.begin()+i,a.end(),'n'))>0) c++;
        if(count(a.begin(),a.begin()+i,'o')>0&&(count(a.begin()+i,a.end(),'o'))>0) c++;
        if(count(a.begin(),a.begin()+i,'p')>0&&(count(a.begin()+i,a.end(),'p'))>0) c++;
        if(count(a.begin(),a.begin()+i,'q')>0&&(count(a.begin()+i,a.end(),'q'))>0) c++;
        if(count(a.begin(),a.begin()+i,'r')>0&&(count(a.begin()+i,a.end(),'r'))>0) c++;
        if(count(a.begin(),a.begin()+i,'s')>0&&(count(a.begin()+i,a.end(),'s'))>0) c++;
        if(count(a.begin(),a.begin()+i,'t')>0&&(count(a.begin()+i,a.end(),'t'))>0) c++;
        if(count(a.begin(),a.begin()+i,'u')>0&&(count(a.begin()+i,a.end(),'u'))>0) c++;
        if(count(a.begin(),a.begin()+i,'v')>0&&(count(a.begin()+i,a.end(),'v'))>0) c++;
        if(count(a.begin(),a.begin()+i,'w')>0&&(count(a.begin()+i,a.end(),'w'))>0) c++;
        if(count(a.begin(),a.begin()+i,'x')>0&&(count(a.begin()+i,a.end(),'x'))>0) c++;
        if(count(a.begin(),a.begin()+i,'y')>0&&(count(a.begin()+i,a.end(),'y'))>0) c++;
        if(count(a.begin(),a.begin()+i,'z')>0&&(count(a.begin()+i,a.end(),'z'))>0) c++;
        if(c>=sum){
            sum=c;
        }
    }
    cout << sum;
}

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

#define TASKNAME ""

using namespace std;

const int INF = 1e9 + 7;
const int MAXN = 1e6 + 7;
const double EPS = 1e-8;

int main() {
    #ifdef MY
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #else
        //freopen(TASKNAME".in", "r", stdin);
        //freopen(TASKNAME".out", "w", stdout);
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
    #endif // MY
    ll n, m;
    cin >> n >> m;
    ll g = __gcd(n, m);
    string s, t;
    cin >> s >> t;
    for (ll i = 0; i < n; i++) {
        ll j = i * m / n;
        if (i * m != j * n || j > m - 1) continue;
        //cout << i << " " << j << "\n";
        if (s[i] != t[j]) {
            cout << -1;
            return 0;
        }
    }
    cout << n * m / g;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
const int AMAX = 100000; 
using namespace std;
#define rep(i, n) for (i64 i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (i64 i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define sw swap
#define UP(x) transform(x.begin(), x.end(), x.begin(), ::toupper);
#define down(x) transform(x.begin(), x.end(), x.begin(), ::tolower);
using LL = long long;
using ULL = unsigned long long;
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(void) {
    string a;
    cin >> a;
    int ans=0;
    rep(i, a.size()-1){
      if(a[i]!=a[i+1])
     {
      ans++;
     }
    }
  cout <<ans;
    return 0;
}

Measured memory_bytes: 512
#pragma GCC optimize ("Ofast")
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
#define int long long int
#define pb push_back
#define fi first
#define se second
#define deb cerr << "Line no." << __LINE__
#define fr(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define IO ios :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pii pair<int,int>
#define sz(x) (int)x.size()
const int mod = 1e9 + 7;
const int mod1 = 998244353;
typedef long double f80;
#ifndef LOCAL
#define endl '\n'
#endif

template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){
	uniform_int_distribution<int> uid(l, r);
	return uid(rng);
}
int pwr(int a,int b){
	int ans = 1;
	while(b){
		if(b & 1) ans = (ans * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return ans;
}
int dp[105][100005], v[105], wt[105];
void solve(){
	int n, w;
	cin >> n >> w;
	fr(i, 1, n){
		cin >> wt[i] >> v[i];
	}
	fr(i, 0, n){
		fill(dp[i], dp[i] + w + 1, -1e18);
	}
	dp[0][0] = 0;
	int ans = 0;
	fr(i, 0, n){
		fr(j, 0, w){
			ans = max(ans, dp[i][j]);
			dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
			if(j + wt[i + 1] <= w)
				dp[i + 1][j + wt[i + 1]] = max(dp[i + 1][j + wt[i + 1]], dp[i][j] + v[i + 1]);
		}
	}
	cout << ans;
}
signed main(){
  	IO;
  	#ifdef LOCAL
		freopen("inp.txt","r", stdin);
		// freopen("out.txt", "w", stdout);
	#endif
 	clock_t clk = clock();
  	int t = 1;
  	// cin >> t;
  	fr(tt, 1, t){
    	solve();
  	}
  	cerr << endl << (double)(clock() - clk) / CLOCKS_PER_SEC;
  	return 0;
}

Measured memory_bytes: 80128
#include <iostream>
#include <cmath>
#ifdef LOCAL
#define dbg(...) cout << (__VA_ARGS__) << endl;
#else
#define dbg(...) 42;
#endif
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    int c = a * pow(10, (int)(log10(b) + 1)) + b;
    dbg(c);
    dbg(pow((int)sqrt(c), 2)) bool d = c - (int)pow((int)sqrt(c), 2) == 0;
    cout << (d ? "Yes" : "No");
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mit map<int,int>::iterator
#define sit set<int>::iterator
#define itrm(g,x) for(mit g=x.begin();g!=x.end();g++)
#define itrs(g,x) for(sit g=x.begin();g!=x.end();g++)
#define ltype int
#define rep(i,j,k) for(ltype(i)=(j);(i)<=(k);(i)++)
#define rap(i,j,k) for(ltype(i)=(j);(i)<(k);(i)++)
#define per(i,j,k) for(ltype(i)=(j);(i)>=(k);(i)--)
#define pii pair<int,int>
#define fi first
#define se second
#define mpr make_pair
#define pb push_back
#define fastio ios::sync_with_stdio(false)
const int inf=0x3f3f3f3f,mod=1000000007;
const double pi=3.1415926535897932,eps=1e-6;
int h,n,a[100005],sum;
int main()
{
    scanf("%d%d",&h,&n);
    rep(i,1,n) scanf("%d",a+i),sum+=a[i];
    if(sum>=h) puts("Yes");
    else puts("No");
    return 0;
}

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

namespace C_ABC162
{
    class MainClass
    {

        static int[] s;
        static long[,] g = new long[201, 201];
        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            long sum = 0;
            for (int i = 1; i <= s[0]; i++)
            {
                for (int j = 1; j <= s[0]; j++)
                {
                    for (int k = 1; k <= s[0]; k++)
                    {
                        sum += Gcd(i, Gcd(j, k));



                    }
                }
            }

            WriteLine(sum);
        }
        public static long Gcd(long a, long b)
        {
            if (g[a, b] != 0)
            {
                return g[a, b];
            }
            long tmp;
            // a<bにする
            if (a >= b)
            {
                tmp = a;
                a = b;
                b = tmp;
            }

            if (a == 0)
            {
                g[a, b] = b;
                return b;
            }

            tmp = a;
            a = b % a;
            b = tmp;
            g[a, b] = Gcd(a, b);
            return g[a, b];

        }
    }
}


Measured memory_bytes: 28104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1000000000; //10^9

int main(void){
    int N;
    cin >> N;
    vector<int> a = {1, 2, 4, 8, 16, 32, 64};
    int Ans = 0;
    for (int i = 0; i < 7; i++)
    {
        if(a[i] <= N){
            Ans = a[i];
        }
    }

    cout << Ans << endl;
}


Measured memory_bytes: 256
using System;
using System.Linq;
class Plogram
{
    static void Main()
    {
        int[] line = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        int count = line[2];
        if (line[1]/line[0]<line[2])
        {
            count = line[1] / line[0];
        }
        Console.WriteLine(count);
    }
}

Measured memory_bytes: 13268
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
int A, B, T;

int main() {
  cin >> A >> B >> T;

  cout << (T / A) * B << endl;

  return 0;
}


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

int main(){
    int n;
    cin >> n;
    vector<string> s(n);
    for(int i = 0; i < n; i++) cin >> s[i];

    vector<int> backet(4, 0);
    for(int i = 0; i < n; i++){
        if(s[i] == "AC") backet[0]++;
        else if(s[i] == "WA") backet[1]++;
        else if(s[i] == "TLE") backet[2]++;
        else backet[3]++;
    }

    cout << "AC x " << backet[0] << endl;
    cout << "WA x " << backet[1] << endl;
    cout << "TLE x " << backet[2] << endl;
    cout << "RE x " << backet[3] << endl;
    return 0;
}

Measured memory_bytes: 6424
#include<cstdio>
#include<iostream>
#include<algorithm>
#include <cmath>
using namespace std;
int main()
{
	int m,n;
	scanf("%d%d",&n,&m);
	if(n>m)swap(n,m);
	int f=1,i;
	for(i=n;i<m;i++)
	{
		if(i-n==m-i)
		{f=0;
		break;
		}
	}
	if(f)printf("IMPOSSIBLE\n");
	else printf("%d\n",i);
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	double a=sc.nextDouble(),b=sc.nextDouble(),ax,ay,bx,by,c;
  	int h=sc.nextInt(),m=sc.nextInt(),hm=h*60+m;
  	ax=a*Math.cos(Math.toRadians((double)hm/(double)2));
  	ay=a*Math.sin(Math.toRadians((double)hm/(double)2));
  	bx=b*Math.cos(Math.toRadians((double)m*(double)6));
  	by=b*Math.sin(Math.toRadians((double)m*(double)6));
  	c=(ax-bx)*(ax-bx)+(ay-by)*(ay-by);
  	System.out.println(Math.pow(c,0.5));
  }
}

Measured memory_bytes: 37552
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
inline int read()
{
	int x;char c;
	while((c=getchar())<'0'||c>'9');
	for(x=c-'0';(c=getchar())>='0'&&c<='9';)x=x*10+c-'0';
	return x;
}
#define MN 1000
#define MM 200000
struct edge{edge*nx;int t;}e[MM*3+5],*h[MN+5],*r[MN+5],*c[MN+5];
int en=1,x[MM+5],y[MM+5];
int d[MN+5],l[MN+5],cnt,z[MN+5],zn,inz[MN+5],p[MN+5],pn,ph[MN+5];
int g[MN+5][MN+5],q[MN+5],qn,u[MN+5],uu[MM+5];
inline void ins(edge**h,int x,int y){e[++en]=(edge){h[x],y};h[x]=e+en;}
void dfs(int x)
{
	d[x]=l[x]=++cnt;inz[z[zn++]=x]=1;
	for(edge*i=h[x];i;i=i->nx)
		if(!d[i->t])dfs(i->t),l[x]=min(l[x],l[i->t]);
		else if(inz[i->t])l[x]=min(l[x],d[i->t]);
	if(d[x]==l[x])for(ph[++pn]=x;z[zn]!=x;)inz[z[--zn]]=0,p[z[zn]]=pn;
}
void d1(edge**h,int x,int z)
{
	u[x]=1;
	for(edge*i=h[x];i;i=i->nx)if(!u[i->t])d1(h,i->t,z),uu[i-e>>1]|=z;
}
bool d2(edge**h,int x,int d,int s)
{
	memset(u,0,sizeof(u));int i;
	for(u[q[i=qn=0]=x]=1;i<=qn;++i)for(edge*j=h[q[i]];j;j=j->nx)
	{
		if((j-e>>1)!=d&&!u[j->t])u[q[++qn]=j->t]=1;
		if(q[i]==s)return false;
	}
	return true;
}
int main()
{
	int n=read(),m=read(),i,j;
	for(i=1;i<=m;++i)x[i]=read(),y[i]=read(),ins(h,x[i],y[i]),ins(r,y[i],x[i]);
	for(i=1;i<=n;++i)if(!d[i])dfs(i);
	memset(h,0,sizeof(h));memset(r,0,sizeof(r));en=1;
	for(i=1;i<=m;++i)if(p[x[i]]==p[y[i]])ins(h,x[i],y[i]),ins(r,y[i],x[i]);else en+=2;
	for(i=1;i<=pn;++i)d1(h,ph[i],1);
	memset(u,0,sizeof(u));
	for(i=1;i<=pn;++i)d1(r,ph[i],2);
	for(i=1;i<=m;++i)if(p[x[i]]!=p[y[i]])ins(c,p[x[i]],p[y[i]]);
	for(i=1;i<=pn;++i)for(g[i][q[j=qn=1]=i]=1;j<=qn;++j)
		for(edge*k=c[q[j]];k;k=k->nx)if(!g[i][k->t]++)q[++qn]=k->t;
	for(i=1;i<=m;++i)
		if(p[x[i]]!=p[y[i]])puts(g[p[x[i]]][p[y[i]]]>1?"diff":"same");
		else puts(((uu[i]&1)&&d2(h,ph[p[x[i]]],i,y[i]))
				||((uu[i]&2)&&d2(r,ph[p[x[i]]],i,x[i]))?"diff":"same");
}

Measured memory_bytes: 16896
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val k = sc.nextLong()
    val n = sc.nextLong()
    val a = (0 until n).map { sc.next().toLong() }
    println(problem160c(k, n, a))
}

fun problem160c(k: Long, n: Long, a: List<Long>): Long {
    var maxDiff = 0L
    var acc = 0L
    for (i in 0 until a.size - 1) {
        val diff = a[i+1] - a[i]
        maxDiff = Math.max(maxDiff, diff)
        acc += diff
    }
    maxDiff = Math.max(maxDiff, k - acc)
    return k - maxDiff
}


Measured memory_bytes: 57596
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;


void solve(long long N, long long M, std::vector<long long> a, std::vector<long long> b, std::vector<long long> c, std::vector<long long> d){
    for(ll i=0; i< N; i++){
        vector<pll> ans;
        for(ll j=0; j< M; j++){
            ans.push_back(pll(abs(a[i]-c[j])+abs(b[i]-d[j]), j));
        }
        sort(ans.begin(), ans.end());
        cout << ans[0].second+1 << endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> a(N);
    std::vector<long long> b(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
        scanf("%lld",&b[i]);
    }
    std::vector<long long> c(M);
    std::vector<long long> d(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&c[i]);
        scanf("%lld",&d[i]);
    }
    solve(N, M, std::move(a), std::move(b), std::move(c), std::move(d));
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define endl "\n"
#define pb push_back
#define mod 1000000007
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
int dx8[]={1,-1,0,0,1,1,-1,-1};
int dy8[]={0,0,1,-1,1,-1,1,-1};

ll binexp(ll a, ll b, ll m) {
	a %= m;
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}
ll modinvfermat(ll a, ll m)
{
	return binexp(a, m - 2, m);
}
void task(bool flag)
{
	if (flag)
		cout << "YES\n";
	else
		cout << "NO\n";
}
ll lcm(ll a, ll b)
{
	return ((1LL * a * b) / (__gcd(a, b)));
}
 
void subset(ll val[],ll sum,ll n){


   bool dp[n+1][sum+1];
   memset(dp,false,sizeof dp);

   for(ll i=0;i<=n;i++){
   	for(ll j=0;j<=sum;j++){
   		if(i==0)dp[i][j]=false;

   		 if(j==0)dp[i][j]=true;

   	}
   }
   for(ll i=1;i<=n;i++){
   	for(ll j=1;j<=sum;j++){
   		if(val[i-1]<=j){
   			dp[i][j]=dp[i-1][j-val[i-1]]||dp[i-1][j];

   		}
   		else
   			dp[i][j]=dp[i-1][j];

   	}
   }
   vector<bool> v;
   ll ans=INT_MAX;

   for(ll i=0;i<=sum/2;i++){
   	if(dp[n][i]==true){
   		//cout<<i<<endl;

   		ans=min(ans,sum-2*i);

   	}
   }
   // ll ans=INT_MAX;
   // for(ll i=0;i<v.size();i++){
   // 	ans=min(ans,sum-2*v[i]);

   // }
cout<<ans<<endl;
return;




}
void solve(){

ll n;
cin>>n;
ll ans=n%1000;
if(ans==0){
	cout<<0<<endl;return;

}
ans=1000-ans;
cout<<ans<<endl;






return;
}




int main()
{  
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
    fast;
    ll t;
    t=1;
   //cin>>t;
    while(t--){
    	solve();
    }
    
   
  



#ifndef ONLINE_JUDGE
	cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
#endif
return 0;
}

Measured memory_bytes: 3684
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Long x, y = (long)100;
        Long n = (long)0;
        Scanner sc = new Scanner(System.in);
        x = sc.nextLong();
        while (y < x){
            Long i = y / (long)100;
            n++;
            y += i;
            //System.out.println("kekka" + y);
        }
        System.out.println(n);
    }
}

Measured memory_bytes: 35956
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>

typedef int32_t i32;

#define POS(i, j) ((i) * (n + 1) + (j))

void run (void) {
  const i32 max_len = 1000;
  char *a = (char *) calloc (max_len + 1, sizeof (char));
  char *b = (char *) calloc (max_len + 1, sizeof (char));
  scanf ("%s", a);
  scanf ("%s", b);
  const i32 m = strlen (a);
  const i32 n = strlen (b);
  i32 *dp = (i32 *) calloc ((m + 1) * (n + 1), sizeof (i32));
  for (i32 j = 0; j < n; ++j) {
    dp[POS(m, j)] = n - j;
  }
  for (i32 i = m - 1; i >= 0; --i) {
    dp[POS(i, n)] = m - i;
    for (i32 j = n - 1; j >= 0; --j) {
      if (a[i] == b[j]) {
	dp[POS(i, j)] = dp[POS(i + 1, j + 1)];
	continue;
      }
      i32 x = dp[POS(i + 1, j)];
      i32 y = dp[POS(i, j + 1)];
      i32 z = dp[POS(i + 1, j + 1)];
      i32 min = x < y ? x : y;
      dp[POS(i, j)] = 1 + (min < z ? min : z);
    }
  }
  printf ("%" PRIi32 "\n", dp[POS(0, 0)]);
}

int main (void) {
  run ();
  return 0;
}



Measured memory_bytes: 5656
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>

using namespace std;

#define INF 		2000000007
#define MOD			1000003

#define MAX 		105

#define REP(i,n)	for(int i=0;i<(n);++i)
#define REPS(i,s,t)	for(int i=(s);i<(t);++i)

typedef unsigned int 			uint;
typedef unsigned long long int	ull;


vector<int> prime(int N){
	int cnt = 1;
	vector<int> pn(N+1);
	REPS(i,N,1) pn[i]=i;
	for(int i=4;i<N;i+=2) pn[i] = -1; 
	for(int i=3;i<N;i+=2){
		if (pn[i]==-1) continue;
		for(int j=i*2;j<=N;j+=i) pn[j]= -1;
		++cnt;
	}
	// 整頓
	vector<int> p(cnt);
	for(int i=0,j=2;j<N;++j){
		if(pn[j]!=-1)p[i++]=j;
	}
	return p;
}


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

	vector<int> pn = prime(55555);// size : 5637

	vector<int> ans;

	REPS(i,10,pn.size())
		if(pn[i]%5==1)
			ans.push_back(pn[i]);

	cout << ans[0];
	REPS(i,1,N)
		cout << " " << ans[i];
	cout << endl;//*/

	return 0;
}

Measured memory_bytes: 512