akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for(int i=0; i<(int)(a); i++)
typedef long long ll;
const ll INF = 1LL<<60;

int main()
{
  string s; cin>>s;
  int n = s.size();
  vector<int> r(n, 0);
  vector<int> l(n, 0);

  {
    int cnt = 0;
    rep(i, n) {
      if (s[i] == 'R') cnt++;
      else {
        if (cnt%2) {
          r[i-1] += (cnt+1)/2;
          r[i] += cnt/2;
        } else {
          r[i-1] += cnt/2;
          r[i] += (cnt+1)/2;
        }
        cnt = 0;
      }
    }
  }
  {
    int cnt = 0;
    for (int i=n-1; i>=0; i--) {
      if (s[i] == 'L') cnt++;
      else {
        if (cnt%2) {
          l[i+1] += (cnt+1)/2;
          l[i] += cnt/2;
        } else {
          l[i+1] += cnt/2;
          l[i] += (cnt+1)/2;
        }
        cnt = 0;
      }
    }
  }
  rep(i, n) {
    if (i > 0) cout << " ";
    cout << l[i]+r[i];
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 1408
import math
import sys
import itertools
MAX_INT = int(10e12)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b = IL()
num = int(math.sqrt(max(a,b)))
Ayakusuu = []
Byakusuu = []
ansl = []
ans = 0

numA = int(math.sqrt(a))
for i in range(1,numA+1):
  if a%i == 0:
    Ayakusuu.append(i)
    Ayakusuu.append(a//i)
#print(Ayakusuu)

numB = int(math.sqrt(b))
for i in range(1,numB+1):
  if b%i == 0:
    Byakusuu.append(i)
    Byakusuu.append(b//i)
#print(Byakusuu)
yakusuu = set(Ayakusuu) & set(Byakusuu)
#print(yakusuu)
for i in yakusuu:
  num2 = int(math.sqrt(i))
  for k in range(2,num2+1):
    if i%k == 0:
      break
  else:
    ansl.append(i)

for i in range(len(ansl)):
  for j in range(len(ansl)):
    if i == j:
      continue
    else:
      aa, bb = ansl[i], ansl[j]
      if aa == 1:
        continue
      else:
        num3 = min(aa,bb)
        for k in range(2,num3+1):
          if aa%k == 0 and bb%k == 0:
            break
        else:
          continue
        break
  else:
    ans += 1

#print(yakusuu)
#print(ansl)
print(ans)


"""
for i in itertools.combinations(ansl, 2):
  print(i)
  aa, bb = i
  if aa == 1:
    ans += 1
  else:
    num3 = min(aa,bb)
    for k in range(2,num3+1):
      if aa%k == 0 and bb%k == 0:
        break
    else:
      ans += 1

#print(yakusuu)
print(ansl)
print(ans)
"""

Measured memory_bytes: 42332
list=[[0 for i in range(1001)] for j in range(1001)]
N=int(input())
i=1
while i<=1000:
    a=i
    while a%2 == 0:
        a/=2
        list[i][2]+=1
    div=3
    while div <= a:
        if a%div == 0:
            a/=div
            list[i][div]+=1
            continue
        div+=2
    i+=1
anslist=[1,]*1001
for i in range(N+1):
    for j in range(N+1):
        anslist[j]+=list[i][j]
ans=1
for i in range(1001):
    ans*=anslist[i]
print(str(ans%(10**9+7)))

Measured memory_bytes: 11892
/**
 *      purpose : AISing Programming Contest 2019 C
 *      author  : kyomukyomupurin
 *      created : 2019-01-12 21:08:01
**/

#include <bits/stdc++.h>
using namespace std;
using int64 = int64_t;
using pii = pair<int, int>;
using pll = pair<int64_t, int64_t>;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define fi first
#define se second

int h, w;
string s[400];
int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1};
int64 white = 0, black = 0;
bool visited[400][400] = {};

int64 dfs(int x, int y){
    
    if (!visited[x][y] && s[x][y] == '#') {++black; visited[x][y] = 1;}
    else if (!visited[x][y] && s[x][y] == '.'){++white; visited[x][y] = 1;}

    for (int i = 0; i < 4; ++i){
        int nx = x + dx[i], ny = y + dy[i];
        if (nx >= 0 && nx < h && ny >= 0 && ny < w && s[nx][ny] != s[x][y] && visited[nx][ny] == 0) dfs(nx, ny);
    }

    int64 com = white * black;
    // print(com);

    return com;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> h >> w;

    rep(i, h) cin >> s[i];

    int64 ans = 0;

    rep(i, h){
        rep(j, w){
            if (!visited[i][j]){
                ans += dfs(i, j); white = 0; black = 0;
            }
        }
    }
    print(ans);
    
    return 0;
}

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

int dx[]{ 0,1,0,-1 }, dy[]{ 1,0,-1,0 };
int main() {
	int w, h;
	while (scanf("%d%d", &w, &h), w) {
		int x = 1, y = 1, idx = 0;
		while (1) {
			string s; cin >> s;
			if (s == "STOP")break;
			if (s == "RIGHT") {
				idx = (idx + 1) % 4; continue;
			}
			if (s == "LEFT") {
				idx = (idx + 3) % 4; continue;
			}
			int d; scanf("%d", &d);
			if (s == "FORWARD") {
				x+= dx[idx] * d, y+= dy[idx] * d;
				if (x <= 0)x = 1; if (y <= 0)y = 1;
				if (x > w)x = w; if (y > h)y = h;
			}
			else {
				x -= dx[idx] * d, y -= dy[idx] * d;
				if (x <= 0)x = 1; if (y <= 0)y = 1;
				if (x > w)x = w; if (y > h)y = h;
			}
		}
		printf("%d %d\n", x, y);
	}
}

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

namespace Atcoder
{
    class Atcoderrrrrr
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string A = Console.ReadLine();
            string B = Console.ReadLine();
            string C = Console.ReadLine();

            int ans = 0;
            for(int i = 0; i < N; i++)
            {
                string a = A[i].ToString();
                string b = B[i].ToString();
                string c = C[i].ToString();

                if (a == b && b == c && a == c)
                {

                }
                else if (a != b && b != c&& a != c)
                {
                    ans++; ans++;
                }
                else
                {
                    ans++;
                }
                
            }
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int n, 
	a[200],
	v[200],
	sum = 0;

int main() {
	
	memset(v, 0, sizeof(int));

	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
	}

	for(int i = 1; i <= n; i++) {
		if(a[i] == a[i-1] && a[i] == a[i+1]) {
			a[i] = 0;
			sum++;
		}
	}

	for(int i = 1; i <= n; i++) {
		if(a[i] == a[i-1] || a[i] == a[i+1]) {
			a[i] = 0;
			sum++;
		}
	}

	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 256
// D - Triangles

// 二分探索を利用

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

int N;
int L[2000];

bool is_ok (int k, int V) {
	return V < k;
}

int find_upper_limit(int k, int A[], int lower, int upper) {
	if (!is_ok(k, A[lower])) return -1;

	while(upper - lower > 1) {
		int mid = (upper + lower) / 2;

		if (is_ok(k, A[mid])) {
			lower = mid;
		} else {
			upper = mid;
		}
	}

	return lower;
}

int main(){
	cin >> N;

	for (int i=0; i<N; i++) {
		cin >> L[i];
	}

	sort(L, L+N);

	/*
	// **** debug ****
	for (int i=0; i<N; i++) {
		cout << L[i] << " ";
	}
	cout << endl;
	*/

	int ans = 0;
	for (int i=0; i<N-2; i++) {
		for (int j=i+1; j<N-1; j++) {
			int idx = find_upper_limit(L[i] + L[j], L, j+1, N);
			//cout << "i=" << i << " j=" << j << " idx=" << idx << endl; // **** debug ****
			if (idx != -1) {
				ans += idx - j;
			}
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
def main():
	N = int, input().split()
	a = list(map(int, input().split()))

	ans = 10**9

	for i in range(-100, 101):
		this_ans = 0
		for ai in a:
			this_ans += (ai-i)*(ai-i)
		ans = min(ans, this_ans)
	print(ans)


if __name__ == '__main__':
	main()

Measured memory_bytes: 2940
#include<cstdio>
#include<algorithm>
int w[501000], T[501000];
char p[501000];
using namespace std;
int n;
void UDT(int pv){
    int t = (-T[pv]+9)/10;
    T[pv] += t*10;
    T[pv+1] -= t;
}
bool Pos(int L){
    int g = 9*L, i, j;
    for(i=0;i<n;i++)T[i]=w[i];
    int s = 0;
    for(i=0;i<n;i++){
        if(T[i]<0){
            UDT(i);
        }
        if(n-i>=9){
            while(g>=0 && g%10 != T[i])g--;
            if(g<0)return false;
            T[i]-=g;
            if(T[i]<0)UDT(i);
            continue;
        }
        int tp = 1;
        for(j=i;j<n;j++){
            s += tp*T[j];
            tp*=10;
        }
        break;
    }
    while(s){
        if(g>s)g=s;
        while(g>=0 && g%10 != s%10)g--;
        if(g<0)return false;
        s-=g;
        s/=10;
    }
    return true;
}
int main(){
    int i;
    scanf("%s",p);
    for(i=0;p[i];i++);
    n = i;
    for(i=0;i<n;i++){
        w[n-i-1] = p[i]-'0';
    }
    int b = 1, e = n+10, mid, res = 0;
    while(b<=e){
        mid = (b+e)>>1;
        if(Pos(mid)){
            res = mid;
            e = mid - 1;
        }
        else{
            b = mid + 1;
        }
    }
    printf("%d\n",res);
}


Measured memory_bytes: 4608
#include <bits/stdc++.h>
#define inf INT_MAX
using namespace std;

string s1, s2, u;
int a, b;

int main()
{
    cin >> s1 >> s2 >> a >> b >> u;
    if (u == s1) a--;
    if (u == s2) b--;
    cout << a << ' ' << b;
    return 0;
}


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

long solve(int start, long current, string s) {
    if (start >= s.size())
        return current;
    return current * (1 << (s.size() - start - 1)) + solve(start + 1, 0, s) + solve(start + 1, current * 10 + s[start] - '0', s);
}

int main() {
    string s;
    cin >> s;
    cout << solve(0, 0, s) << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

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

        int ans = 0;
        for (int i = 0; i < n; i++) {
            long x = sc.nextLong();
            long y = sc.nextLong();
            double t = Math.sqrt(x*x + y*y);

            if (t <= d)
                ans++;
        }

        System.out.println(ans);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

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

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

Measured memory_bytes: 55844
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=998244353;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b;
    cin>>a>>b;
    ll g=__gcd(a,b);
    ll ans=1;
    for(long long i=2;i*i<=g;i++){
        if(g%i==0){
            ans++;
            while(g%i==0){
                g/=i;
            }
        }
    }
    if(g!=1){
        ans++;
    }
    cout <<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int MOD = 1000000007;
	public static ArrayList<Integer> list = new ArrayList<>();
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int p = 0;
		int q = 0;
		for(i=0;i<n;i++) {
			p*=10;
			p += parseInt(sc.next());
		}
		for(i=0;i<n;i++) {
			q*=10;
			q += parseInt(sc.next());
		}
		sc.close();
		String s = "12345678".substring(0,n);
		int a=0;
		int b=0;
		factn("", s, n);
		Collections.sort(list);
//		out.println(p);
//		out.println(q);
//		out.println(list.toString());
		for (i = 0; i < list.size(); i++) {
			int r = list.get(i);
			if(p == r) {
				a = i;
			}
			if(q == r) {
				b = i;
			}
		}
//		out.println(a);
//		out.println(b);
		out.println(abs(b-a));
	}
	public static void factn(String s, String t, int n) {
		for (int i = 0; i < n; i++) {
			if(n==1) {
				list.add(parseInt(s + t));
			} else {
				factn(s+t.substring(i,i+1), t.substring(0,i)+(i!=n-1?t.substring(i+1,n):""), n-1);
			}
		}
	}
}


Measured memory_bytes: 44184
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

int main() {
    ll a, b, k;
    cin >> a >> b >> k;
    if (b - a + 1 <= 2 * k) {
        for (ll i = a; i <= b; i++) {
            cout << i << "\n";
        }
    } else {
        for (ll i = a; i <= a + k - 1; i++) {
            cout << i << "\n";
        }
        for (ll i = b - k + 1; i <= b; i++) {
            cout << i << "\n";
        }
    }
    return 0;
}

Measured memory_bytes: 3612
/*
ID: jerrywcy
LINK:
LANG: C++
STATUS:
*/
#include <bits/stdc++.h>

#define init(array,x) memset(array,x,sizeof(array))

using namespace std;

const int inf=0x3f3f3f3f;

int n;
int a[100010];
int g[100010][2];
int ans;

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

int main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	for (int i=1;i<=n;i++)cin>>a[i];
	
	for (int i=1;i<=n;i++)g[i][0]=gcd(a[i],g[i-1][0]);
	for (int i=n;i>=1;i--)g[i][1]=gcd(a[i],g[i+1][1]);
	
	for (int i=1;i<=n;i++)ans=max(ans,gcd(g[i-1][0],g[i+1][1]));
	
	cout<<ans<<endl;

	return 0;
}



Measured memory_bytes: 1408
#include<stdio.h>
#include<stdlib.h>

#define FOUND 1
#define NOT_FOUND -1

int search(int [], int, int);

int main(){
  int *S, *T;
  int n, q;
  int count = 0;
  int i;
  
  scanf("%d",&n);
  S = (int *)malloc(n * sizeof(int));

  for(i=0; i<n; i++)
    scanf("%d",&S[i]);

  scanf("%d",&q);
  T = (int *)malloc(q * sizeof(int));

  for(i=0; i<q; i++)
    scanf("%d",&T[i]);

  for(i=0; i<q; i++){
    if(search(S, n, T[i])==FOUND)
      count++;
  }

  printf("%d\n",count);
  
  free(S);
  free(T);
  return 0;
}

int search(int A[], int n, int key){
  int left, right, mid;

  left = 0;
  right = n;

  while(left < right){
    mid = (left + right)/2;

    if(key == A[mid])
      return FOUND;

    if(key > A[mid])
      left = mid + 1;
    else if(key < A[mid])
      right = mid;
  }

  return NOT_FOUND;
}



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

int main()
{
  string S;
  cin >> S;
  int64_t sum = 0;
  for (int i = 0; i < S.size(); i++)
  {
    int d = S.at(i) - '0';
    sum += d;
  }
  cout << (sum % 9 == 0 ? "Yes" : "No") << endl;
}


Measured memory_bytes: 3728
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
set<int> divisor(int N){
  set<int> res;
  for(int i = 1; i * i <= N; i++){
    if(N % i == 0){
      res.insert(i);
      res.insert(N / i);
    }
  }
  return res;
}

int main(){
  int N;
  while( cin>>N){
    int a[3];
    REP(i, N) cin>>a[i];
    set<int> div[3];
    REP(i, N) div[i] = divisor(a[i]);
    FORIT(it, div[0]){
      bool ok = true;
      FOR(i, 1, N) if(!div[i].count(*it)) ok = false;
      if(ok) cout<<*it<<endl;
    }
  }
  return 0;
}

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

using namespace std;
int n;
string s,t,sol;
int main()
{
    cin>>n>>s>>t;
    for(int i=0;i<s.size();i++)
    {
        sol.push_back(s[i]);
        sol.push_back(t[i]);
    }
    cout<<sol;
    return 0;
}


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

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

  if(r < 1200)
    cout << "ABC" << endl;
  else if(1200 <= r && r < 2800)
    cout << "ARC" << endl;
  else
    cout << "AGC" << endl;
  
  return 0;
}


Measured memory_bytes: 764
a, b, c, d = gets.chomp.split(' ').map(&:to_i)

if a <= c && c < b
  if d < b
    puts d - c
  else
    puts b - c
  end
elsif c <= a && a < d
  if b < d
    puts b - a
  else
    puts d - a
  end
else
  puts 0
end


Measured memory_bytes: 1788
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

#define INF 100100100

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> c(m);
    rep(i, m) cin >> c[i];
    
    vector<vector<int>> dp(m + 1, vector<int>(n + 1, INF));
    dp[0][0] = 0;
    REP(i, m + 1) rep(j, n + 1) {
        dp[i][j] = min(dp[i][j], dp[i - 1][j]);
        if (j >= c[i - 1]) {
            dp[i][j] = min(dp[i][j], dp[i - 1][j - c[i - 1]] + 1);
            dp[i][j] = min(dp[i][j], dp[i][j - c[i - 1]] + 1);
        }
    }
    cout << dp[m][n] << endl;
    return 0;
}



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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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;}

using ll = long long;
using R = long double;
const R EPS = 1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r) {return (r > EPS) - (r < -EPS);}
inline R sq(R x) {return sqrt(max(x, 0.0L));}

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

// Problem Specific Parameter:

const ll mod = 1000000007LL;
ll dp[2010][2010];

int main(void) {
	int n, m, k;
	cin >> n >> m >> k;
	const int d = (n + m - 1) / (k - 1);

	dp[0][0] = 1LL;
	ll ans = 0LL;

	rep(i, d) {
		rep(a, n + 1) {
			const int b = (k - 1) * i - a;
			if (b < 0 or m < b) continue;
			rep(add, k) {
				const int na = a + add;
				const int nb = b + (k - 1 - add);
				if (na > n or nb > m) continue;
				dp[na][nb] = (dp[na][nb] + dp[a][b]) % mod;
			}

			rep(add, 1, k) {
				const int na = a + add;
				const int nb = b + (k - add);
				if (na <= n and nb <= m and (n - na) % (k - 1) == 0 and (m - nb) % (k - 1) == 0) ans = (ans + dp[a][b]) % mod;
			}
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 31616
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(container) container.begin(), container.end()
#define Cin(T, x) T x; cin >> x;
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i];
#define Cout(val) cout << (val) << "\n";
using namespace std;
using ll = long long;

int main(void){
    Cin(int, a);
    Cin(int, b);
    Cout((a <= 8 && b <= 8) ? "Yay!" : ":(");
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<set>
#include<tuple>
#include<ctime>
#include<functional>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> p; 
#define rep(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))

int main(){
   int a[5];
   rep(i,5){
       cin>>a[i];
   }
      rep(i,5) if(a[i]==0) p(i+1);
   
}

Measured memory_bytes: 3632
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
int x, a, b;
int main() {
	cin >> x >> a >> b;
	if (a >= b)cout << "delicious" << endl;
	else if (a >= b - x)cout << "safe" << endl;
	else cout << "dangerous" << endl;
	return 0;
}

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;cin>>n;
    map<int,int> x;
    int a;
    for (int i=0;i<n;i++){
        cin>>a;
        x.insert({a,0});
        x[a]++;
    }int ans=0;
    for (auto i:x){
        if (i.second%2==1){
            ans++;
        }
    }cout<<ans;

    return 0;
}

Measured memory_bytes: 4992
import sys
# input = sys.stdin.readline

N = int(input())

ab = [list(map(int, input().split())) for _ in range(N)]
ab.sort(key=lambda x: -x[1])

cd = [list(map(int, input().split())) for _ in range(N)]
cd.sort(key=lambda x: x[0])

tab = [[] for i in range(N)]
for i, (ci, di) in enumerate(cd):
    for j, (aj, bj) in enumerate(ab):
        if aj < ci and bj < di:
            tab[i].append(j)

ans = 0
used_a = [False] * N
for i in range(N):
    for j in tab[i]:
        if used_a[j]:
            continue
        else:
            ans += 1
            used_a[j] = True
            # print("#", ab[j], cd[i])
            break

print(ans)

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

int main(){
  int n;
  cin >> n;
  int a[n];
  int b[n];
  int c[n-1];
  
  
  for(int s=0; s<n; s++){
    cin >> a[s];
  }
  
  for(int s=0; s<n; s++){
    cin >> b[s];
  }
  
  for(int s=0; s<n-1 ; s++){
    cin >> c[s];
  }
  
  int ans=0;
  int pre=-1;
  
  for(int s=0; s<n; s++){
    ans+=b[a[s]-1];
    if(pre+1==a[s]) ans+=c[pre-1];
    pre=a[s];
  }
  
  cout << ans <<endl;
}
    

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

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

    vector<int> as(N);
    for (int i = 0; i < N; i++) {
        cin >> as[i];
    }
    sort(as.begin(), as.end());

    int len = (int) as.size();
    cout << as[len - 1] - as[0] << endl;

    return 0;
}


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

using namespace std;

int main()
{
	int n,m;
	char a[50][50];
	char b[50][50];
	int len;
	int flag=0;
	cin >> n >> m;
	len = n-m+1;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}
	for(int i=0;i<m;i++)
	{
		cin >> b[i];
	}
	for(int i=0;i<len;i++)//a縦
	{
		for(int j=0;j<len;j++)//a横
		{
			flag = 0;
			for(int k=0;k<m;k++)//b縦
			{
				for(int l=0;l<m;l++)//b横
				{
					if(a[i+k][j+l]!=b[k][l])
					{
					flag = 1;
					break;
					}
				}
			}
			if(flag==0)
			{
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}

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

int main()
{
    int n, tmp, res = 0;
    cin >> n;
    
    for(int i = 0; i < n; ++i)
    {
        cin >> tmp;
        if(tmp % 2 && (i + 1) % 2)
        {
            res++;
        }
    }

    cout << res << "\n";
    return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
// Welcome to my source code!

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const int INF = 1e9;
const int MAX = 1e4*2+10;

int main() {
    int h, n;
    cin >> h >> n;
    int a[n], b[n];
    for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
    int dp[MAX];
    for (int i = 0; i < MAX; i++) dp[i] = INF;
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < MAX; j++) {
            if (j >= a[i]) {
                dp[j] = min(dp[j], dp[j - a[i]] + b[i]);
            }
        }
    }
    sort(dp+h, dp+MAX);
    cout << dp[h] << endl;
}

Measured memory_bytes: 384
def gcb(A, B):
    while B != 0:
        A, B = B, A%B
    return A

N, M = map(int, input().split())
S = input()
T = input()
can = True
agc = N // gcb(N, M) * M
L_N = agc // N
L_M = agc // M
i = 0
while i*L_M < N and i*L_N < M:
    if S[i*L_M] != T[i*L_N]:
        can = False
        break
    i += 1

if can:
    print(agc)
else:
    print(-1)


Measured memory_bytes: 3316
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


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


	int H, W;
	cin >> H >> W;

	string S[20];
	rep(i, H) cin >> S[i];


	int kotae = 1;
	rep(i, H) rep(j, W) {
		if (S[i][j] == '#') continue;

		int D[20][20];
		rep(p, H) rep(q, W) D[p][q] = 1e9;
		queue<pair<int, int>> q;

		q.push(mp(i, j));
		D[i][j] = 0;
		while (q.size()) {
			auto pr = q.front();
			q.pop();

			int h = pr.first;
			int w = pr.second;
			chmax(kotae, D[h][w]);

			int d = D[h][w] + 1;
			if (h != 0) {
				h--;
				if (S[h][w] == '.' && D[h][w] > d) {
					q.push(mp(h, w));
					D[h][w] = d;
				}
				h++;
			}
			if (h != H - 1) {
				h++;
				if (S[h][w] == '.' && D[h][w] > d) {
					q.push(mp(h, w));
					D[h][w] = d;
				}
				h--;
			}
			if (w != 0) {
				w--;
				if (S[h][w] == '.' && D[h][w] > d) {
					q.push(mp(h, w));
					D[h][w] = d;
				}
				w++;
			}
			if (w != W - 1) {
				w++;
				if (S[h][w] == '.' && D[h][w] > d) {
					q.push(mp(h, w));
					D[h][w] = d;
				}
				h--;
			}
		}
	}

	co(kotae);


	Would you please return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define dbg(x) cout<<#x<<": "<<x<<endl;
const double PI = acos(-1.0);
using namespace std;

void cp()
{
	string s;
	cin>>s;
	cout<<(s[2]==s[3] && s[4] == s[5]?"Yes":"No");
}

int main()
{
    FASTIO;
    int t;
    t=1;
    // cin>>t;
    while(t--)
    {
    	cp();
    }
    return 0;
}

Measured memory_bytes: 256
s = list(input())
a = s[0]+s[1]
a = int(a)
b = s[2] + s[3]
b = int(b)
if 1 <= a <= 12 and 1 <= b <= 12:
  print("AMBIGUOUS")
else:
  if (a >= 13 or a == 0) and 1 <= b <= 12:
    print("YYMM")
  elif (b >= 13 or b == 0) and 1 <= a <= 12:
    print("MMYY")
  else:
    print("NA") 

Measured memory_bytes: 3064
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <math.h>
#include <time.h>
#include <unistd.h>
#include <algorithm>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <string>

#ifndef ONLINE_JUDGE
	#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#else
	#define DEBUG(x) do {} while(0);
#endif

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define FOR(i, A, N) for(int (i) = (A); (i) < (N); (i)++)
#define REP(i, N) for(int (i) = 0; (i) < (N); (i)++)

using namespace std;
typedef long long ll;
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }

int n,m;
int A[111111];
int main() {
	scanf("%d", &n);
	REP(i, n) scanf("%d", A+i+1);
	int x = 1;
	for(; x <= n && A[x] != x; x++);
	int ans = 0;
	while(x <= n) {
		ans++;
		if(x <= n-1) {
			swap(A[x], A[x+1]);
		}
		x++;
		for(; x <= n && A[x] != x; x++);
	}
	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100005;
ll t[N];
void add(ll x,ll y)
{
	for(int i=x;i<=N-3;i+=i&(-i)) t[i]+=y;
}
ll sum(ll x)
{
	ll ans=0;
	for(int i=x;i>=1;i-=i&(-i)) ans+=t[i];
	return ans;
}
int main()
{
	int n,m;
	scanf("%d",&n);
	for(int i=1;i<=n;i++) 
	{
		ll x;
		scanf("%lld",&x);
		add(x,x);
	}
	scanf("%d",&m);
	while(m--)
	{
		ll l,r;
		scanf("%lld%lld",&l,&r);
		ll now=sum(l)-sum(l-1);
		ll gs=now/l;
		add(l,-now);
		add(r,r*gs);
		printf("%lld\n",sum(N));
	}
}

Measured memory_bytes: 4540
N=int(input())
count = 0
c = [[0] * 10 for i in range(10)]
for num in range(N):
    s = str(num+1)
    start = int(s[0])
    end = int(s[len(s)-1])
    c[start][end] += 1

ans = 0

for i in range(10):
    for j in range(10):
        ans += c[i][j]*c[j][i]
        
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    vector<int> alice (101),bob(101);
    for(int i=a;i<=b;i++){
        alice[i]=1;
    }
    for(int i=c;i<=d;i++){
        bob[i]=1;
    }
    int count =0 ;
    for(int i=0;i<=100;i++){
        if(alice[i]*bob[i]!=0) count++;
    }
    if(count!=0)cout<<count-1<<endl;
    else cout<<count<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
typedef long long int ll;

int N,K;

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

    int A[N];

    for (int i = 0; i < N; i++) A[i] = 0;
    
    for (int i = 0; i < K; i++){
        int tmp;
        cin >> tmp;
        
        for (int j = 0; j < tmp; j++){
            int tmp2;
            cin >> tmp2;
            A[tmp2 - 1]++;
        } 
    }

    int ans = 0;
    for (int i = 0; i < N; i++){
        if (A[i] == 0) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3636
#include <iostream>

using namespace std;

typedef long long LL;

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define ALL(a)  (a).begin(),(a).end()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

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

int main() {
  int D;
  cin >> D;
  if (D==25) cout << "Christmas" << endl;
  else if (D==24) cout << "Christmas Eve" << endl;
  else if (D==23) cout << "Christmas Eve Eve" << endl;
  else if (D==22) cout << "Christmas Eve Eve Eve" << endl;

  return 0;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll k;
  cin >> k;
  ll cnt = 0;
  vector<string> v;
  queue<string> q;
  for (int i = 1; i < 10; ++i)
  {
    string temp = to_string(i);
    q.push(temp);
  }
  while (!q.empty() && cnt < 100000)
  {
    string t = q.front();
    q.pop();
    v.push_back(t);
    cnt++;
    char last = t.back();
    int num = last - '0';
    if (num >= 1)
    {
      string temp = t;
      temp += (num - 1 + '0');
      q.push(temp);
    }
    string temp = t;
    temp += (num + '0');
    q.push(temp);
    if (num <= 8)
    {
      string temp = t;
      temp += (num + 1 + '0');
      q.push(temp);
    }
  }
  cout << v[k - 1];
}

Measured memory_bytes: 20468
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m = sc.nextInt(), max = m;
        for (int i = 0; i < n; i++) {
            m += sc.nextInt() - sc.nextInt();
            if (m < 0) {
                max = 0;
                break;
            }
            max = Math.max(max, m);
        }
        System.out.println(max);
    }
}


Measured memory_bytes: 46260
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <cstdlib>
#include <cmath>
#include <functional>

#define INF 1000000000000000000
using namespace std;
typedef long long ll;


int main(){
	ll n;
	cin >> n;
	ll ans = 0, temp = 0;
	while (temp - n < 0) {
		ans++;
		temp += ans;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int h,w;
vector<vector<int>> fielda,fieldb;
bool memo[80][80][13000];
int MIN= 1000000000;

void search(int i,int j,int k){
  memo[i][j][k] = false;
  //cout << i << ' ' << j << ' ' << k << endl;
  int tmpk = abs(fielda.at(i).at(j)-fieldb.at(i).at(j));
  if(i==(h-1)&&j==(w-1)){MIN = min(MIN,min(abs(k-tmpk),abs(k+tmpk)));return;} 
  int ni = i+1;
  int nj = j+1;
  //cout << memo[ni][j][k-tmpk] << endl;
  if(ni<h){
    if(memo[ni][j][abs(k-tmpk)])search(ni,j,abs(k-tmpk));
    if(memo[ni][j][k+tmpk])search(ni,j,k+tmpk);
  }
  if(nj<w){
    if(memo[i][nj][abs(k-tmpk)])search(i,nj,abs(k-tmpk));
    if(memo[i][nj][k+tmpk])search(i,nj,k+tmpk);
  }
  return;
}
    

int main(){
  cin >> h >> w;
  int tmp;
  for(int i=0;i<h;i++){
    vector<int> vectmp;
    for(int j=0; j<w; j++){
      cin >> tmp;
      vectmp.push_back(tmp);
    }
    fielda.push_back(vectmp);
  }
  for(int i=0;i<h;i++){
    vector<int> vectmp;
    for(int j=0; j<w; j++){
      cin >> tmp;
      vectmp.push_back(tmp);
    }
    fieldb.push_back(vectmp);
  }
  //cout << "hoge" << endl;
  //int k=abs(fielda.at(0).at(0) - fieldb.at(0).at(0));
  memset(memo,true,sizeof(memo));
  search(0,0,0);
  cout << MIN << endl;
}
  

Measured memory_bytes: 81536
#include<bits/stdc++.h>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define rrep(i,a) for(int i=(int)a-1;i>=0;--i)
#define REP(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RREP(i,a,b) for(int i=(int)a-1;i>=b;--i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
typedef std::vector<int> vi;
typedef std::vector<std::vector<int>> vvi;
typedef std::vector<long long> vl;
typedef std::vector<std::vector<long long>> vvl;
#define out(x) cout<<x<<"\n";
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}


ll gcd(ll n, ll m) {
    ll tmp;
    while (m!=0) {
        tmp = n % m;
        n = m;
        m = tmp;
    }
    return n;
}
 
ll lcm(ll n, ll m) {
    return abs(n) / gcd(n, m)*abs(m);//gl=xy
}
 
using namespace std;

using P = pair<int, int>;
using PP = pair<P, int>;
#define x first.first
#define y first.second
#define h second
void solve()
{
    int n;
    cin >> n;
    vector<PP> v(n);
    rep(i, n) cin >> v[i].x >> v[i].y >> v[i].h;
    int memo = 0;
    rep(cx, 101)
    {
        rep(cy,101){
            int cnt = 0;
            int val = -1;
            rep(i, n)
            {
                if(v[i].h==0){
                    ++cnt;
                    continue;
                }
                if(val==-1)val = v[i].h + abs(v[i].x - cx) + abs(v[i].y - cy);
                if(val<1)
                    break;
                if (v[i].h + abs(v[i].x - cx) + abs(v[i].y - cy) ==val)
                {
                    memo = i;
                    ++cnt;
                }
            }
            if(cnt==n){
                bool ng = false;
                rep(i, n)
                {
                    if(v[i].h==0){
                        if(val-abs(v[i].x-cx)-abs(v[i].y-cy)>0)
                            ng = true;
                    }
                }
                if(ng)
                    continue;
                cout << cx << " " << cy << " " << v[memo].h + abs(v[memo].x - cx) + abs(v[memo].y - cy);
                return;
            }
        }
    }
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(15);
    solve();
    return 0;
}


Measured memory_bytes: 256
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), cout, ", ") << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, ostream &os = cout, string sep = " ")
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), os, ", ") << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

int main()
{
    IN(ll, A);
    IN(ll, B);
    REP1(i, 2000)
    {
        if (8 * i / 100 == A and i / 10 == B)
        {
            OUT(i);
            return 0;
        }
    }
    OUT(-1);
}

Measured memory_bytes: 256
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for x in range(N):
    ia = input()
    if ia == "AC":
        ac += 1
    elif ia == "WA":
        wa += 1
    elif ia == "TLE":
        tle += 1
    elif ia == "RE":
        re += 1
    else:
        break

print(f"""\
AC x {ac}
WA x {wa}
TLE x {tle}
RE x {re}""")

Measured memory_bytes: 9196
#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr start, itr goal){ for(auto i = start; i != goal; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))
#define fcout cout << fixed << setprecision(10)
#define highest(x) (63 - __builtin_clzl(x))

int main(){
    int N, K;
    cin >> N >> K;
    cout << !!(N % K) << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <ostream>
#include <random>
#include <set>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#ifdef ONLINE_JUDGE
#pragma GCC optimize("O2")
#pragma GCC target("avx,avx2")
#endif

using namespace std;


using u64 = uint64_t;
using i64 = int64_t;
using u32 = uint32_t;
using vi = vector<int>;
using vi64 = vector<i64>;

#define seq(i, a, b) for (int i = (a); i < (b); ++i)
#define rev(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#define dbg(x) \
  { cerr << #x << ": " << x << endl; }

vector<int> lpf(int lim) {
  vector<int> lp(lim + 1);
  vector<int> pr;

  seq(i, 2, lim + 1) {
    if (lp[i] == 0) {
      lp[i] = i;
      pr.push_back(i);
    }
    for (const auto &p : pr) {
      if (p > lp[i] or i * p > lim) break;
      lp[i * p] = p;
    }
  }

  return lp;
}

const long long mod = 1000000007;

auto modpow(long long base, long long e) {
  long long res = 1;
  while (e) {
    if (e & 1) res = res*base % mod;
    base = base*base % mod;
    e >>= 1;
  }
  return res;
}

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

  auto lp = lpf(1000010);
  int n;
  cin >> n;
  vi A(n);
  for (auto &x : A) cin >> x;

  unordered_map<int, int> D;

  for (auto a : A) {
    int fac = -1;
    int count = 0;
    while (a > 1) {
      int f = lp[a];
      a /= f;

      if (f == fac)
        ++count;
      else {
        if (fac != -1) {
          D[fac] = max(D[fac], count);
        }
        count = 1;
        fac = f;
      }
    }
    if (fac != -1) {
      D[fac] = max(D[fac], count);
    }
  }

  long long lcm = 1;
  for (auto pr : D) {
    lcm = lcm * modpow(pr.first, pr.second) % mod;
  }

  long long res = 0;
  for (auto a : A) {
    res = (res + lcm*modpow(a, mod-2)) % mod;
  }

  cout << res << endl;
}


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

#define SIS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define lowbit(x) (x & -x)
typedef long long ll;
using namespace std;
const int MAX = 0x7ffffff;
int t;

void slove()
{
	double n , m;
	cin >> n >> m;
	m = m * 100;
	m += 0.00001;
	ll x = n , y = m;
	cout << (x * y) / 100 << endl;
}
int main()
{
	SIS;
	slove();
}

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

#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
#define int long long
//for set
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;   
// for multiset
typedef tree<
pair<int, int>,
null_type,
less<pair<int, int>>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_multiset;


#define ff first
#define ss second
#define endl "\n"
#define all(x) (x).begin(), (x).end()
// #define PI 3.1415926535897932384626433832795
#define PI acos(-1.0)
int MOD=1e9+7;
int powmod(int a,int l, int md){int res=1;while(l){if(l&1)res=res*a%md;l/=2;a=a*a%md;}return res;}
typedef long long ll; typedef vector<ll> vi; typedef pair<ll, ll> ii; typedef vector<ii> vii;
#define pb push_back
int __set(int b, int i) {return b|(1<<i);} //set ith bit
// int __unset(int b, int i) {return b&(!(1<<i));}
int __unset(int b, int i) {return b&(~(1UL<<i));}
int __check(int b, int i) {return b&(1<<i);} //returns 0 if ith bit is 0
int mul(int a, int b) {return ((a%MOD)*(b%MOD))%MOD;}
int add(int a, int b) {return (a+b)%MOD;}
int sub(int a, int b) {return (((a-b)%MOD)+MOD)%MOD;}
int __div(int a, int b) {return mul(a, powmod(b, MOD-2, MOD));} //if MOD is prime;
const ll inf = 0xFFFFFFFFFFFFFFFL; //very large number
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>> > pq; //for min priority_queue
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
clock_t time_p=clock();
void time()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

// map<char, int> m;
// bool cmp(char a, char b) {
// 	return m[a]<m[b];
// }
int mod = 1000000007;
const int N=21;
int dp[2][(1<<N)];
int32_t main(void)
{
	// IOS;
	int n; cin>>n;
	int mat[n][n];
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < n; j++)
			cin>>mat[i][j];
	}
	for(int i = 0; i < 2; i++) {
		for(int j = 0; j < (1<<n); j++)
			dp[i][j]=0;
	}
	for(int i = 0; i < (1<<n); i++) {
		for(int j = 0; j < n; j++) {
			if(__check(i, j) && mat[0][j] && __builtin_popcount(i)==1) {
				// cout<<i<<" "<<j<<" "<< __builtin_popcount(i)<<endl;
				dp[0][i]=1;
			}
		}
	}
	int cur=1;
	for(int i = 1; i < n; i++) {
		for(int j = 0; j < (1<<n); j++) {
			if(__builtin_popcount(j)!=i+1) continue;
			for(int k = 0; k < n; k++) {
				if(mat[i][k] && __check(j,k)) {
					// cout<<i<<" "<<j<<" "<<k<<" "<<__unset(j,k)<<endl;
					dp[cur][j] = (dp[cur][j]+dp[(cur^1)][__unset(j,k)])%mod;
				}
			}
		}
		cur ^= 1;
	}
	// for(int i = 0; i < n; i++) {
	// 	for(int j = 0; j < (1<<n); j++)
	// 		cout<<dp[i][j]<<" ";
	// 	cout<<endl;
	// }
	cout<<dp[(cur^1)][(1<<n)-1]<<endl;
   	time();
	return 0;
}

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

int main() {
	string s;
	while(getline(cin, s)){
		string ans;
		int maxim = 0;
		for(int i = 0; i < 26; ++i){
			for(int j = 0; j < s.size(); ++j){
				if(s[j] == 'a')
					s[j] = 'z';
				else if(s[j] == ' ' || !('a' <= s[j] && s[j] <= 'z'))
					continue;
				else
					s[j]--;
			}
			string t("");
			int cnt = 0;
			for(int j = 0; j < s.size(); ++j){
				if(s[j] == ' '){
					if(t == "the" || t == "this" || t == "that")
						cnt++;
					t = "";
				}
				else{
					t += s[j];
				}
			}
			if(maxim < cnt){
				ans = s;
				maxim = cnt;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1192