akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
const int MAX = (1<<20);
const int mod = 100000;
#define rep(i,n) for(int i = 0;i < n;i++)

int dp[2][2][MAX];
int cur = 0, nex = 1, msk = MAX-1;
char str[22][22], ss[] = "JOI";

int solve(int y, int x, int s, char c){
	if(str[y][x] != c && str[y][x] != '?')return 0;
	if(c == 'I' && (s & (1<<x)))return 0;
	int mask = (1<<x)^msk;
	if(1 <= x && c == 'O')dp[nex][0][(s|(1<<(x-1)))&mask] += dp[cur][1][s];
	if(x == 0 && c == 'O')dp[nex][0][s&mask] += dp[cur][1][s];
	if(c == 'J')dp[nex][1][s&mask] += dp[cur][0][s]+dp[cur][1][s];
	if(c == 'O')dp[nex][0][s&mask] += dp[cur][0][s];
	if(c == 'I')dp[nex][0][s&mask] += dp[cur][0][s]+dp[cur][1][s];
	dp[nex][0][s&mask] %= mod;
	dp[nex][1][s&mask] %= mod;
	return 0;
}

int main(){
	int h, w;
	scanf("%d%d", &h, &w);
	for(int i = 0;i < h;i++)scanf("%s", str[i]);
	
	dp[0][0][0] = 1;
	rep(y,h)rep(x,w){
		fill((int*)(dp+nex), (int*)(dp+nex+1), 0);
		rep(s,(1<<w))if(dp[cur][0][s] || dp[cur][1][s])rep(i,3){
			solve(y, x, s, ss[i]);
		}
		swap(cur, nex);
	}
	
	int ans = 1;
	rep(i,h)rep(j,w)if(str[i][j] == '?')ans = (ans*3)%mod;
	rep(i,2)rep(j,(1<<w))ans = (ans-dp[cur][i][j]+mod)%mod;
	printf("%d\n", ans);
	return 0;
}


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

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

    return 0;
}



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

int main() {
  int N,M;
  int sum=0;
  cin >> N>> M;
  if(N>1){
    sum=N*(N-1)/2;
  }
  if(M>1){
    sum=sum+M*(M-1)/2;
  }
  cout << sum <<endl;
}


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

int main()
{
	int N, K, R, S, P;
	string T;
	cin >> N >> K >> R >> S >> P >> T;

	vector<char> v( N );
	long long ans = 0;
	for( int i = 0; i < N; i++ ) {
		if( T[i] == 'r' ) {
			if( i < K || i >= K && v[i - K] != 'P' ) {
				ans += P;
				v[i] = 'P';
			}
			else {
				if( v[i - K] == 'P' && T[i - K] == 'p' ) {
					v[i - K] = 'R';
					v[i] = 'P';
					ans += P;
				}
				else {
					v[i] = 'R';
				}
			}
		}
		else if( T[i] == 's' ) {
			if( i < K || i >= K && v[i - K] != 'R' ) {
				ans += R;
				v[i] = 'R';
			}
			else {
				if( v[i - K] == 'R' && T[i - K] == 'r' ) {
					v[i - K] = 'S';
					v[i] = 'R';
					ans += R;
				}
				else {
					v[i] = 'S';
				}
			}
		}
		else if( T[i] == 'p' ) {
			if( i < K || i >= K && v[i - K] != 'S' ) {
				ans += S;
				v[i] = 'S';
			}
			else {
				if( v[i - K] == 'S' && T[i - K] == 's' ) {
					v[i - K] = 'P';
					v[i] = 'S';
					ans += S;
				}
				else {
					v[i] = 'P';
				}
			}
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define maxn 100086

using namespace std;

typedef long long ll;

ll x, k, d;

__int128 X, K, D, i;

int main(){
	scanf("%lld%lld%lld", &x, &k, &d);
	x = abs(x);
	X = x, K = k, D = d;
	if(X >= K * D) return printf("%lld", x - k * d), 0;
	i = X / D;
	if((K - i) & 1) printf("%lld", d - x % d);
	else printf("%lld", x % d);
}

Measured memory_bytes: 3784
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long  n,k,cnt=0,scnt=0;
  long long ans=0;
  cin>>n>>k;
  if(k%2 == 0){
    for(int i=1;i<=n;i++){
      if(i%k == 0)
        cnt++;
      if(i%k == k/2)
        scnt++;
    }    
  }else{
    for(int i=1;i<=n;i++){
      if(i%k == 0)
        cnt++;
    }    
  }
  cout<<cnt*cnt*cnt+scnt*scnt*scnt<<endl;
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace ABC129B
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = CIN.Int();
            var W = CIN.LongArray();

            var Sum = W.Sum();
            var ans = Sum;
            long temp = 0;
            for (int i = 0; i < N; i++)
            {
                temp += W[i];
                ans = Math.Min(ans, Math.Abs(Sum - 2 * temp));
            }
            Console.WriteLine(ans);
        }
    }

    internal static class CIN
    {
        public static string String()
        {
            return Console.ReadLine();
        }

        public static int Int()
        {
            return int.Parse(Console.ReadLine());
        }

        public static int[] IntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        public static long Long()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] LongArray()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] DoubleArray()
        {
            return Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        }
    }
}

Measured memory_bytes: 13396
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

lint lcm(lint a, lint b) {
    return (a / gcd(a, b)) * b;
}

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

// vars
lint n, k;

void input(){
    cin >> n >> k;
}

void solve(){
    if(k == 1){
        cout << 0 << endl;
        return;
    }
    while(n >= k){
        lint r = n / k;
        n -= r * k;
    }
    lint ans1 = n;
    lint ans2 = abs(n - k);
    lint ans = min(ans1, ans2);
    cout << ans << endl;
}

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Scanner;

/**
 * @author takahiro 問題文 √a+√b<√c ですか？<br>
 *     制約 1 ≤ a,b,c ≤ 10^9 入力は全て整数である。
 */
public class Main {

  public static void main(final String[] args) throws IOException {
    try (final Scanner scanner = new Scanner(System.in)) {
      final Input input = new Input(scanner);
      execute(input);
    }
  }

  private static void execute(final Input input) {
    Result.toResult(calculate(input)).answer();
  }

  private static final BigDecimal FOUR = new BigDecimal("4");
  /**
   * √a+√b < √c <br>
   * = a + 2√ab + b < c <br>
   * = 2√ab < c - a - b <br>
   * = 2√ab < minused <br>
   * = 4 * a * b < minused^2
   */
  private static boolean calculate(final Input input) {
    final int a = input.getA();
    final int b = input.getB();
    final int c = input.getC();
    final int minused = c - a - b;
    if (minused < 0) {
      return false;
    }
    return FOUR.multiply(BigDecimal.valueOf(a))
            .multiply(BigDecimal.valueOf(b))
            .compareTo(BigDecimal.valueOf(minused).pow(2))
        < 0;
  }

  private static class Input {

    private Input(final Scanner scanner) {
      a = scanner.nextInt();
      b = scanner.nextInt();
      c = scanner.nextInt();
    }

    public int getA() {
      return a;
    }

    public int getB() {
      return b;
    }

    public int getC() {
      return c;
    }

    private final int a, b, c;
  }

  private enum Result {
    Yes,
    No;

    private static Result toResult(final boolean calculate) {
      return calculate ? Yes : No;
    }

    private void answer() {
      System.out.println(this.toString());
    }
  }
}


Measured memory_bytes: 22996
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 6)
mod = 10**9+7
cnt = 0
ans = 0
num = []
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()

n,m = I()

if 2*n <= m:
    ans += n
    m -= n*2
    ans += m//4
else:
    ans = m//2
print(ans)


Measured memory_bytes: 10480
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define SCLLD(n) scanf("%lld",&n)
#define SCLLD2(m,n) scanf("%lld%lld",&m,&n)
#define SCLLD3(m,n,k) scanf("%lld%lld%lld",&m,&n,&k)
#define PB push_back
#define MP make_pair
#define ARSCD(A,N) REP(i,N){SCD(A[i]);}
#define ARSCD1(A,N) FORq(i,1,N){SCD(A[i]);}
#define PRINTD(n) printf("%d\n",n)
#define PRINTLLD(n) printf("%lld\n",n)
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x,S) (S.count(x) != 0)
using namespace std;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector < VI > VVI;
typedef long long ll;
typedef long long integer;
//////////////////////////////////////////////////
int main(){
    int x,y; SCD2(x,y);
    int ans;
    if ((0<x) and (x<y)) ans = y-x;
    if ((0<y) and (y<x)) ans = y+x;
    if ((x<y) and (y<0)) ans = y-x;
    if ((y<x) and (x<0)) ans = 2+x-y;
    if ((x<0) and (0<y)){
        if (-x < y) ans = 1+y+x;
        if (-x > y) ans = 1-y-x;
        if (-x == y) ans = 1;
    }
    if ((y<0) and (0<x)){
        if (x<-y) ans = -y-x+1;
        if (-y<x) ans = 1+y+x;
        if (-y==x) ans = 1;
    }

    if (x==0){
        if (y>0){
            ans = y;
        }else{
            ans = -y+1;
        }
    }

    if (y==0){
        if (x>0) ans = 1+x;
        else ans = -x;
    }
    if (x==y) ans = 0;

    PRINTD(ans);
}

Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

#ifdef DEBUG
mt19937 mrand(300); 
#else
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count()); 
#endif

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = (int) 2e5 + 5;
int n;
vector<int> g[maxn];
long long d[maxn];

bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    g[i].clear();
  }
  d[0] = 0;
  for (int i = 1; i < n; i++) {
    int p, w;
    scanf("%d%d", &p, &w);
    p--;
    g[p].push_back(i);
    d[i] = d[p] + w;
  }
  return true;
}

vector<pair<long long, long long>> dfs(int v, long long maxd) {
  if (g[v].empty()) {
    return {make_pair(d[v], d[v])};
  }
  assert(sz(g[v]) == 2);
  auto a = dfs(g[v][0], maxd), b = dfs(g[v][1], maxd);
  if (sz(a) > sz(b)) {
    swap(a, b);
  }
  vector<pair<long long, long long>> ans;
  long long mn = infll;
  for (int i = sz(a) - 1, j = 0; i >= 0; i--) {
    while (j < sz(b) && b[j].first <= maxd + 2 * d[v] - a[i].first) {
      mn = min(mn, b[j].second);
      j++;
    }
    if (mn < (ans.empty() ? infll : ans.back().second)) {
      ans.push_back(make_pair(a[i].second, mn));
    }
  }
  {
    vector<pair<long long, long long>> rev = ans;
    for (int i = 0; i < sz(rev); i++) {
      swap(rev[i].first, rev[i].second);
    }
    reverse(rev.begin(), rev.end());
    vector<pair<long long, long long>> tmp(sz(ans) + sz(rev));
    merge(ans.begin(), ans.end(), rev.begin(), rev.end(), tmp.begin());
    ans = tmp;
  }
  {
    int k = 0;
    for (int i = 0; i < sz(ans); i++) {
      if (!k || ans[i].second < ans[k - 1].second) {
        ans[k++] = ans[i];
      }
    }
    ans.resize(k);
  }
  return ans;
}

void solve() {
  long long l = -1, r = (long long) maxn * maxn;
  while (l < r - 1) {
    long long m = (l + r) / 2;
    if (!dfs(0, m).empty()) {
      r = m;
    } else {
      l = m;
    }
  }
  printf("%lld\n", r);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
typedef long long ll;

int main() {
    double l; cin >> l;
    double a = l / 3;
    double b = l - 2*a;
    cout << fixed << setprecision(12) << a*a*b << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main () {
  int cont=0;
  int n;
  cin >> n;
  for ( int i = 0 ; i < n ; ++i ) {
    int d1, d2;
    cin >> d1 >> d2;
    if ( d1 == d2 ) {
      ++cont;
      if ( 3 <= cont ) { cout << "Yes" << endl; return 0; }
    } else {
      cont = 0;
    }
  }
  cout << "No" << endl;
} 

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

using namespace std;
#define fast	ios::sync_with_stdio(0);cin.tie(0);
#define ll 		long long int
#define INF     1e18L
#define precision(x)	fixed << setprecision(x)
const ll mod = 1e9 + 7;

ll gcd(ll a, ll b) {
	if (b == 0)  return a;
	return gcd(b , a % b);
}


ll powm(ll a, ll b) {
	ll res = 1;
	while (b) {
		if (b & 1)
			res = (res * 1LL * a) % mod;
		b >>= 1LL;
		a = (a * 1LL * a) % mod;
	}
	return res;
}
const int N = 2e5 + 5;

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



void solve() {

	int n; cin >> n;
	int k;  cin >> k;
	vector<pair<int, int>> f;
	for (int i = 0; i < k; i++) {
		int l, r;
		cin >> l >> r;
		f.push_back({l, r});
	}
	sort(f.begin(), f.end());
	ll dp[N] = {0};
	dp[1] = 1;
	int md = 998244353;
	for (int i = 2; i <= n; i++) {
		for (auto [l, r] : f) {
			if (l > i)break;
			if (r < i) {
				dp[i] += dp[i - l] - dp[i - r - 1];
			} else {
				dp[i] += dp[i - l];
			}
			dp[i] %= md;
		}
		dp[i] += dp[i - 1];
	}
	cout << (dp[n] - dp[n - 1] + md + md) % md << endl;
}

int main() {
	fast
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int tc = 1;
	// cin >> tc;

	int _ = 0;
	while (_++ < tc) {
		solve();
	}

	return 0;
}






Measured memory_bytes: 5212
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws IOException {
        try (PrintWriter writer = new PrintWriter(System.out); InputReader reader = new InputReader(System.in)) {
            solve(writer, reader);
        }
    }

    private static void solve(PrintWriter writer, InputReader reader) throws IOException {
        int[] ints = reader.readIntsSplitByDelimiter(" ");
        Arrays.sort(ints);
        writer.println(ints[2] * 10 + ints[1] + ints[0]);
        writer.flush();
    }
}

class Util {
    static int gcd(int m, int n) {
        int min = Math.min(m, n);
        int max = Math.max(m, n);
        while (min != 0) {
            int tmp = min;
            min = max % tmp;
            max = tmp;
        }

        return max;
    }
}

class InputReader implements Closeable, AutoCloseable {
    private final BufferedReader br;

    InputReader(InputStream inputStream) {
        this.br = new BufferedReader(new InputStreamReader(inputStream));
    }

    String readLine() throws IOException {
        return this.br.readLine();
    }

    int readInt() throws IOException {
        return Integer.parseInt(this.readLine());
    }

    long readLong() throws IOException {
        return Long.parseLong(this.readLine());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(this.readLine());
    }

    String[] readStringsSplitByDelimiter(String delimiter) throws IOException {
        return this.readLine().split(delimiter);
    }

    int[] readIntsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.readStringsSplitByDelimiter(delimiter);

        int stringsLength = strings.length;
        int[] ints = new int[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            ints[i] = Integer.parseInt(strings[i]);
        }

        return ints;
    }

    long[] readLongsSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.readStringsSplitByDelimiter(delimiter);

        int stringsLength = strings.length;
        long[] longs = new long[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            longs[i] = Long.parseLong(strings[i]);
        }

        return longs;
    }

    double[] readDoublesSplitByDelimiter(String delimiter) throws IOException {
        String[] strings = this.readStringsSplitByDelimiter(delimiter);

        int stringsLength = strings.length;
        double[] doubles = new double[stringsLength];
        for (int i = 0; i < stringsLength; i++) {
            doubles[i] = Double.parseDouble(strings[i]);
        }

        return doubles;
    }

    @Override
    public void close() throws IOException {
        this.br.close();
    }
}


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

#define ll long long
#define pi pair<int,int>
#define ppi pair<pi,pi>
#define mp make_pair
#define fr first
#define sc second

using namespace std;


int main(){

    ios::sync_with_stdio(0);
    cin.tie(0) , cout.tie(0);


    int k; cin >> k;
    ll sum = 0;
    for(int i = 1;i <= k;i++)
        for(int j = 1;j <= k;j++)
            for(int l = 1;l <= k;l++)
                sum += __gcd(__gcd(i , j), l);
    cout << sum << '\n';


    return 0;
}


Measured memory_bytes: 3652
N,T=map(int, input().split())
minC = 1000
minT = T+1
for i in range(N):
  c,t=map(int, input().split())
  if t<minT:
    minT = t
  if t<=T and c<minC:
    minC = c

if minT<=T:print(minC)
else: print("TLE")

Measured memory_bytes: 3060
k,n = map(int,input().split())
a_inputs = [int(a) for a in input().split()]

longest = a_inputs[0]+(k-a_inputs[-1])
for i in range(n-1):
    if a_inputs[i+1]-a_inputs[i]>longest:
        longest = a_inputs[i+1]-a_inputs[i]

print(k-longest)

Measured memory_bytes: 26436
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    int N;
    cin >> N;
    int S, E;
    int res{};
    REP( i, N )
    {
        cin >> S >> E;
        res += S == E ? 1 : E - S + 1;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
W, H, N = map(int, input().split())

W_right = W
W_left = 0
H_up = H
H_down = 0
for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1:
        if W_left < x:
            W_left = x
    elif a == 2:
        if W_right > x:
            W_right = x
    elif a == 3:
        if H_down < y:
            H_down = y
    else:
        if H_up > y:
            H_up = y

if W_right >= W_left and H_up >= H_down:
    print((W_right - W_left) * (H_up - H_down))
else:
    print(0)

Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String s = sc.next();
        String t = sc.next();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            sb.append(s.charAt(i));
            sb.append(t.charAt(i));
        }
        System.out.println(sb.toString());
    }
}

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

int main(void){
    ll N;
    cin >> N;
    vector<string> S(N);
    for(int i=0; i<N; i++){
        cin >> S[i];
    }
    sort(S.begin(), S.end()); 
    S.erase(unique(S.begin(), S.end()), S.end());
    cout << S.size() << endl;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
#include <iostream>
#include <functional>
#include <vector>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <math.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define rep1(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define per1(i,a,n) for (int i=a;i>n;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define endl "\n"
#define pi 3.14159265358979323846264338327950288419716939937510
#define IOS cin.sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll mod=1000000007;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll qpow(ll a,ll b){ll s=1;while(b>0){if(b%2==1){s=s*a;}a=a*a;b=b>>1;}return s;}
ll qpowmod(ll a, ll b, ll c){ll res, t;res=1;t=a%c;while(b){if(b & 1){res=res*t%c;}t=t*t%c;b>>=1;}return res;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline long long read(){long long k=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}return k*f;}
inline void write(long long x){if(x<0)x=-x,putchar('-');if(x>9)write(x/10);putchar(x%10+'0');}
// head
const int maxn=2e5+5;
ll t,n,a[maxn];
signed main()
{
    //IOS;
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    double a,b,c;
    cin>>a>>b>>c;
    if(a>b*c)
    {
        cout<<"No"<<endl;
    }
    else
    {
        cout<<"Yes"<<endl;
    }
    return 0;
}
/*

*/


Measured memory_bytes: 3712
#include<iostream>
#include<queue>
#include<map>
#include<cstring>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define fr first
#define sc second
#define INF 100
typedef pair<int,int>Pt;
int main(){
  int dp[1001],s[1001],g[1001];
  int n,W,a = 1;
  while(cin >> n && n){
    cin >> W;
    for(int i=0;i<W;i++){
      scanf("%d,%d",&s[i],&g[i]);
    }
    memset(dp,-1,sizeof(dp));
    dp[0] = 0; //Empty
    for(int i=0;i<W;i++){
      for(int j = n-g[i];j>=0;j--){
        if(dp[j] >= 0) dp[j+g[i]] = max(dp[j+g[i]],dp[j]+s[i]);
      }
    }
    int p=0,q=0;
    for(int i=0;i<=n;i++){
      if(dp[i] > p){
        p = dp[i];
        q = i;
      }
    }
    cout << "Case " << a++ << ":" << endl << p << endl << q << endl;
  }
}

Measured memory_bytes: 1256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<short, short> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 100000007;
const double EPS = 1e-10;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

double ax, ay, ar, bx, by, br;
double d;
int main()
{
	int n; cin >> n;
	REP(i, n)
	{
		cin >> ax >> ay >> ar >> bx >> by >> br;
		d = abs(ax - bx)*abs(ax - bx) + abs(ay - by)*abs(ay - by);
		int ans;
		if (d > (ar + br)*(ar + br)) ans = 0;
		else if (ar > br && (ar - sqrt(d)) > br) ans = 2;
		else if (ar < br && (br - sqrt(d)) > ar) ans = -2;
		else ans = 1;
		cout << ans << endl;
	}
}

Measured memory_bytes: 1240
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n; cin >> n;
  vector<long long>a(3 * n);
  long long sum = 0;
  for(int i = 0; i < 3 * n; i++)
    cin >> a.at(i);
  sort(a.rbegin(),a.rend());
  for(int i = 1; i <2 * n ; i+=2)
    sum += a.at(i);
  
  cout << sum << endl;;
}

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

using namespace std;

int main(void) {
    int x, n;
    cin >> x >> n;
    vector<int> p(n);
    for (auto &_p: p) cin >> _p;
    int ans;
    for (int i = 0; i < 200; ++i) {
        bool can2 = true;
        int tm = x - i;
        for (int j = 0; j < n; ++j) {
            if (p[j] == tm) {
                can2 = false;
                break;
            }
        }
        if (can2) {
            ans = tm;
            break;
        }
        bool can = true;
        int t = x + i;
        for (int j = 0; j < n; ++j) {
            if (p[j] == t) {
                can = false;
                break;
            }
        }
        if (can) {
            ans = t;
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3628
//g++ -std=gnu++14 a.cpp

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>
#include <stdio.h>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;
ll MODP = 998244353;

ll kai(ll x,ll y){
  if(y == 0)return 1;
  if(y == 1)return x;
  if(y&1){
    return (x*kai(x,y-1))%MOD;
  }else{
    ll t = kai(x,y/2);
    return (t*t)%MOD;
  }
}

ll comb(ll a,ll b,vector<ll> &p){
  if(a == 0)return 1;
  if(b == 0)return 1;
  ll ans = p[a+b];
  ans = (ans*kai(p[a],MOD-2))%MOD;
  ans = (ans*kai(p[b],MOD-2))%MOD;
  return ans;
}

ll mind(int x,vector<int> &v){
  int ok = v.size()-1,ng = -1;
  while(ok - ng > 1){
    int next = (ok+ng)/2;
    if(v[next] > x){
      ok = next;
    }else{
      ng = next;
    }
  }
  return ok;
}

ll maxd(int x,vector<int> &v){
  int ok = 0,ng = v.size();
  while(ng - ok > 1){
    int next = (ok+ng)/2;
    if(v[next] < x){
      ok = next;
    }else{
      ng = next;
    }
  }
  return ok;
}

int main(){
  ll X,K,D,minus;
  cin >> X >> K >> D;
  if(X < 0)X *= -1;
  if((X/D) < K){
    minus = X/D;
  }else{
    minus = K;
    cout << X - D*K << endl;
    return 0;
  }
  X = X - minus*D;
  K -= minus;
  if(K&1){
    cout << abs(D-X) << endl;
  }else{
    cout << X << endl;
  }




  return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>

using namespace std;

//#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ; //何もしない文
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

int N;
LL W;
vector<LL> w(105);
VI v(105);
int dp[105][310][105];

int rec(int i, int j, int k) //i番目の品物以降で重さj以下かつ個数k以下となるよう選んだときの最適解
{
    dump(i)
    dump(j)
    dump(k)
    LL res;
    if(dp[i][j][k] != -1) return dp[i][j][k];
    if(k == 0) return dp[i][j][k] = 0;

    if(i == N){
        return dp[i][j][k] = 0;
    }
    else if(j < w[i]){
        res = rec(i+1,j,k);
        return dp[i][j][k] = res;
    }
    else{
        //LL tmpa = rec(i+1,j,k);
        //LL tmpb = rec(i+1,j-w[i],k-1)+v[i];
        //if(tmpa > tmpb)
        //{
        //    return dp[i][j][k] = tmpa;
        //}
        //else
        //{
        //    return dp[i][j][k] = tmpb;
        //}
        res = max(rec(i+1,j,k), rec(i+1,j-w[i],k-1)+v[i]);
        return dp[i][j][k] = res;
    }
}

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> N;
    cin >> W;
    LL w1;
    REP(i,N)
    {
        cin >>w[i]>>v[i];
        if(i == 0) w1 =w[0];
        else w[i] -= w1;
    }
    w[0] = 0;
    LL ans = 0;

    for(LL i = 1; i < 101; i++)
    {
        dump(i)
        int limitW;
        if(W-w1*i<0)  continue;
        if(W-w1*i > 309)
        {
            limitW = 309;
        }
        else limitW = W - w1*i;

        REP(j,105) REP(k,310) REP(l,105) dp[j][k][l] = -1;
        LL tmp = rec(0,limitW,i);
        dump(tmp)
        if(ans < tmp) ans = tmp;
    }
    cout << ans << endl;



}

Measured memory_bytes: 13568
#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  int h,w; cin >>h>>w;
  vector<vector<char>> G(h,vector<char>(w));
  rep(i,h){
    rep(j,w){
      cin >>G[i][j];
    }
  }
  rep(i,h){
    ll key=0;
    rep(j,w){
      if(G[i][j]=='.'){
        key++;
      }
    }
      if(key==w){
        G.erase(G.begin()+i);
        i--;
        h--;
      }
    }
  rep(i,w){
    ll key=0;
    rep(j,h){
      if(G[j][i]=='.'){
        key++;
      }
    }
    if(key==h){
      rep(k,h){
        G[k].erase(G[k].begin()+i);
      }
      w--;
      i--;
    }
  }
  rep(i,h){
    rep(j,w){
      if(j==w-1){
        cout <<G[i][j]<<endl;
      }else{
        cout <<G[i][j];
      }
    }
  }
    return 0;
}

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

int main(){
  int a,b;
  string s;
  cin >> a >> b >> s;

  string ans="Yes";
  rep(i,a){
    if(s[i]>='0' && s[i]<='9')continue;
    else {
      ans="No";
      cout << ans << endl;
      return 0;
    }
  }
  
  if(s[a]!='-'){
      ans="No";
      cout << ans << endl;
      return 0;
  }
  
  rep(i,b){
    if(s[a+1+i]>='0' && s[a+1]<='9')continue;
    else {
      ans="No";
      cout << ans << endl;
      return 0;
    }
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 3584
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;
using ll = long long;

int main() {
  ll X, Y;
  cin >> X >> Y;
  ll res = X % Y == 0 ? -1 : X;
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
while True:
    a,op,b = input().split()
    a =int(a)
    b =int(b)
    
    if op == '?':
        break
     
    if op == '+':
        print(a+b)

    if op == '-':
        print(a-b)

    if op == '*':
        print(a*b)
 
    if op == '/':
        print(a//b)

Measured memory_bytes: 7656
#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>
/*
//#if __cplusplus >= 201103L
#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>
/*
//#if __cplusplus >= 201103L
#include <array>
#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>
*/
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

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

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000
int n,m,v,i,j;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n;
  ll ans = 0;
  repl(i,1,n+1){
    ll cnt = 0;
    if(i%2==0) continue;
    repl(j,1,i+1) if(i%j==0) cnt++;
    if(cnt==8) ans++;
  }
  cout<<ans<<endl;
}

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


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;

    if (y%2 || x * 2 > y || 4*x < y)
    {
        cout << "No\n";
    }
    else
    {
        cout << "Yes\n";
    }

    return 0;
}


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

   typedef long long ll;
   typedef pair<ll, ll> Pii;
   typedef vector<ll> Vi;
   typedef vector<Vi> VVi;

   const double EPS = (1e-7);
   const ll INF =(1e13);
   const double PI = (acos(-1));
   const ll MOD = 998244353;

   #define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
   #define REPR(i, n) for(ll i = n; i > -1; i--)
   #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
   #define ALL(x) (x).begin(),(x).end()
   #define SORT(x) sort((x).begin(), (x).end())
   #define RSORT(x) sort((x).rbegin(), (x).rend())
   #define REVERSE(x) reverse((x).begin(), (x).end())
   #define SZ(x) ((ll)(x).size())
   #define pb push_back
   #define mp make_pair

   //chmax(a, b): a>bならaをbで更新　更新したときにtrueを返す
   //chmin(a, b): a<bならaをbで更新　更新したときにtrueを返す
   template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
   template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

   #define dump(x) cerr<< #x << "= " << (x) << endl;

   ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
   ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;}
   ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (a == 0) return 0; else if (b % 2 == 0) return (pow((a * a) % m, b / 2, m) % m); else return (pow((a * a) % m, b / 2, m) * a) % m;}
   ll residue(ll a, ll m){return ((a % m) + m) % m;};

   ll dx[4]={1,0,-1,0};
   ll dy[4]={0,1,0,-1};

const ll MAX_N = 300, MAX_S = 300 * 300;
ll dp1[MAX_N + 1][MAX_S + 1] = {};
ll dp2[MAX_N + 1][MAX_S + 1] = {};
int main(){
  ll n; cin >> n;
  Vi a(n); REP(i, n) cin >> a[i];
  Vi s(n + 1, 0);
  REP(i, n){
    s[i + 1] = s[i] + a[i];
  }

  dp1[0][0] = 1;
  dp2[0][0] = 1;
  REP(i, n){
    REP(x, s[i + 1] + 1){
      if(x >= a[i]){
        dp1[i + 1][x] = (dp1[i][x - a[i]] + 2 * dp1[i][x]) % MOD;
        dp2[i + 1][x] = (dp2[i][x - a[i]] + dp2[i][x]) % MOD;
      }
      else{
        dp1[i + 1][x] = (2 * dp1[i][x]) % MOD;
        dp2[i + 1][x] = dp2[i][x];
      }
    }
  }
  ll total = pow(3, n, MOD);
  ll temp = 0;
  if(s[n] % 2 != 0){
    FOR(j, s[n] / 2 + 1, s[n] + 1){
      temp += dp1[n][j] * 3;
    }
  }
  else{
    FOR(j, s[n] / 2, s[n] + 1){
      temp += dp1[n][j] * 3;
    }
    temp -= dp2[n][s[n] / 2] * 3;
  }
  cout << residue(total -temp, MOD) << endl;

}


Measured memory_bytes: 421504
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string D;
    cin>>D;
    if(D=="SUN"){
        cout<<7<<endl;
    }
    else if(D=="MON"){
        cout<<6<<endl;
    }
    else if(D=="TUE"){
        cout<<5<<endl;
    }
    else if(D=="WED"){
        cout<<4<<endl;
    }
    else if(D=="THU"){
        cout<<3<<endl;
    }
    else if(D=="FRI"){
        cout<<2<<endl;
    }
    else if(D=="SAT"){
        cout<<1<<endl;
    }
}


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

int main(){
  string s; cin>>s;
  long cnt=0, tmp=0, ans=0;
  for(int i=0;i<s.size();i++){
    if(s[i]=='A' || s[i]=='T' || s[i]=='C' || s[i]=='G'){
      tmp++;
      cnt=max(tmp,cnt);
    }else{
      tmp=0;
    }
  }
  cout <<cnt <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 using namespace std;
 using pii = pair<int, int>;
 using ll = long long;
 #define rep(i, j, n) for(int i = j; i < (int)(n); i++)
 const ll MOD = 1000000007;
 const ll INFL = (1LL << 60);
 const int INFI = (1 << 30);

 int main() {
   int A, B, C, D; cin >> A >> B >> C >> D;
   if (ceil(A * 1.0 / D) >= ceil(C * 1.0 / B)) cout << "Yes" << endl;
   else cout << "No" << endl;
 }


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

using namespace std;

int main(){      
    string s;   
    cin >> s;
    sort(s.begin(),s.end());
    if( s[0] == s[1] && s[1] != s[2] && s[2] == s[3]){
        cout << "Yes" << endl;
    }else{
    cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<typename T> using gpp_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T, typename L> using gpp_map = tree<T, L, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T> using gpp_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define Return(ans) { cout << (ans) << endl; return 0; }
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;
//#define Add(x, y) x = (x + (y)) % mod
//#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int K; cin >> K;
    queue<int> que;
    FOR(i, 1, 10) que.push(i);
    int ans;
    REP(i, K){
        ans = que.front(); que.pop();
        int x = ans % 10;
        if(x > 0) que.push(ans * 10 + x - 1);
        que.push(ans * 10 + x);
        if(x < 9) que.push(ans * 10 + x + 1);
    }
    Out(ans);

    return 0;
}


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

int main()
{
    char S[10+1];
    int max;
    int count;
    int i;

    scanf("%s", S);

    max = 0;
    count = 0;
    for(i = 0; i < strlen(S); i++) {
        if(S[i] != 'A' && S[i] != 'C' && S[i] != 'G' && S[i] != 'T') {
            if(count > max) {
                max = count;
            }
            count = 0;
        } else {
            count += 1;
        }
    }
    if(count > max) {
        max = count;
    }

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

    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define rep(I,N) for(int I = 0; I < (int)(N); I++)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);

int main(void){
	int dp[4][51];
	fill_n(*dp, 4*51, 0);
	rep(i, 10)dp[0][i] = 1;
	for(int i = 1; i <= 3; i++){
		for(int j = 36; j >= 0; j--){
			for(int k = 0; k <= 9; k++){
				if(j-k < 0)break;
				dp[i][j] += dp[i-1][j-k];
			}
		}
	}
	int n;
	while(cin >> n)
		FIN(dp[3][n]);

	return 0;
}

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


int main(void)
{
    string x;
    cin>>x;
    for(int i=0;i<x.length();i++)
    {
        if(x[i]=='9')
        {
            cout <<"Yes"<<endl;
            return 0;
        }
    }
    cout <<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
s=input()
i=0;
found=False;
h=0;
k=0;
if(len(s)%2!=0):
	found=False
else:
	while(i<len(s)):
		if(s[i]=='h' or s[i]=='i'):
			if(i%2==0 and s[i]=='h'):
				found=True
			if(i%2!=0 and s[i]=='i'):
				found=True
			if(i%2!=0 and s[i]=='h'):
				found=False
			if(i%2==0 and s[i]=='i'):
				found=False
			
		else:
			found=False
			break;		
		i=i+1
if(len(s)>1):
	if(s[0]=='i'):
		found=False
	if(s[1]=='h'):
		found=False

if(found==False):
	print("No")
else:
	print("Yes")



Measured memory_bytes: 3064
import           Control.Monad
import qualified Control.Monad.ST            as ST
import qualified Data.ByteString.Char8       as BS
import           Data.List
import           Data.Maybe
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM

readInt = fst . fromJust . BS.readInt
getInt = readInt <$> BS.getLine

primes n = ST.runST $ do
  v <- VM.new (n+1)
  VM.write v 0 (-1)
  VM.write v 1 (-1)
  forM_ [2..n] $ \i -> VM.write v i i
  let sqrtN = ceiling $ sqrt $ fromIntegral n
  forM_ [2..sqrtN] $ \i -> do
    x <- VM.read v i
    when (x >= 0) (forM_ [2..(n`div`i)] $ \j -> VM.write v (i*j) (-1))
  v' <- V.freeze v
  return $ V.filter (> 0) v'

main = do
  x <- getInt
  print $ V.head $ V.dropWhile (< x) $ primes 100003

Measured memory_bytes: 2172
k, n = map(int, input().split())
lst = [int(i) for i in input().split()]

max_l = 0
for i in range(n):
  if i != n - 1:
    l = lst[i + 1] - lst[i]
  else:
    l = k + lst[0] - lst[i]
  if l > max_l:
    max_l = l
print(k - max_l)

Measured memory_bytes: 31512