akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=998244353;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-10;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
int L[110000];
int R[110000];
priority_queue<pair<int,int> > l;
priority_queue<pair<int,int> > r;
int used[110000];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++){
		scanf("%d%d",L+i,R+i);
	}
	long long ret=0;
	for(int t=0;t<2;t++){
		long long tmp=0;
		for(int i=0;i<a;i++){
			l.push(make_pair(-R[i],i));
			r.push(make_pair(L[i],i));
		}
		for(int i=0;i<a;i++)used[i]=0;
		int at=0;
		for(int i=0;i<a;i++){
			if((i+t)%2==0){
				while(r.size()&&used[r.top().second]){
					r.pop();
				}
				pair<int,int>to=r.top();
				used[to.second]=1;
				r.pop();
				if(at<to.first){
					tmp+=to.first-at;
					at=to.first;
				}
			}else{
				while(l.size()&&used[l.top().second]){
					l.pop();
				}
				pair<int,int>to=l.top();
				used[to.second]=1;
				l.pop();
				if(at>-to.first){
					tmp+=at+to.first;
					at=-to.first;
				}
			}
		}
		tmp+=ABS(at);
		ret=max(ret,tmp);
	}
	printf("%lld\n",ret);
}


Measured memory_bytes: 4840
s = input();t = s[:len(s)//2];u = s[len(s)//2+1:]

def check(string):
    idx = True
    for i in range(len(string)):
        if string[i] != string[len(string)-i-1]:
            idx = False
    return idx

print("Yes" if all([check(s),check(t),check(u)]) else "No")

Measured memory_bytes: 3060
import java.io.*;
 
class Main{
    public static void main(String[] args) throws IOException{
     
        int x,y,z;
 
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str[] = br.readLine().split(" ");
        x = Integer.parseInt(str[0]);
        y = Integer.parseInt(str[1]);
	z = Integer.parseInt(str[2]);

	if(x<y && y<z){
        	System.out.println("Yes");

	}else{
		System.out.println("No");
	}
    }
}

Measured memory_bytes: 16948
// inputに入力データ全体が入る
function Main(input) {
  
   S = input.split("");
 //  console.log(S);
  var  n = S.length;
   
 //  console.log(S,n);
  var a =S[0];
//  console.log(a);
  var ans = "Yes";
 for (i = 0;i<n;i++){var a = S[i];
                 //    console.log(a);
      var p = i % 2;
                  //   console.log(p);
      if (p == 0){if (a == "L"){var ans = "No";
                                      break;}}
       else{                               
      if (p == 1){if (a == "R"){var ans = "No";
                                        break;}}}
                                }
 console.log(ans);
  }
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));// inputに入力データ全体が入る

  
 

Measured memory_bytes: 7372
#include <stdio.h>
int main(){
int a,y,i,x,s;
    scanf("%d%d",&a,&y);
	    for(i=0;i<=a;i++)for(x=0;x<=a-i;x++){
		s=a-i-x;
		if(i*1000+x*5000+s*10000==y){
		    printf("%d %d %d\n",s,x,i);
		    return 0;
		}
	    }
    puts("-1 -1 -1");
    return 0;
}

Measured memory_bytes: 128
# coding: utf-8
# Your code here!

# coding: utf-8
# Your code here!

import sys
s=input()

for idx, i in enumerate(s):
    if idx % 2 == 0:
        if i not in ["R", "U", "D"]:
            print("No")
            sys.exit()
    else:
        if i not in ["L", "U", "D"]:
            print("No")
            sys.exit()
print("Yes")

Measured memory_bytes: 2940
#include <iostream>

const long long MOD = (long long ) 1e9 + 7;
const long long MAXN = (long long) 1e4 + 10;

long long dp[MAXN][110][2];
 
int main(){
	std::string k;
	long long D;
	std::cin >> k >> D;
	long long n = k.size();

	dp[0][0][1] = 1;
	
	for(int i = 0; i < n; i++){
		for(int j = 0; j < D; j++){
			for(int dig = 0; dig < 10; dig++){
				if(dig < (k[i] - '0')){
					dp[i + 1][ (j + dig) % D ][0] += dp[i][j][0];
					dp[i + 1][ (j + dig) % D ][0] += dp[i][j][1];
					dp[i + 1][ (j + dig) % D ][0] %= MOD;
				} else if ( dig == (k[i] - '0') ){
					dp[i + 1][ (j + dig) % D ][0] += dp[i][j][0];
					dp[i + 1][ (j + dig) % D ][1] += dp[i][j][1];
					dp[i + 1][ (j + dig) % D ][0] %= MOD;
					dp[i + 1][ (j + dig) % D ][1] %= MOD;
				} else {
					dp[i + 1][ (j + dig) % D ][0] += dp[i][j][0];
					dp[i + 1][ (j + dig) % D ][0] %= MOD;
				}
			}
		}
	}
	
	std::cout << (dp[n][0][1] + dp[n][0][0] + 1000000006) % MOD;
	return 0;
}

Measured memory_bytes: 17408
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <limits>
#include <numeric>
#include <valarray>
#include <fstream>

using namespace std;
typedef unsigned int uint;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> PP;
#define REP(i,a,n) for(LL i = (a); i < (LL)(n); ++i)
#define REM(i,a,n) for(LL i = ((n) - 1); i >= (a); --i)
#define FLOAT fixed << setprecision(16)
#define SPEEDUP {cin.tie(0); ios::sync_with_stdio(false);}
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const string INFSTR = "\x7f";
const double EPS = 1.0e-9;

void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U>
ostream& operator<<(ostream& ost, const pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N>
void Fill(T(&dest)[N], const TCompatible& val) { fill(dest, dest + N, val); }
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
template<class T>
T Compare(T left, T right) { return left > right ? 1 : (left < right ? -1 : 0); }
istream& Ignore(istream& ist) { string s; ist >> s; return ist; }
bool Inside(int i, int j, int h, int w) { return i >= 0 && i < h && j >= 0 && j < w; }
// all_of
// partial_sum, adjacent_difference

#ifdef ONLY_MY_ENVIR
#include "IntMod.h"
#include "Union_Find.h"
#include "Graph.h"
#include "Range.h"
#include "Global.h"
#include "Flow_Solver.h"
#include "Tree.h"
#include "Suffix_Array.h"
#include "Geometry.h"
#include "Matrix.h"
#endif

#ifdef __GNUC__
typedef __int128 LLL;
istream& operator>> (istream& ist, __int128& val) { LL tmp;  ist >> tmp; val = tmp; return ist; }
ostream& operator<< (ostream& ost, __int128 val) { LL tmp = val; ost << tmp; return ost; }
#endif

#if 1234567891
#include <array>
#include <random>
#include <unordered_set>
#include <unordered_map>
template<typename T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;	// コスト小を優先
#endif

int n, a, b;
int main() {
	cin >> n >> a >> b;
	cout << ((a - b) % 2 == 0 ? "Alice" : "Borys" ) << endl;
	return 0;
}

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

const int dx[] = {1,0};
const int dy[] = {0,1};

void solve() {
  int H,W;
  cin >> H >> W;
  vector<string> A(H);
  for(auto &x:A) cin >> x;
  if(A[0][0] != '#' || A[H-1][W-1] != '#'){
    cout << "Impossible" << endl;
    return;
  }
  A[0][0] = '.';
  int i = 0, j = 0;
  while(i != H-1 || j != W-1){
    bool flag = true;
    for(int k = 0; k < 2; k++){
      int ii = i + dy[k];
      int jj = j + dx[k];
      if(ii == H || jj == W) continue;
      if(A[ii][jj] == '#'){
        flag = false;
        A[ii][jj] = '.';
        i = ii;
        j = jj;
        break;
      }
    }
    if(flag) break;
  }
  A[H-1][W-1] = '.';
  for(int y = 0; y < H; y++){
    for(int x = 0; x < W; x++){
      //cout << A[y][x];
      if(A[y][x] == '#') {
        cout << "Impossible" << endl;
        return;
      }
    }
  }
  cout << "Possible" << endl;

}

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

  solve();

  return 0;
}


Measured memory_bytes: 384
#include<cstdio>
#include<algorithm>
using namespace std;
char c[10];int a[10],flag;
int main()
{
	scanf("%s",c);
	for(int i=0;i<3;i++)
		a[(c[i]-'a')]++;
	for(int i=0;i<3;i++)
		if(a[i]!=1)flag=1;
	if(flag)printf("No\n");
	else printf("Yes\n");
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ROOP(i, N) for(int i=0; i++; i<N)
#define RVROOP(i, N) for(int i=N; i--; i>=0)
#define ALL(v) v.begin(), v.end()
const int INF = 1e9;
const int MAX = 510000;
const int MOD = 1000000007;
using namespace std;
typedef long long ll;

int main(){
  int N; cin>>N;
  int ans=0;
  
  int A[N];
  int say[N][N];
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      say[i][j]=-1;
    }
  }
  
  for(int i=0; i<N; i++){
    cin>>A[i];
    for(int j=0; j<A[i]; j++){
      int x, y; cin>>x>>y;
      say[i][x-1]=y;
    }
  }
  
  for (int tmp = 0; tmp < (1 << N); tmp++) {
    bool ok=true;
    for(int j=0; j<N; j++){
      if(tmp >> j & 1){
        for(int k=0; k<N; k++){
          if(say[j][k]!=-1 && (tmp >> k & 1)!=say[j][k]){
            ok=false; 
          }
        }
      }
    }
    if(ok){
      ans=max(ans, __builtin_popcount(tmp));
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
int main()
{
	int n, k;
	scanf("%d%d", &n, &k);
	int ans = 0;
	rep(i, n) {
		int h;
		scanf("%d", &h);
		if(h >= k) ans++;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 3788
import java.io.*;


public class Main  {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

        char[] a = br.readLine().toCharArray();

        int b = a[0];
        if(b <= 122 && b >= 97) System.out.println("a");
        else if(b <= 90 && b >= 65) System.out.println("A");
        // 97 122 lower case
            //65 90
       
    }


}



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

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

typedef pair<int, int> pii;

int culc(string str) {
	istringstream ss(str);
	int n = count(str.c_str(), str.c_str() + str.size(), ' ');
	vector<int> in(n);
	REP(i, n) ss >> in[i];
	
	int pos = 0, ans = 0;
	REP(frame, 10) {
		if (frame == 9)  {
			FOR(i, pos, n) ans += in[i]; 
		}
		else {
			if (in[pos] == 10)
				ans += in[pos] + in[pos + 1] + in[pos + 2];
			else {
				ans += in[pos] + in[pos + 1];
				if (in[pos] + in[pos + 1] == 10) ans += in[pos + 2];
				pos++;
			}
		}
		pos++;
	}
	
	return ans;
}

int main() {
	int n;
	while (cin >> n, n) {
		vector<pii> ans;
		REP(i, n) {
			int num;
			string str;
			cin >> num;
			getline(cin, str);
			
			ans.push_back(pii(-culc(str), num));
		}
		sort(ans.begin(), ans.end());
		REP(i, ans.size()) {
			printf("%d %d\n", ans[i].second, -ans[i].first);
		}
	}
	
	return 0;
}

Measured memory_bytes: 1236
### subroutines

def o_prod(x0, y0, x1, y1)
  x0 * y1 - x1 * y0
end

def col_segs(seg0, seg1)
  vx = seg1[0]- seg0[0]
  vy = seg1[1]- seg0[1]
  v0x = seg0[2] - seg0[0]
  v0y = seg0[3] - seg0[1]
  v1x = seg1[2] - seg1[0]
  v1y = seg1[3] - seg1[1]

  op_01 = o_prod(v0x, v0y, v1x, v1y)
  return nil if op_01 == 0.0

  op_0 = o_prod(vx, vy, v0x, v0y)
  op_1 = o_prod(vx, vy, v1x, v1y)

  t0 = op_1 / op_01
  t1 = op_0 / op_01

  return nil if t0 < 0.0 || t0 > 1.0 || t1 < 0.0 || t1 > 1.0

  [seg0[0] + v0x * t0, seg0[1] + v0y * t0]
end

def area(x0, y0, x1, y1, x2, y2, x3, y3)
  (o_prod(x1 - x0, y1 - y0, x2 - x0, y2 - y0) +
   o_prod(x3 - x2, y3 - y2, x0 - x2, y0 - y2)) * 0.5
end

### main

loop do
  n = gets.to_i
  break if n == 0

  nn = n + 2
  
  ais = [0.0] + gets.split.map(&:to_f) + [1.0]
  bis = [0.0] + gets.split.map(&:to_f) + [1.0]
  cis = [0.0] + gets.split.map(&:to_f) + [1.0]
  dis = [0.0] + gets.split.map(&:to_f) + [1.0]
  #p [ais, bis, cis, dis]

  vsegs = (0...nn).map{|i| [ais[i], 0.0, bis[i], 1.0]}
  hsegs = (0...nn).map{|i| [0.0, cis[i], 1.0, dis[i]]}
  #p vsegs
  #p hsegs

  cols = nn.times.map{[]}

  for y in (0...nn)
    for x in (0...nn)
      cols[y][x] = col_segs(vsegs[x], hsegs[y])
    end
  end
  #p cols

  maxar = 0.0

  for y in (0..n)
    for x in (0..n)
      c0 = cols[y][x]
      c1 = cols[y][x + 1]
      c2 = cols[y + 1][x + 1]
      c3 = cols[y + 1][x]
      ar = area(*c0, *c1, *c2, *c3)
      maxar = ar if maxar < ar
    end
  end

  puts "%.6f" % maxar
end

Measured memory_bytes: 6996
s=list(input())
an=s.count("a")
bn=s.count("b")
cn=s.count("c")
cl=[an, bn, cn]
m=max(cl)
cl.remove(m)
for n in cl:
  if (m-1)!=n and (m-1)!=n-1:
    print("NO")
    exit()
print("YES")


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define log_2(a) (log((a)) / log(2))
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

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

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int X;
    cin >> X;
    int t = LCM(X, 360);
    cout << t / X << endl;
    return 0;
}



Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n;
   cin>>n;
   double a[n];
   for(int i=0;i<n;i++)
   {
   	cin>>a[i];
   }
   sort(a,a+n);
   for(int i=0;i<n-1;i++)
   {
   	a[i+1]=(a[i]+a[i+1])/2.0;
   }
   cout<<a[n-1];
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

public class Program
{
    public static void Main() {
        Reader reader = new Reader(Console.In);
        int H = reader.RInt();
        int W = reader.Int();

        string line = "";
        for (int i = 0; i < W + 2; i++) {
            line += "#";
        }

        Console.WriteLine(line);
        for (int i = 0; i < H; i++) {
            Console.WriteLine("#" + reader.RString() + "#");
        }
        Console.WriteLine(line);
    }
}

public class Reader
{
    private readonly TextReader reader;
    private readonly char separator = ' ';
    private string[] A = new string[0];
    private int i;

    public Reader(TextReader r) { reader = r; }

    public string String() { return Set(); }
    public int Int() { return int.Parse(Set()); }
    public long Long() { return long.Parse(Set()); }

    public string RString() { return RSet(); }
    public int RInt() { return int.Parse(RSet()); }
    public long RLong() { return long.Parse(RSet()); }


    public int[] IntArray() { return A.Select(x => int.Parse(x)).ToArray(); }

    private void Read() {
        string line = reader.ReadLine();

        A = line.Split(separator);
        i = 0;
    }

    private string Set() { return A[i++]; }
    private string RSet() { Read(); return A[i++]; }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

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

	for (int i = 1; i < 10; i++) {
		int m = 111 * i;
		if (n <= m) {
			cout << m << endl;
			break;
		}
	}
}

Measured memory_bytes: 3596
#include <stdio.h>

int a,b,o,ab;
int main()
{
        int tmp;
        char blood[2];
        while(~scanf("%d,%s",&tmp,blood)){
                if(blood[1]=='B')ab++;
                else if(blood[0]=='B')b++;
                else if(blood[0]=='O')o++;
                else a++;
        }
        printf("%d\n%d\n%d\n%d\n",a,b,ab,o);
        return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VRSORT(v) sort(v.begin(), v.end(),greater<int>());
#define INF 999999999
#define MOD 1000000007
#define M_PI 3.14159265358979323846
#define ALL(X) (X).begin(),(X).end()

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

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

using namespace std;

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

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

int X,Y,Z,K;
vector<ll> A,B,C;

void input(){
  #ifdef __LOCAL
    fs::path p = __FILE__;
    fs::path input,output;
    input = output = p.parent_path();
    input += string("/input/") + string(p.stem()) + string(".txt");
    output += string("/output/") + string(p.stem()) + string(".txt");
    freopen(input.c_str(), "r", stdin);
    freopen(output.c_str(), "w", stdout);
  #endif
  cin >> X >> Y >> Z >> K;
  A = fetch_vec<ll>(X);
  B = fetch_vec<ll>(Y);
  C = fetch_vec<ll>(Z);
}

int solve(){
  priority_queue<ll> AB;
  for (int i = 0; i < X; i++)
  {
    for (int j = 0; j < Y; j++)
    {
      AB.push(A[i]+B[j]);
    }
  }

  vector<ll> ABtmp;
  for (int i = 0; i < K; i++)
  {
    ABtmp.push_back(AB.top());
    AB.pop();
    if(AB.empty()) break;
  }

  priority_queue<ll> ABC;
  int sz = ABtmp.size();
  for (int i = 0; i < min(K,sz); i++)
  {
    for (int j = 0; j < Z; j++)
    {
      ABC.push(ABtmp[i]+C[j]);
    }
  }
  
  for (int i = 0; i < K; i++)
  {
    cout << ABC.top() << "\n";
    ABC.pop();
  }
  
  
  return 0;
}

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


Measured memory_bytes: 43272
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int a, b, c, d;

	cin >> a >> b >> c >> d;

	if (a * b == c * d) {
		cout << a * b << endl;
	}
	else if (a * b > c * d) {
		cout << a * b << endl;
	}
	else {
		cout << c * d << endl;
	}	
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
	
	long long int a,b,x,ans=0;
	scanf("%lld %lld %lld",&a,&b,&x);
	if(a==0||a%x==0){
		ans++;
	}
	
	a=a/x;
	b=b/x;
	ans+=b-a;
	
	
	printf("\n%lld\n",ans);
	
	
	return 0;
}

Measured memory_bytes: 128
n = gets.to_i
s = gets.chomp

s.length.times do |i|
  if n > 0
    n.times do
      if s[i] == "z"
        s[i] = "a"
      elsif s[i] == "Z"
        s[i] = "A"
      else
        s[i] = s[i].succ
      end
    end
  end
end

puts s

Measured memory_bytes: 1788
def main():
    a = list(map(int, list(input())))
    for i in range(2**3):
        cnt = a[0]
        pm = []
        for j in range(3):
            if ((i >> j) & 1):
                cnt += a[j+1]
                pm.append('+')
            else:
                cnt -= a[j+1]
                pm.append('-')
        if cnt == 7:
            print('{}{}{}{}{}{}{}=7'.format(a[0], pm[0], a[1], pm[1], a[2], pm[2], a[3]))
            break

if __name__ == '__main__':
    main()

Measured memory_bytes: 62016
#include <iostream>

using namespace std;

int main(void)
{
	int n, a, b;
	cin >> n >> a >> b;
	int ans = 0;
	int get;
	for (int i = 0; i < n; i++) {
		cin >> get;
		if (get < a || get >= b) ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,m = inm()
d = [-1]*(n+1)
for i in range(m):
    s,c = inm()
    if d[s]>=0 and d[s]!=c:
        print(-1)
        exit()
    d[s] = c
if n>1 and d[1]==0:
    print(-1)
    exit()
if d[1]<0:
    d[1] = 1 if n>1 else 0
for i in range(2,n+1):
    if d[i]<0:
        d[i] = 0
for i in range(1,n+1):
    printn(d[i])
print('')


Measured memory_bytes: 38256
#include<stdio.h>
#include<string.h>
int main(void)
{
  int n,o,p;
  char s[10],b[3]={0};
  scanf("%d",&n);
  while(n--){
    o=p=0;
    while(o!=3){
      scanf("%s",s);
      if(!strcmp(s,"HIT")){
        if(b[2])b[2]=0,p++;
        if(b[1])b[2]=1,b[1]=0;
        if(b[0])b[1]=1;
        b[0]=1;
      }
      if(!strcmp(s,"OUT")){
        o++;
      }
      if(!strcmp(s,"HOMERUN")){
        p+=b[0]+b[1]+b[2]+1;
        memset(b,0,sizeof(b));
      }
    }
    memset(b,0,sizeof(b));
    printf("%d\n",p);
  }
  return 0;
}

Measured memory_bytes: 0
//Created by Young Charlie
#include <bits/stdc++.h>
using namespace std;
 
int N;
int x[10], y[10];
 
double dist(int i, int j) {
	double dx = x[i] - x[j];
	double dy = y[i] - y[j];
	return pow(dx * dx + dy * dy, 0.5);
}

int main() {
	cin >> N;
	for(int i = 1; i <= N; i++) cin >> x[i] >> y[i];
	double ans = 0.0;
	for(int i = 1; i < N; i++)
		for(int j = i + 1; j <= N; j++)
			ans += dist(i, j) * 2 / N;
	cout << fixed << setprecision(10) << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 1e9
#define f first
#define s second
using namespace std;
typedef pair <int,int> P;
typedef pair <double,P> PP;
PP in[20],dp[1<<15][20];
double get_time(double a,double b,double w){return abs(a-b)/(2000/(70+20*w));}

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++)cin>>in[i].f>>in[i].s.f>>in[i].s.s;

  for(int i=0;i<(1<<15);i++)
    for(int j=0;j<15;j++)dp[i][j]=PP(INF,P(INF,INF));


  for(int i=0;i<n;i++)dp[1<<i][i]=PP(0,P(in[i].s.s,INF));

  for(int i=0;i<(1<<n);i++)
    for(int j=0;j<n;j++) // prev
      for(int k=0;k<n&&(i&(1<<j));k++){ // next
	if((i&(1<<k)))continue;
	int ni=i|(1<<k);
	double nt=dp[i][j].f+get_time(in[j].s.f,in[k].s.f,dp[i][j].s.f);
	int nw=dp[i][j].s.f+in[k].s.s;
	dp[ni][k]=min(dp[ni][k],PP(nt,P(nw,j)));
      }
  
  int ans[16],bit=(1<<n)-1;
  PP mn=dp[bit][0];
  for(int i=1;i<n;i++) if(mn>dp[bit][i]) mn=dp[bit][i],ans[n-1]=i;
  for(int i=n-2;i>=0;i--){
    bit-=(1<<ans[i+1]);
    ans[i]=mn.s.s;
    mn=dp[bit][mn.s.s];
  }
  for(int i=0;i<n-1;i++) cout << in[ans[i]].f<<" ";
  cout <<in[ans[n-1]].f<<endl;
  return 0;
}

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

int main(){
    int n,m;
    cin >> n >> m;
    int num[n],s,c;

    for(int i=0;i<(sizeof(num)/sizeof(num[0]));++i){
        num[i]=-1;
    }

    for(int i=0;i<m;++i){
        cin >> s >> c;
        if(num[s-1]!=-1 && num[s-1]!=c){
            cout << -1;
            return 0;
        }else{
            num[s-1]=c;
        }
    }

    if(n!=1 && num[0]==-1){
        num[0]=1;
    }else if(n!=1 && num[0]==0){
        cout << -1 << endl;
        return 0;
    }else if(n==1 && m==0){
        cout << 0 << endl;
        return 0;
    }
    for(int i=1;i<n;++i){
        if(num[i]==-1){
            num[i]=0;
        }
    }
    for(int i=0;i<n;++i){
        cout << num[i];
    }
    cout << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<queue>
#include<algorithm>
#include<cstring>
#include<cctype>
#include<vector>
#include<ctime>
#include<cmath>
#include<bitset>
#include<map>
#define LL long long
#define pii pair<int,int>
#define mk make_pair
#define fi first
#define se second
using namespace std;
const int N = 82;
const int M = N * N * 2;
const int base = 6401;
bitset <12855> f[N][N];
int n,m;
int a[N][N],b[N][N];
inline int read(){
	int v = 0,c = 1;char ch = getchar();
	while(!isdigit(ch)){
		if(ch == '-') c = -1;
		ch = getchar();
	}
	while(isdigit(ch)){
		v = v * 10 + ch - 48;
		ch = getchar();
	}
	return v * c;
}
int main(){
	n = read(),m = read();
	for(int i = 1;i <= n;++i) for(int j = 1;j <= m;++j) a[i][j] = read();
	for(int i = 1;i <= n;++i) for(int j = 1;j <= m;++j) b[i][j] = read();
	f[1][1][base + a[1][1] - b[1][1]] = 1;
	f[1][1][base + b[1][1] - a[1][1]] = 1;
	for(int i = 1;i <= n;++i){
		for(int j = 1;j <= m;++j){
			int x = abs(a[i + 1][j] - b[i + 1][j]);
			int y = abs(a[i][j + 1] - b[i][j + 1]);
			if(i != n) f[i + 1][j] |= (f[i][j] << x),f[i + 1][j] |= (f[i][j] >> x);
			if(j != m) f[i][j + 1] |= (f[i][j] << y),f[i][j + 1] |= (f[i][j] >> y); 
		}
	}
	int ans = 0x3f3f3f3f;
	for(int i = base - 6400;i <= base + 6400;++i){
		if(f[n][m][i]) ans = min(ans,abs(i - base));
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 10624
def main():
	# n,m = map(int,input().split())
	n = int(input())
	a = list(map(int,input().split()))
	ans = 0
	den = 0
	for i in range(len(a)):
		if a[i] % 2 == 0:
			if a[i] % 3 == 0 or a[i] % 5 == 0:
				ans = 1
			else:
				den = 1
	if den == 0:
		print("APPROVED")
	else:
		print("DENIED")
	
 
if __name__ == '__main__':
	main()

Measured memory_bytes: 38384
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int n, y, m, d;
	public static void main(String[] args) {
		while(read()){
			//solve();
		}
	}
	
	static boolean read(){
		if(!sc.hasNext())return false;
		n = sc.nextInt();
		for(int i = 0; i < n; i++){
			y = sc.nextInt();
			m = sc.nextInt();
			d = sc.nextInt();
			solve();
		}
		return true;
	}
	
	static void solve(){
		int[] day = {20, 19, 20, 19, 20, 19, 20, 19, 20, 19};
		int res = 0;
		int year = 999;
		while(year > y){
			if(year % 3 == 0){
				res += 200;
			}else{
				res += 195;
			}
			year--;
		}
		if(y % 3 == 0){
			res += 200-((m-1)*20+d)+1;
		}else{
			int days = 0;
			for(int i = 0; i < m-1; i++){
				days += day[i];
			}
			res += 195-(days+d)+1;
		}
		System.out.println(res);
	}

}

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

int main () {
    double a, b, C;
    double S, L, h;
    scanf("%lf %lf %lf", &a, &b, &C);
    double rad;
    double PI = acos(-1);
    
    rad = C * PI / 180;
    S = a * b * sin(rad) / 2;
    L = a + b + sqrt((a * a) + (b * b) - (2 * a * b * cos(rad)));
    h = 2 * S / a;
    printf("%.15lf\n", S);
    printf("%.15lf\n", L);
    printf("%.15lf\n", h);
}


Measured memory_bytes: 2052
import sys
import bisect

sys.setrecursionlimit(10**9)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def LIST(): return [int(x) for x in input().split()]
MOD = 10**9 + 7

N, M = LIST()

A = [[] for _ in range(10**4+1)]
for _ in range(N):
    a, b = LIST()
    if a <= M:
        A[b].append(a)

for a in A:
    a.sort(reverse=True)

off = list(range(1, M+1))
ans = 0

i = 10**4
while i > 0:
    for a in A[i]:
        attempt = bisect.bisect_left(off, a)

        if attempt < len(off):
            off.pop(attempt)
            ans += i

    if off == []:
        break;
    else:
        i -= 1

print(ans)


Measured memory_bytes: 12148
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long MOD = 1000000007;



void solve(long long N, long long K){
    ll sum =0;
    vector<ll> lb(N+5);
    for(int i=0;i<N+1;i++){
        sum += i;
        sum %= MOD;
        lb[i+1] = sum;
    }
    vector<ll> blb(N+5);
    ll bsum =0;
    for(int i=0;i<=N;i++){
        int target = (N-i);
        bsum += target;
        bsum%=MOD;
        blb[i+2] = bsum+1;
    }
    blb[1] =0;

    ll ans =0;
    for(int i=K;i<=N+1;i++){
        ll temp = (sum+1-lb[i]+MOD);
        temp %= MOD;
        // cerr <<"lb=" << lb[i] <<"K=" << i<<"temp=" << temp << endl;
        ans += temp;
        ans %= MOD;
    }
    for(int i=K+1;i<=N;i++){
        ll temp =  (sum+1-blb[i]+MOD);
        temp %= MOD;
        // cerr <<"blb=" << blb[i] <<"K=" << i<<"temp=" << temp << endl;
        ans = ans + MOD -temp;
        ans %= MOD;
    }
    cout << ans << endl;

}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    solve(N, K);
    return 0;
}


Measured memory_bytes: 6328
#!/usr/bin/env python3
import numpy as np

h, w = list(map(int, input().split()))

a = np.array([list(input()) for i in range(h)])

need_h = []
need_w = []
for i in range(h):
    tmp = a[i, :].tolist()
    if set(tmp) != set(["."]):
        need_h.append(i)

# print(a)
for i in range(w):
    tmp = a[:, i].tolist()
    if set(tmp) != set(["."]):
        need_w.append(i)
# print(need_w)

# print(need_h)
# print(need_w)
ans = np.take(np.take(a, need_h, axis=0), need_w, axis=1)

for i in ans:
    print("".join(i.tolist()))


Measured memory_bytes: 27292
#include <iostream>

#define LIST(t) \
t("SUN", 7)     \
t("MON", 6)     \
t("TUE", 5)     \
t("WED", 4)     \
t("THU", 3)     \
t("FRI", 2)     \
t("SAT", 1)

int main()
{
    std::string s;
    std::cin >> s;

#define t(str, num) if (s == str) { std::cout << num << std::endl; } else
    LIST(t) {}
#undef t
#undef LIST
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct node{
	int x,y,step,op;
};
const int N=10005;
char maze[N][N];
bool vis[N][N];
int dx[]={0,0,-1,1};
int dy[]={1,-1,0,0};
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	int c1,c2,f1,f2;
	scanf("%d%d%d%d",&c1,&c2,&f1,&f2);
	for(int i=1;i<=n;i++){
		scanf("%s",maze[i]+1);
	}
	deque<node> q;
	q.push_front({c1,c2,0});
	vis[c1][c2]=1;
	while(!q.empty()){
		int nowStep=q.front().step;
		int x=q.front().x,y=q.front().y;
		if(q.front().op==1){
			vis[x][y]=1;
		}
		q.pop_front();
		if(x==f1&&y==f2){
			printf("%d",nowStep);
			return 0;
		}
		for(int i=0;i<4;i++){
			int vx=x+dx[i],vy=y+dy[i];
			if(vx<1||vy<1||vx>n||vy>m||vis[vx][vy]||maze[vx][vy]=='#')continue;
		//	printf("move %d %d\n",vx,vy);
			q.push_front({vx,vy,nowStep,0});
			vis[vx][vy]=1;
		}
		for(int i=x-2;i<=x+2;i++){
			for(int j=y-2;j<=y+2;j++){
				if(i<1||j<1||i>n||j>m||vis[i][j]||maze[i][j]=='#')continue;
		//		printf("tp %d %d\n",i,j);
				q.push_back({i,j,nowStep+1,1});
			}
		}
	}
	puts("-1");
	return 0;
} 

Measured memory_bytes: 17292
N, Q = map(int, input().split())
S = input()
LR = [tuple(map(int, input().split())) for _ in range(Q)]

cum = [0]*(N+1)

cnt = 0
for i in range(1,N):
    if S[i-1] == 'A' and S[i] == 'C':
        cnt += 1
    cum[i] = cnt

ans = []
for l, r in LR:
    result = cum[r-1] - cum[l-1]
    ans.append(result)

print(*ans, sep='\n')


Measured memory_bytes: 30356
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int Combination(int sum, int n);

int main(void)
{
	int n, m, ans;
	scanf("%d %d", &n, &m);
	ans = (n * (n - 1)) * 0.5;
	ans += (m * (m - 1)) * 0.5;

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

	return 0;
}

int Combination(int sum, int n)
{
	return (sum * (sum - 1)) / n;
}


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

long long mod = 1e9+7;
long long fact(int n){
  if(n==0) return 1;
  return (n*fact(n-1))%mod;
}
int main(){
    long long n, m;
    cin >> n >> m;
    long long ans = fact(n)*fact(m)%mod;
    if(abs(n-m)>1){
        cout << 0 << endl;
    }else if(n==m){
        cout << (ans*2)%mod << endl;
    }else{
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 5120
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
    ll N,K,h;
    cin >> N >>K;
    ll i;
    ll ans=0;
    for(i=0;i<N;i++){
        cin >> h;
        if(h>=K)ans++;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
S=list(input())
flag=0
Ccount=0
Cnumber=0
if S[0]=="A":
  flag+=1
if S[2:-1].count("C")==1:
  flag+=1
  del S[0]
  S.remove("C")
if str(S).islower():
  flag+=1
if flag==3:
  print("AC")
else:
  print("WA")

Measured memory_bytes: 3064
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
#define dbg(x...) do { cout << "\033[32;1m" << #x <<" -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<class T, class... Ts> void err(const T& arg,const Ts&... args) { cout << arg << " "; err(args...); }
const int N = 100010 + 5;
typedef double db;
const db eps = 1e-8;
const db INF = 1e20;
struct Point{
    db x, y;
    void input(){
        scanf("%lf%lf", &x, &y);
    }
}p[N];
db dist(Point a, Point b){
    return sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y));
}
Point tmpt[N];
bool cmpx(Point a, Point b){
    return a.x < b.x || (a.x == b.x && a.y < b.y);
}
bool cmpy(Point a, Point b){
    return a.y < b.y || (a.y == b.y && a.x < b.x);
}
db closest_pair(int left, int right){
    db d = inf;
    if(left == right) return d;
    if(left == right - 1) return dist(p[left], p[right]);
    int mid = left + right >> 1;
    db d1 = closest_pair(left, mid);
    db d2 = closest_pair(mid+1, right);
    d = min(d1, d2);
    int cnt = 0;
    for(int i=left;i<=right;i++){
        if(fabs(p[mid].x - p[i].x) <= d){
            tmpt[++cnt] = p[i];
        }
    }
    sort(tmpt + 1, tmpt + cnt + 1, cmpy);
    for(int i=1;i<=cnt;i++)
        for(int j=i + 1;j<=cnt && tmpt[j].y - tmpt[i].y < d;j++)
            d = min(d, dist(tmpt[i], tmpt[j]));
    return d;
}

int main(){
    int n;
    scanf("%d", &n);
    for(int i=1;i<=n;i++) p[i].input();
    sort(p+1, p+1+n, cmpx);
    printf("%.8f\n", closest_pair(1, n));

    return 0;
}


Measured memory_bytes: 5912
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int n; cin>>n;
    int a[1000];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    cout<<a[n-1]-a[0]<<endl;
    
}


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

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    vector<int> b(N);
    for (int i = 0; i < N; i++){
        cin >> a.at(i);
    }
    for (int i = 0; i < N; i++){
        cin >> b.at(i);
    }
    

    int max_ans=0;
    for (int i = 0; i < N; i++){
        int ans = 0;
        for (int j = 0; j < N; j++){
            if (j < i){
                ans += a.at(j);
            }
            else if (j == i){
                ans += a.at(j);
                ans += b.at(j);
            }
            else{
                ans += b.at(j);
            }
            if (ans>max_ans) {
                max_ans = ans;
            }
        }
    }
    
    cout << max_ans << endl;
}


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

int main(){
  int n;
  cin >> n;
  int a[n];
  for(int i=0;i<n;i++) cin >> a[i];
  int ans=1;
  int h=0;
  for(int i=1;i<n;i++){
    bool check=false;
    if(h==1&&a[i]<a[i-1]){
      ans++;
      h=0;
      check=true;
    }
    else if(h==-1&&a[i]>a[i-1]){
      ans++;
      h=0;
      check=true;
    }
    if(a[i]>a[i-1]){
      h=1;
    }
    else if(a[i]<a[i-1]){
      h=-1;
    }
    if(check){
      h=0;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#define rep(i, n) for (rint i = 1; i <= (n); i ++)
#define re0(i, n) for (rint i = 0; i < (int) n; i ++)
#define travel(i, u) for (rint i = head[u]; i; i = e[i].nxt)
#define rint register int
using namespace std;

typedef long long lo;

template<typename tp> inline void read(tp &x) {
    x = 0; char c = getchar(); int f = 0;
    for (; c < '0' || c > '9'; f |= c == '-', c = getchar());
    for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
    if (f) x = -x;
}
const int N = 3e5 + 233;
int ans, n, m, a[N];

inline bool check(int mid) {
    int lp = 0, rp = 0;
    mid *= 2;
    for (int k = 1; k <= mid; k++)
        lp = max(lp, (a[k] + a[mid - k + 1]) % m);
    for (int k = mid + 1; k <= 2 * n; k++)
        if (a[k] + a[2 * n - (k - mid) + 1] < m) return false;
        else rp = max(rp, (a[k] + a[2 * n - (k - mid) + 1]) % m);
    ans = max(lp, rp);
    return true;
}

int main(void) {
    read(n); read(m);
    rep (i, 2 * n) read(a[i]);
    sort(a + 1, a + 2 * n + 1);
    int l = 0, r = n;
    while (l < r) {
        int mid = l + (r - l) / 2;
        if (check(mid)) r = mid;
        else l = mid + 1;
    }
    check(r);
    cout << ans << "\n";
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
using Graph = vector<vector<ll>>;

int main(){
  string s;cin>>s;
  s.at(0)='2';
  s.at(1)='0';
  s.at(2)='1';
  s.at(3)='8';
  cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main() {
    int n; cin >> n;
    vector<int> a(n + 1); a[0] = 0;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    int point = 0;

    int sum = 0;
    for (auto e : a) {
        sum += abs(point - e);
        point = e;
    }
    sum += abs(point);

    for (int i = 1; i <= n; ++i) {
        int next = (i + 1) % a.size();
        int prev = i - 1;

        cout << (sum - abs(a[prev] - a[i]) - abs(a[i] - a[next]) + abs(a[prev] - a[next])) << endl;
    }
}



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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = l[0], b = l[1];

            if (a > 0) Console.WriteLine("Positive");
            else if (a <= 0 && b >= 0) Console.WriteLine("Zero");
            else
            {
                if ((a - b) % 2 == 0) Console.WriteLine("Negative");
                else Console.WriteLine("Positive");
            }
        }
    }
}


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

const int N = 200100;
int n, k, c, dp[N], dp2[N];
string s;

int main(){
	cin >> n >> k >> c;
	cin >> s;
	s = "*" + s;
	for (int i=1; i<=n; i++){
		dp[i] = dp[i-1];
		if (s[i] == 'x') continue;
		dp[i] = max(dp[i], dp[max(0, i - c - 1)] + 1);
	}
	for (int i=n; i; i--){
		dp2[i] = dp2[i+1];
		if (s[i] == 'x') continue;
		dp2[i] = max(dp2[i], dp2[min(n+1, i+c + 1)] + 1);
	}
	//for (int i=1; i<=n; i++) cout << dp[i] << ' ';
	//cout << '\n';
	//for (int i=1; i<=n; i++) cout << dp2[i] << ' ';
	//cout << '\n';
	for (int i=1; i<=n; i++){
		if (s[i] == 'x') continue;
		if (dp[i-1] + dp2[i+1] == k-1) cout << i << '\n';
	}
	return 0;
}


Measured memory_bytes: 3392
/*
 ____________________________________________________________
|                                                            |
|                   Author: ay2306                           |
|____________________________________________________________|

*/
#include <bits/stdc++.h>
//For ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define MOD 1000000007
#define test int t; cin>>t; while(t--)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopr(i,a,b) for(int i=a;i>=b;i--)
#define loops(i,a,b,step) for(int i=a;i<b;i+=step)
#define looprs(i,a,b,step) for(int i=a;i>=b;i-=step)
#define ull unsigned long long int
#define ll long long int
#define P pair
#define PLL pair<long long, long long>
#define PII pair<int, int>
#define PUU pair<unsigned long long int, unsigned long long int>
#define L list
#define V vector
#define D deque
#define ST set
#define MS multiset
#define M map
#define UM unordered_map
#define mp make_pair
#define pb push_back
#define pf push_front
#define MM multimap
#define F first
#define S second
#define IT iterator
#define RIT reverse_iterator
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define FILE_READ_IN freopen("input.txt","r",stdin);
#define FILE_READ_OUT freopen("output.txt","w",stdout);
#define all(a) a.begin(),a.end()
#define ord_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
// For ordered_set
using namespace __gnu_pbds;
const ll maxn = 1e5;

double ans = 0;
ll n,k;
double next(ll s,double c){
    if(s >= k)return c;
    return next(2*s,c/2);
}

int main(){
    cin >> n >> k;
    loop(i,1,n+1){
        ans+=(next(i,1.0)/n);
    }
    printf("%.10f",ans);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

int main(int argc, char const *argv[]) {
  int N;
  int L[200];
  std::cin >> N;
  for (int i = 0; i < 2*N; i++) {
    std::cin >> L[i];
  }

  int temp;
  for (int i = 0; i < 2*N-1; i++) {
    for (int j = 0; j < 2*N-1-i; j++) {
      if (L[j] > L[j+1]) {
        temp = L[j+1];
        L[j+1] = L[j];
        L[j] = temp;
      }
    }
  }

  int a = 0;
  for (int i = 0; i < 2*N; i+=2) {
    a += L[i];
  }
  std::cout << a << std::endl;
}


Measured memory_bytes: 256
#A=int(input())
#A=list(map(int,(input().split())))
N,M=list(map(int,(input().split())))
A=[]
B=[]
C=[]
for x in range(M):
	te,mp=list(map(int,(input().split())))
	A.append(te)
	B.append(mp)
	temp=list(map(int,(input().split())))
	c=0
	for x in temp:
		c+=2**(x-1)
	C.append(c)
dp=[]
for x in range(M+1):
	dp.append([-1]*(2**N))
dp[0][0]=0

for i in range(M):
	for j in range(2**N):
		if (dp[i][j]>=0):
			#買わなかった場合
			if (dp[i+1][j]==-1):
				dp[i+1][j]=dp[i][j]
			else:
				dp[i+1][j]=min(dp[i+1][j],dp[i][j])
			#買った場合
			if (dp[i+1][j|C[i]]==-1):
				dp[i+1][j|C[i]]=dp[i][j]+A[i]
			else:
				dp[i+1][j|C[i]]=min(dp[i+1][j|C[i]],dp[i][j]+A[i])
"""
for x in dp:
	print(x)
print("\n",C)"""
print(dp[M][2**N-1])

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

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) {
		cin >> a.at(i);
	}
	deque<int> deq;
	for(int i = 0; i < n; i++) {
		if(i%2 == 0) {
			deq.push_back(a.at(i));
		}
		else {
			deq.push_front(a.at(i));
		}
	}
	if(n%2 == 0) {
		while(!deq.empty()) {
			cout << deq.front() << " ";
			deq.pop_front();
		}
		cout << endl;
	}
	else {
		while(!deq.empty()) {
			cout << deq.back() << " ";
			deq.pop_back();
		}
		cout << endl;
	}	
}

Measured memory_bytes: 3840
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
using namespace std;
typedef int64_t ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
const int INF = 1001001001;
const ll LINF = 1e18;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const P p1, const P p2){ return p1.first < p2.first;};
bool p_comp_fg(const P p1, const P p2){ return p1.first > p2.first;};
bool p_comp_ss(const P p1, const P p2){ return p1.second < p2.second;};
bool p_comp_sg(const P p1, const P p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}


int main(){
    ll N, M; cin >> N >> M; vl xs(N, 0), ys(N, 0), zs(N, 0);
    REP(i, N) cin >> xs[i] >> ys[i] >> zs[i];
    ll ret = 0;
    REP(i, 8){
        vl vals(N, 0);
        ll sx = (i >> 0 & 1) ? 1 : -1;
        ll sy = (i >> 1 & 1) ? 1 : -1;
        ll sz = (i >> 2 & 1) ? 1 : -1;
        REP(i, N) vals[i] = sx * xs[i] + sy * ys[i] + sz * zs[i];
        sort(vals.begin(), vals.end(), greater<ll>());
        ll tmp = 0;
        REP(i, M) tmp += vals[i];
        ret = max(ret, tmp);
    }
    cout << ret << endstr;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
using namespace std;

int main(){
    string s;
    cin >> s;
    
    int len = s.size();
    
    int i = 0;
    
    int a;
    int min = 1000;
    for(i = 0; i <= len - 3 ; i++){
        a = 0;
        a += (s[i] - '0') * 100;
        a += (s[i + 1] - '0') * 10;
        a += (s[i + 2] - '0');
        if(min > abs(753 - a)){
            min = abs(753 - a);
        }
    }
    
    cout << min << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct ios_accelerate { ios_accelerate() { ios::sync_with_stdio(false); cin.tie(nullptr); } } CALL;

#define REP(i, n) for(auto (i) = (n)*0; (i) < (n); (i)++)
#define RNG(i, a, b) for(auto (i) = (a); (i) < (b); (i)++)
#define RBF(i, v) for(auto& (i) : (v))
#define ALL(x) (x).begin(), (x).end()

using LL = long long;
using UL = unsigned long;
using ULL = unsigned long long;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
template<typename T> using P = pair<T, T>;

const double PI = 3.141592653589793;
const int MOD = 1000000007;
const LL INF64 = static_cast<LL>(1e18) + 2;
const int INF = static_cast<int>(1e9) + 2;

template<typename T> inline void upsort(vector<T>& x) { sort(x.begin(), x.end()); }
template<typename T> inline void downsort(vector<T>& x) { sort(x.begin(), x.end(), greater<T>()); }
template<typename T> inline void col(T x) { cout << x << '\n'; }
template<> inline void col(double x) { cout << fixed << setprecision(12) << x << '\n'; }

signed main() {
	int n;
	cin >> n;
	set<int> aset;
	REP(i, n) {
		int a;
		cin >> a;
		aset.insert(a);
	}

	if (aset.size() == n) {
		col("YES");
	}
	else {
		col("NO");
	}

	return 0;
}


Measured memory_bytes: 12928
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = numeric_limits<int>::max();
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

int main() {
    int n;
    cin >> n;
    vl a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    vi maxi;
    maxi.push_back(a[0]);
    int colors = 1;
    for (int i = 1; i < n; ++i) {
        if (a[i] > maxi[0])
            maxi[0] = a[i];
        else if (a[i] <= maxi.back()) {
            colors++;
            maxi.push_back(a[i]);
        } else {
            int ng = 0;
            int ok = maxi.size() - 1;
            while (ng + 1 != ok) {
                int mid = (ng + ok) / 2;
                if (maxi[mid] < a[i])
                    ok = mid;
                else
                    ng = mid;
            }
            maxi[ok] = a[i];
        }
    }
    cout << colors << "\n";

    return 0;
}

Measured memory_bytes: 1660