akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
int main() {
	int N; cin >> N;
	string S;
	cin >> S;
	vector<int>R(N + 1, 0), G(N + 1, 0), B(N + 1, 0);
	for (int i = N - 1; i >= 0; i--) {
		if (S.at(i) == 'R') {
			R.at(i) = R.at(i + 1) + 1;
			B.at(i) = B.at(i + 1);
			G.at(i) = G.at(i + 1);
		}
		if (S.at(i) == 'B') {
			R.at(i) = R.at(i + 1);
			B.at(i) = B.at(i + 1) + 1;
			G.at(i) = G.at(i + 1);
		}
		if (S.at(i) == 'G') {
			R.at(i) = R.at(i + 1);
			B.at(i) = B.at(i + 1);
			G.at(i) = G.at(i + 1) + 1;
		}
	}
	long long ans = 0;
	int k = 0;
	for (int i = 0; i < N - 1; i++) {
		for (int j = i + 1; j < N; j++) {
			k = j + 1;
			int l = j + j - i;
			if (k >= N || S.at(i) == S.at(j)) continue;
			if (S.at(i) == 'R') {
				if (S.at(j) == 'B') {
					ans += G.at(k);
					if (l < N) {
						if (S.at(l) == 'G') ans--;
					}
				}
				else {
					ans += B.at(k);
					if (l < N) {
						if (S.at(l) == 'B') ans--;
					}
				}
			}
			else if (S.at(i) == 'G') {
				if (S.at(j) == 'R') {
					ans += B.at(k);
					if (l < N) {
						if (S.at(l) == 'B') ans--;
					}
				}
				else {
					ans += R.at(k);
					if (l < N) {
						if (S.at(l) == 'R') ans--;
					}
				}
			}
			else if (S.at(i) == 'B') {
				if (S.at(j) == 'R') {
					ans += G.at(k);
					if (l < N) {
						if (S.at(l) == 'G') ans--;
					}
				}
				else {
					ans += R.at(k);
					if (l < N) {
						if (S.at(l) == 'R') ans--;
					}
				}
			}
		}
	}
	cout << ans << endl;
 }

Measured memory_bytes: 3648
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007


int h, w;
char a[1001][1001];
long long int result[1001][1001];

long long int solve(int x, int y)
{
	if(result[x][y] >= 0) return result[x][y];
	else if(a[x][y] == '#') return result[x][y] = 0;
	result[x][y] = 0;
	if(x < h - 1 && a[x + 1][y] =='.') result[x][y] += solve(x + 1, y);
	if(y < w - 1 && a[x][y + 1] == '.') result[x][y] += solve(x, y + 1);
	result[x][y] %= mod;
	return result[x][y];
}

int main()
{
	cin >> h >> w;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			cin >> a[i][j];
			result[i][j] = -1;
		}
	}
	result[h - 1][w - 1] = 1;
	cout << solve(0, 0) << endl;
}

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

int main() {
  int N;
  string S;
  bool p = false, w = false, g = false, y = false;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S == "P") {
      p = true;
    }
    if (S == "W") {
      w = true;
    }
    if (S == "G") {
      g = true;
    }
    if (S == "Y") {
      y = true;
    }
  }
  
  if (p && w && g && y) {
    cout << "Four" << endl;
  }
  
  else {
    cout << "Three" << endl;
  }
}


Measured memory_bytes: 3608
#include <iostream>

using namespace std;

int main(){
  int a,b;
  cin >> a >> b;
  if(a<=0 && b>=0)cout << "Zero" << endl;
  else{
    if(a>0)cout << "Positive" << endl;
    else {
      if((min(0,b+1)-a)%2==0)cout << "Positive" << endl;
      else cout << "Negative" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define MAXN (int)1e4

using namespace std;

signed main() {
  IOS;
  int N, i,j, ans=0, _A=0, B_=0, B_A=0;
  cin >> N;
  string s;
  for (i = 0; i < N; i++) {
    cin >> s;
    unsigned long l = s.length();
    for (j = 0; j < l-1; j++) {
      if (s[j]=='A' and s[j+1]=='B') {
        ans++;
        j++;
      }
    }
    if (s[0] == 'B' and s[l-1] == 'A') B_A++;
    else if (s[0] == 'B') B_++;
    else if (s[l-1] == 'A') _A++;
  }
  if (B_A > 0) ans += B_A-1;
  if (B_A > 0 and _A > 0) {
    ans++;
    _A--;
  }
  if (B_A > 0 and B_ > 0) {
    ans++;
    B_--;
  }
  ans += min(_A, B_);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>

int main()
{
	int a;
	scanf("%d", &a);
	if(a==7)
	{
		printf("YES");
	}
	else if(a==5)
	{
		printf("YES");
	}
	else if(a==3)
	{
		printf("YES");
	}
	else
	{
		printf("NO");
	}
}

Measured memory_bytes: 1696
import math, itertools

n = int(input())

result_dict = {}

for x in range(1, int(math.sqrt(10000) + 1)):
    for y in range(1, int(math.sqrt(10000) + 1)):
        for z in range(1, int(math.sqrt(10000) + 1)):
            result_dict[(x, y, z)] = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x

result = list(result_dict.values())

import collections

num_dict = dict(collections.Counter(result))

for i in range(1, n + 1):
    print(num_dict.get(i, default=0))

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

using namespace std;
const int N = 100010;
typedef long long ll;
ll a, b, n, h[N], c;

int ok(ll times) {
    ll tot = 0;
    for (int i = 0; i < n; i++) {
        if (h[i] - times * b <= 0) continue;
        tot += (h[i] - times * b + c - 1) / c;
    }
    return tot <= times;
}

int main() {
    cin >> n >> a >> b;
    c = a - b;
    for (int i = 0; i < n; i++) scanf("%lld", h + i);
    sort(h, h + n);
    int l = 0, r = (int) floor(1.0 * h[n - 1] / b)+100;
    while (l < r) {
        int mid = (l + r) >> 1;
        if (ok(mid)) r = mid;
        else l = mid + 1;
    }
    cout << l << endl;
    return 0;
}

Measured memory_bytes: 1024
// tested by Hightail: https://github.com/dj3500/hightail
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <stack>
#include <cstring>
#include <iomanip>
#include <ctime>
#include <cassert>
using namespace std;
#define pb push_back
#define INF 1001001001
#define FOR(i,n) for(int (i)=0;(i)<(n);++(i))
#define FORI(i,n) for(int (i)=1;(i)<=(n);++(i))
#define mp make_pair
#define pii pair<int,int>
#define ll long long
#define vi vector<int>
#define SZ(x) ((int)((x).size()))
#define fi first
#define se second
#define wez(n) int (n); scanf("%d",&(n));
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m));
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k));
inline void pisz(int n) { printf("%d\n",n); }
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){FOR(i,SZ(t))s<<t[i]<<" ";return s; }
#define DBG(vari) cout<<"["<<__LINE__<<"] "<<#vari<<" = "<<(vari)<<endl;
#define ALL(t) t.begin(),t.end()
#define FOREACH(i,t) for (__typeof(t.begin()) i=t.begin(); i!=t.end(); i++)
#define TESTS wez(testow)while(testow--)
#define REP(i,a,b) for(int (i)=(a);(i)<=(b);++i)
#define REPD(i,a,b) for(int (i)=(a); (i)>=(b);--i)
#define REMAX(a,b) (a)=max((a),(b));
#define REMIN(a,b) (a)=min((a),(b));
#define IOS ios_base::sync_with_stdio(0);

int main () {
   string s;
   cin >> s;
   FOR(i,SZ(s)-1) if (s[i] == 'A' && s[i+1] == 'C') {
      cout << "Yes";
      return 0;
      
   }
   cout << "No";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int mon(long long x){
  int ans = 0;
  long long money = 100;
  while (money < x){
    money *= 1.01;
    ans++;
  }
  return ans;
}
int main(){
  long long x;
  cin >> x;
  int answer = mon(x);
  cout << answer << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define cinf(n,x,y,z) for(int i=0;i<(n);i++) cin >> x[i]>>y[i]>>z[i];
typedef long long int ll;
using namespace std;
const long long INF = 1LL<<60;

ll dp[50][500][500];

int main(){
	int n,ma,mb;cin>>n>>ma>>mb;
	vector<int> a(n),b(n),c(n);
	cinf(n,a,b,c);
	for(int i=0;i<50;i++){
		for(int j=0;j<500;j++){
			for(int k=0;k<500;k++){
				dp[i][j][k]=INF;
			}
		}
	}
	dp[0][0][0]=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<500;j++){
			for(int k=0;k<500;k++){
				if(dp[i][j][k]>=INF)continue;

				dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k]);
				dp[i+1][j+a[i]][k+b[i]]=min(dp[i+1][j+a[i]][k+b[i]],dp[i][j][k]+c[i]);
			}
		}
	}
	ll ans=INF;
	for(int i=1;i<500;i++){
		for(int j=1;j<500;j++){
			if(i*mb!=j*ma) continue;
			ans=min(ans,dp[n][i][j]);
		}
	}
	if(ans!=INF)cout << ans << endl;
	else cout << -1 << endl;
} 

Measured memory_bytes: 97920
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

int main() {
  i64 n;
  cin >> n;
  vector<i64> x(n), y(n);
  for (i64 i = 0; i < n; ++i) cin >> x[i] >> y[i];

  i64 ans = 1ll << 50;
  for (i64 i = 0; i < n; ++i) {
    for (i64 j = 0; j < n; ++j) {
      if (i == j) continue;
      i64 p = x[i] - x[j], q = y[i] - y[j], s = n;
      for (i64 k = 0; k < n; ++k) {
        for (i64 l = 0; l < n; ++l) {
          if (k == l) continue;
          if (x[k] + p == x[l] && y[k] + q == y[l]) {
            --s;
            break;
          }
        }
      }
      ans = min(ans, s);
    }
  }
  if (n == 1) ans = 1;
  cout << ans << '\n';
  return 0;
}



Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) throws Exception{
		int num = 998244353;

		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
 		StringTokenizer st = new StringTokenizer(bf.readLine());
 		int a = Integer.parseInt(st.nextToken());
 		if (a*500 >= Integer.parseInt(st.nextToken())){
 			out.println("Yes");
 		}
 		else
 			out.println("No");
 		
 		
 		out.println();
	 		
 		out.close();
 		
 		
 		
 	}
}
 	
 
//StringJoiner sj = new StringJoiner(" "); 
//sj.add(strings)
//sj.toString() gives string of those stuff w spaces or whatever that sequence is

 		
 		
 		
 		
	




Measured memory_bytes: 25436
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		int N = int.Parse(str[0]);
		int T = int.Parse(str[1]);
		long[][]A = new long[N][];
		for(var i=0;i<N;i++){
			string[] str2 = Console.ReadLine().Split();
			A[i] = new long[2]{long.Parse(str2[0]),long.Parse(str2[1])};
		}
		Array.Sort(A,(x,y)=>x[0].CompareTo(y[0]));
		long[,]D = new long[N+1,T+1];
		for(var i=1;i<=T;i++){
			D[0,i] = D[0,i-1];
			for(var j=1;j<=N;j++){
              	D[j,i] = Math.Max(D[j,i-1],D[j-1,i]);
				if(i-A[j-1][0] >= 0){
					if(D[j-1,i-A[j-1][0]]+A[j-1][1] > D[j,i]){
						D[j,i] = D[j-1,i-A[j-1][0]]+A[j-1][1];
					}
				}
			}
		}
		long max = D[N,T];
		for(var i=0;i<=N;i++){
			long max2 = 0;
			for(var j=i;j<N;j++){
 				max2 = Math.Max(max2,A[j][1]);
            }
         	max = Math.Max(max,D[i,T-1]+max2);
        }
		Console.WriteLine(max);
	}
}

Measured memory_bytes: 83424
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int p, q;
		for(int i=0;i<s.length();i+=2){
			p = s.codePointAt(i) - 48;
			q = s.codePointAt(i+1);
			if(p==0 && q==85){
				System.out.print("nn");
			}else{
				if(p==2) System.out.print("k");
				else if(p==3) System.out.print("s");
				else if(p==4) System.out.print("t");
				else if(p==5) System.out.print("n");
				else if(p==6) System.out.print("h");
				else if(p==7) System.out.print("m");
				else if(p==8) System.out.print("y");
				else if(p==9) System.out.print("r");
				else if(p==0) System.out.print("w");
				
				if(q==84) System.out.print("a");
				else if(q==76) System.out.print("i");
				else if(q==85) System.out.print("u");
				else if(q==82) System.out.print("e");
				else if(q==68) System.out.print("o");
			}
		}
		System.out.println();
	
	}	
}

Measured memory_bytes: 17312
#include <bits/stdc++.h>
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define SP << " " <<
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

#define int long long

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b;
  cin >> a >> b; 
  if(a > b) swap(a, b);
  if((b - a) % 2 == 0){
    cout << a + ((b - a) / 2) << endl;
  }else{
    cout << "IMPOSSIBLE" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
/*Bismillahir Rahmanir Rahim*///{
#include <bits/stdc++.h>
#include <ext/numeric>
using namespace std; using __gnu_cxx::power;
using ll = long long; using ull = unsigned long long; using ld = long double;
const ll llinf = (1ll<<61)-1; const double eps = 1e-6, ldeps = 1e-9;
struct Dbg { static constexpr auto &os = cout;   // replace by cerr in interactive.
template<class C> static auto dud(C *x)->decltype(os << *x, 0);
template<class C> static char dud(...);
template<class C> typename enable_if<sizeof dud<C>(0)!=1,Dbg&>::type operator<<(const C &x) {os<<x; return *this;}
template<class C> Dbg &dump(C b, C e) {
    for (struct{C i;int j;} i={(*this<<"\n[",b),0}; i.i!=e and i.j<26; i.i++, i.j++) *this<<", "+2*(i.i==b)<<*i.i;
    return *this << ']';
}
template<class C> typename enable_if<sizeof dud<C>(0)==1, Dbg&>::type operator<<(const C &x) {
    return dump(begin(x), end(x));
}
template<class C, size_t X> typename enable_if<!is_same<C, const char>::value, Dbg&>::type operator<<(C (&x)[X]) {
    return dump(begin(x), end(x));
}
template<class B, class C> Dbg &operator<<(const pair<B, C> &x) {return *this<<'{'<<x.first<<", "<<x.second<<'}';}
Dbg &operator<<(ostream&(*x)(std::ostream&)) { os << x; return *this; }
} dbg;
void err(istringstream *iss) { delete iss; }
template<class C, class... Args> void err(istringstream *iss, const C &val, const Args &... args) {
    string name; *iss >> name; if (name.back()==',') name.pop_back();
    dbg << name << " = " << val << "; ", err(iss, args...);
}
#define bug(args...) dbg << __LINE__ << ": ", err(new istringstream(#args), args), dbg << endl
#define cbug(a, args...) if (a) bug(args);
#define ASSERT(a, o, b, args...) if (!((a)o(b))) bug(a, b, ##args), assert((a)o(b));
#define sl(a) int(strlen(a))
#define sz(a) int(a.size())
int T, Q, cn;//}
const int inf = 1000000007, mxn = -1;

signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); cout.precision(11), cout.setf(ios::fixed);
    int a, b;
    cin >> a >> b;
    cout << a*b << '\n';
}

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

#define ll long long
#define endl "\n"
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define f first
#define s second
#define vecll vector<ll>
#define pairll pair<ll,ll>
#define vecpairll vector<pair<ll,ll>>
#define mapllll map<ll,ll>
#define mapstrll map<string,ll>
#define mapllvecll map<ll,vecll>
#define setll set<ll>
#define fio ios_base::sync_with_stdio (false); cin.tie (NULL); cout.tie(NULL);

using namespace std;

ll const N=1e5+5;
ll const inf=1e18+5;
ll const MOD=1e9+7;

ll t,n,m,x,y,z,w,k;

int main()
{
    fio

    string str;
    cin>>str;

    n = str.length();

    ll dp[2][2100];
    memset(dp,0,sizeof dp);

    dp[0][(str[0]-'0')]++;

    ll ans = 0;

    for(ll i=1;i<n;i++)
    {
        ll ind1 = i%2;
        ll ind2 = (ind1+1)%2;

        for(ll j=0;j<2019;j++)
        {
            ll val = (((j*10)%2019) + (str[i]-'0'))%2019;

            dp[ind1][val] += dp[ind2][j];
            dp[ind2][j] = 0;
        }
        dp[ind1][(str[i]-'0')]++;

        ans += dp[ind1][0];
    }
    cout<<ans;

    return 0;
}



Measured memory_bytes: 3776
#include<iostream>
using namespace std;
int main() {
    string s;
    cin >> s;
    int cnt = 0;
    for (int i = 0; i < s.size(); ++i) {
        if (s[i] == '+') {
            cnt++;
        } else {
            cnt--;
        }
    }
    cout << cnt << endl;
    return 0;
}




Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define gcd __gcd
#define F first
#define B begin()
#define E end()
#define ln length()
#define sz size()
#define S second
#define em empty()
#define mp make_pair
#define pb push_back
#define pq priority_queue
#define um unordered_map
#define us unordered_set
#define lb lower_bound
#define ub upper_bound
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
#define sbits(a) __builtin_popcount(a)
#define lcm(a, b) ((a * b) / gcd(a, b))
#define nani(x) cerr << #x << " is " << x << endl;
#define adde(g, u, v) g[u].pb(v), g[v].pb(u);
#define addew(g, u, v, w) g[u].pb({ v, w }), g[v].pb({ u, w });
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define inf 10000000000
#define mod 1000000007

typedef long long ll;

const int N = 1e5 + 5;

char s[N];

int main()
{
    fast;

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n;
    cin >> n >> s;

    int c = 0;

    for (int i = 0; i < n - 1; i++) {
        c++;
        while (s[i] == s[i + 1] && i < n - 1)
            i++;
    }

    if (s[n - 1] != s[n - 2])
        c++;
    cout << c;

    return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

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

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

int main()
{
	ll A, B, C, D;
	cin >> A >> B >> C >> D;
	ll num1 = B / C + B / D - B / lcm(C, D);
	ll num2 = (A - 1) / C + (A - 1) / D - (A - 1) / lcm(C, D);
	cout << (B - A + 1) - num1 + num2 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define f(i,a,b) for(int i=a,inc=(b-a)/abs(b-a); i!=b ; i+=inc)
#define deb(x) cout<<#x<<"->"<<x<<endl;
#define print(arr,a,b) for(int i=a;i!=b;i++){cout<<arr[i]<<" ";}cout<<endl;
using ll=long long int;
int arr_min(int arr[],int a,int b){ int min=arr[0]; for(int i=a;i!=b;i++){if(min>arr[i]) min=arr[i];}return min;}
int arr_max(int arr[],int a,int b){ int max=arr[0]; for(int i=a;i!=b;i++){if(max<arr[i]) max=arr[i];}return max;}

signed main()
{
	ios_base::sync_with_stdio(false);   
    cin.tie(NULL);

	#ifndef ONLINE_JUDGE
      	freopen("input.txt", "r", stdin);
      	freopen("output.txt", "w", stdout);
    #endif
    int t=1;
    // cin>>t;
    while(t-->0){
        int k,a,b;
        cin>>k>>a>>b;
        for(int i=a;i<=b;i++)
        {
        	if(i%k==0)
        	{
        		cout<<"OK"<<endl;
        		return 0;
        	}
        }
        cout<<"NG"<<endl;	
    	
    	
    }
    return 0;
}

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

using ll = long long;
//typedef long long ll;

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

#define INF ((1LL << 31) - 1)
#define INFLL ((1LL << 62) - 1)
#define MOD (ll)(1e9+7)
#define EPS 1e-10
#define repi(i,j,n) for(int i = (j); i < (n); ++i)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()

int vx[4] = {-1, 0, 1, 0}, vy[4] = {0, -1, 0, 1};
//int vx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, vy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};

// [sx, se), [sy, ey)であることに注意
inline bool check(int sx, int ex, int sy, int ey, int x, int y) {
  return (sx <= x and x < ex and sy <= y and y < ey);
}

inline bool check(int ex, int ey, int x, int y) {
  return check(0, ex, 0, ey, x, y);
}

std::vector<std::string> split(const std::string& s, char delim) {
  std::vector<std::string> ret;
  std::stringstream ss(s);
  std::string tmp;

  while (std::getline(ss, tmp, delim)) {
    ret.push_back(tmp);
  }

  return ret;
}

inline void init() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
}

int main() {
  int m;
  cin >> m;
  cout << 24 + (24 - m) << endl;
  return 0;
}

Measured memory_bytes: 764
#!/usr/bin/env python3
import sys


def solve(N: int, h: "List[int]"):
    dp = [0] * N
    dp[0] = 0
    dp[1] = dp[0] + abs(h[1] - h[0])
    for i in range(2, N):
        dp[i] = min(
            dp[i-1] + abs(h[i] - h[i-1]),
            dp[i-2] + abs(h[i] - h[i-2]),
        )

    print(dp[-1])


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, h)


if __name__ == '__main__':
    main()


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

int main(){
	int a,b;
	cin >> a >> b;
	if (a>b){
		cout<< "a > b"<< endl;
	}else if (a==b){
		cout << "a == b" <<endl;
	}else {
		cout <<"a < b" <<endl;
	}
	return 0;
}

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

const long MAX = 200000;
const long SENTINEL = 2000000000;

long L[MAX / 2 + 2], R[MAX / 2 + 2];

long long merge(long A[], long n, long left, long mid, long right){
	long long cnt = 0;
	long n1 = mid - left;
	long n2 = right - mid;
	for (long i = 0; i < n1; i++) L[i] = A[left + i];
	for (long i = 0; i < n2; i++) R[i] = A[mid + i];
	L[n1] = R[n2] = SENTINEL;
	long i = 0, j = 0;
	for (long k = left; k < right; k++){
		if (L[i] <= R[j]) A[k] = L[i++];
		else {
			A[k] = R[j++];
			cnt += n1 - i;
		}
	}
	return cnt;
}

long long mergeSort(long A[], long n, long left, long right){
	if (left + 1 < right){
		long mid = (left + right) / 2;
		long v1 = mergeSort(A, n, left, mid);
		long v2 = mergeSort(A, n, mid, right);
		long v3 = merge(A, n, left, mid, right);
		return v1 + v2 + v3;
	}
	else return 0;
}

int main(){
	long A[MAX], n;
	cin >> n;
	for (long i = 0; i < n; i++) cin >> A[i];
	long long ans = mergeSort(A, n, 0, n);
	cout << ans << endl;
	return 0;
}

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

deque<char> ans;

int search(int n, vector<vector<int>> &next, string &s) {
    char c = 0;
    for (int cur = 0; cur <= n; ) {
        int maxi = cur;
        for (int i = 0; i < 26; i++) {
            if (next[cur][i] == -1 || next[cur][i] > n) {
                c = 'a' + i;
                maxi = -1;
                break;
            } else maxi = max(next[cur][i], maxi);
        }
        if (maxi == -1) break;
        cur = maxi;
    }
    ans.emplace_back(c);
    for (int i = n-1; i >= 0; i--) {
        if (s[i] == c) return i;
    }
    return -1;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    int n = s.size();
    reverse(s.begin(), s.end());
    vector<vector<int>> next(n+1, vector<int>(26, -1));
    for (int i = 0; i < n; i++) {
        next[i][s[i]-'a'] = i+1;
    }
    for (int i = n; i > 0; i--) {
        for (int j = 0; j < 26; j++) {
            if (next[i-1][j] == -1) next[i-1][j] = next[i][j];
        }
    }
    int u = n;
    while (true) {
        int ret = search(u, next, s);
        if (ret == -1) break;
        else u = ret;
    }
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i];
    }
    cout << endl;
    return 0;
}

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

struct Benri { Benri() { std::cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12);}} benri;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
using pll = pair<ll, ll>;
using ull = unsigned long long;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

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

constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
constexpr int INF = 1001001001;
//constexpr ll INF = 1001001001001001001ll;
constexpr double EPS = 1e-10;
using number = long long;



struct UnionFind {
    vector<int> par, rank;

    UnionFind(int n) : par(n , -1), rank(n, 0) { }
    void init(int n) { par.assign(n, -1), rank.assign(n, 0); }

    int root(int x) {
        if (par[x] == -1) return x;
        else return par[x] = root(par[x]);
    }

    bool same(int x, int y) {
        return root(x) == root(y);
    }

    bool unite(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};


struct edge {
    int from, to;
    number cost;
    edge(int a, int b, number c) : from(a), to(b), cost(c) {}
};

using Edges = vector< edge >;

number kruskal(int V, Edges &edges) {
    sort(all(edges), [](const edge & a, const edge & b) {
        return (a.cost < b.cost);
    });
    UnionFind uf(V);
    number ret = 0;
    for (auto &e : edges) {
        if (uf.unite(e.from, e.to)) ret += e.cost;
    }
    return ret;
}




int main() {
    int V, E; cin >> V >> E;
    Edges G;
    int s, t; ll w;
    rep(i, E) {
        cin >> s >> t >> w;
        G.pb(edge(s, t, w));
    }

    cout << kruskal(V, G) << endl;

}



Measured memory_bytes: 4944
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
class Program
{
    public static void Main()
    {
        long X = long.Parse(Console.ReadLine());
        double money = 100;
        long count =0;
        while (money < X)
        {
            money = (long)money*1.01;
            count++;
        }
        Console.WriteLine(count);
    }
}

Measured memory_bytes: 27476
#https://atcoder.jp/contests/abc154/tasks/abc154_c
# -*- coding: utf-8 -*-
N = int(input())
A = [int(i) for i in input().split()]
A.sort()
for i in range(1,N):
  if A[i] == A[i-1]:
    ans = "NO"
    break
  else:
    ans = "YES"
print(ans)

Measured memory_bytes: 86740
data = list(map(int, input().split()))
n = int(input())
dice = ['12431', '03520', '01540', '04510', '02530', '13421']
for i in range(n):
    up, front = map(int, input().split())
    u = data.index(up)
    f = data.index(front)
    a = dice[u].find(str(f))
    print(data[int(dice[u][a+1])])

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

vector<int> s(4);
vector<string> op_;

void sum(int, string);

int main() {
    string abcd;
    cin >> abcd;
    for(int i=0; i < 4; ++i) {
        s[i] = abcd[i] - '0';
    }
    int num = s[0];
    string op;
    sum(num, op);
    for(int i=0; i<op_.size(); ++i) {
        if(op_[i][0] == '7') {
            cout << s[0] << op_[i][1] << s[1] << op_[i][2] << s[2] << op_[i][3] << s[3] << "=7" << endl;
            return 0;
        }
    }
}

void sum(int num, string op) {
    if(op.size() == 3) {
        string ss;
        char sss = num + '0';
        op_.push_back(ss);
        op_[op_.size()-1] += sss;
        op_[op_.size()-1] += op;
        return;
    }
    op += '+';
    num += s[op.size()];
    sum(num, op);
    op.pop_back();
    op += '-';
    num -= s[op.size()]*2;
    sum(num, op);
    return;
}

Measured memory_bytes: 256
import bisect
N = int(input())
L = sorted(list(map(int, input().split())))

def valid(i, j ,x):
    if x < i + j:
        return True
    else:
        return False

ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        # L[j]より大きくて、L[i] + L[j]より小さい棒を選ぶと三角形を作ることができる。
        insert_point = bisect.bisect_left(L, L[i] + L[j])
        ans += insert_point - j - 1
print(ans)


Measured memory_bytes: 42972
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
const int MAX = 510000;
const int MOD = 1000000007;


     signed main(){
          cout << std::fixed << std::setprecision(15);
int n,a[3],ans[3]={};ans[0]=1;int t[3]={};
cin>>n;
for(int i=0;i<n;i++){
      // cerr<<t[2]<<' '<<t[1]<<' '<<t[0]<<endl;
     cin>>a[0];
     a[1]=a[0]/(MOD-7);
     a[0]%=MOD-7;
     t[0]=ans[0]*a[0];
     t[1]=(ans[1]*a[0]+ans[0]*a[1]+t[0]/(MOD-7));
     t[0]%=MOD-7;
     t[2]=ans[2]*a[0]+ans[1]*a[1];
     t[2]+=t[1]/(MOD-7);
     t[1]%=MOD-7;
     if(t[2]>1||(t[2]==1&&(t[1]!=0||t[0]!=0))){
         for(int j=i+1;j<n;j++){
              int u;
              cin>>u;
              if(u==0){
                   cout<<0<<endl;
                   return 0;
              }
         }
         cout<<-1<<endl;
          return 0;
     }
    for(int i=0;i<3;i++)ans[i]=t[i];

}


cout<<ans[0]+(MOD-7)*(ans[1]+ans[2]*(MOD-7))<<endl;







 }

 


 






    





      

        


Measured memory_bytes: 3636
#include<iostream>
using namespace std;
int main()
{
	int H;
	int W;
	while (1)
	{
		cin >> H >> W;
		if (H == 0 && W == 0){ break; }
		for (int i = 0; i < H; i++)
		{
			{
				for (int j = 0; j < W; j++)
				{
					cout << '#';
				}
				cout << endl;
			}
		}
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3104
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var nextString func() string

func init() {
	nextString = newReadString(os.Stdin)
}

func main() {
	n := nextInt()
	m := nextInt()
	cities := make([]int, n)

	for i := 0; i < m; i++ {
		a := nextInt() - 1
		b := nextInt() - 1
		cities[a]++
		cities[b]++
	}
	for _, v := range cities {
		fmt.Println(v)
	}
}

func nextInt() (result int) {
	result, _ = strconv.Atoi(nextString())
	return
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
		}
		return r.Text()
	}
}


Measured memory_bytes: 640
// ------------------------------------
// Date:2018/ 3/24
// Problem:Construct Sequences _ re_b.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

static const int MOD = 1e9 + 7;
static const int MAX_N = 1;

int main()
{
  CIN(N);
  vector< int > p(N);
  REP(i, N) cin >> p[i];
  vector< int > a(N);
  vector< int > b(N);
  REP(i, N) {
    a[i] = N * (i + 1);
    b[i] = N * (N - i);
  }

  REP(i, N) {
    a[p[i] - 1] += i;
    debug(a[p[i]]);
  }

  REP(i, N) {
    cout << a[i] << (i < N - 1 ? " " : "\n"); 
  }

  REP(i, N) {
    cout << b[i] << (i < N - 1 ? " " : "\n"); 
  }

  return 0;
}



Measured memory_bytes: 896
def solve(string):
    n, *v = map(int, string.split())
    v = sorted(v, reverse=True)
    return str(sum(_v / 2**i for i, _v in enumerate(v[:-1], start=1)) + v[-1] / 2**(n - 1))


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

Measured memory_bytes: 3060
#include <stdio.h>

#define N 100
#define INF 1000000000

int main(void){

	int i,j,k,l,n,p[N+1],m[N+1][N+1];
	
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d%d",&p[i-1],&p[i]);  
	}

	for(i=1;i<=n;i++){
		m[i][i] = 0;
	}
	
	for(j = 2;j<=n;j++){
		for(i=1;i<=n-j+1;i++){
			k = i + j -1;
			m[i][k] = INF;
			for(l=i;l<=k-1;l++){
				if(m[i][k] >= m[i][l] + m[l+1][k] + p[i-1]*p[l]*p[k]){
					m[i][k] = m[i][l] + m[l+1][k] + p[i-1]*p[l]*p[k];
				}
			}
		}
	}
	
	printf("%d\n",m[1][n]);

return 0;

}



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

using namespace std;

int main(){
  int a;
  int b;
  cin >> a >> b;
  int c=1;
  bool flag = false;
  for(c;c<=1250;c++){
    // cout << c << " : " << int(c*0.08) << " " << int(c*0.1) << endl;
    if(int(c*0.08) == a && int(c*0.1) == b){
      cout << c << endl;
      flag = true;
      break;
    }
  }
  if(!flag){
    cout << -1 << endl;
  }

  return 0;
}


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

int main(void) {
    int64_t N;
    string S;
    int64_t sum = 0;
    cin >> N >> S;

    for(int i=0;i<N-2;i++) {
        if(S[i] == 'A' && 
            S[i+1] == 'B' && 
            S[i+2] == 'C') {
            sum++;
        }
    }

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


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
const long long INF = 1LL << 60;
const long long mod = 1e9 + 7;
int N, M;
long long dp[100010];
int a[100010];


int main() {
	int N, M; cin >> N >> M;
	for (int i = 0; i < M; i++) cin >> a[i];
	for (int i = 0; i <= N; i++) dp[i] = 0;
	for (int i = 0; i < M; i++) dp[a[i]] = -INF;
	dp[0] = 1;
	for (int i = 0; i <= N; i++) {
		if (dp[i] > 0) {
            dp[i] = dp[i] % mod;
			if (dp[i + 1] >= 0) dp[i + 1] += dp[i];
			if (dp[i + 2] >= 0) dp[i + 2] += dp[i];
		}
	}
	cout << dp[N] % mod << endl;

}


Measured memory_bytes: 4696
#include <iostream>
#include <bitset>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>

using namespace std;

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)

int main()
{
	ll n, time = 0;

	string ans = "Yes";

	cin >> n;

	vecpairll a(n);

	forll(i, 0, n)
		cin >> a[i].second >> a[i].first;

	sort(a.begin(), a.end());

	forll(i, 0, n)
	{
		if (time + a[i].second > a[i].first)
		{
			ans = "No";
			break;
		}
		else
		{
			time += a[i].second;
		}
	}

	cout << ans;

}


Measured memory_bytes: 3328
def winList(t, r, s, p):
    if t == "r":
        return [0, 0, p]
    elif t == "s":
        return [r, 0, 0]
    else:
        return [0, s, 0]

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

dp = []
for i in range(N):
    wList = winList(T[i], R, S, P)
    if i <= K-1:
        if i == 0:
            dp.append(wList)
        else:
            dp.append([wList[0] + max(dp[i - 1]),
                       wList[1] + max(dp[i - 1]),
                       wList[2] + max(dp[i - 1])])
    else:
        wKList = winList(T[i - K], R, S, P)
        tmpR = 0
        tmpS = 0
        tmpP = 0
        if dp[i - K][0] > dp[i - K][1] and dp[i - K][0] > dp[i - K][2]:
            tmpR = wList[0] + max(dp[i - 1]) - wKList[0]
        else:
            tmpR = wList[0] + max(dp[i - 1])

        if dp[i - K][1] > dp[i - K][0] and dp[i - K][1] > dp[i - K][2]:
            tmpS = wList[1] + max(dp[i - 1]) - wKList[1]
        else:
            tmpS = wList[1] + max(dp[i - 1])

        if dp[i - K][2] > dp[i - K][0] and dp[i - K][2] > dp[i - K][1]:
            tmpP = wList[2] + max(dp[i - 1]) - wKList[2]
        else:
            tmpP = wList[2] + max(dp[i - 1])
        dp.append([tmpR, tmpS, tmpP])

print(max(dp[N-1]))

Measured memory_bytes: 88924
inf = float('inf')

n = int(input())
coordinates = [tuple(map(int, input().split())) for _ in range(n)]

parity = None
can_make = True
for coordinate in coordinates:
    if parity is None:
        parity = sum(coordinate) % 2
    else:
        if parity != sum(coordinate) % 2:
            can_make = False
            break

if not can_make:
    print(-1)
    exit()
    # 到達可能な頂点はxy座標の和のパリティが一致している必要がある

m = 40
if parity == 0:
    d = [pow(2, i) for i in range(39)] + [1]
    # 奇数は1だけなので、1を追加して、全ての腕の合計が偶数になるようにする
else:
    d = [pow(2, i) for i in range(40)]
    # 奇数は1だけなので、全ての腕の合計は奇数になる
d.sort(reverse=True)

ans = []
for x, y in coordinates:
    curx, cury = 0, 0
    ops = ''
    for dd in d:
        dist = inf
        op = ''
        det_dx, det_dy = 0, 0
        for c, (dx, dy) in zip('LRDU', [(-1, 0), (1, 0), (0, -1), (0, 1)]):
            t = abs(curx + dx * dd - x) + abs(cury + dy * dd - y)
            if dist > t:
                op = c
                dist = t
                det_dx = dx
                det_dy = dy
        ops += op
        curx += det_dx * dd
        cury += det_dy * dd
    if (curx, cury) == (x, y):
        ans.append(ops)
    else:
        print(-1)
        # print('不一致', curx, cury, x, y)

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


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

int main(){
	ll x, y;
	cin >> x >> y;
	if(x % y == 0) cout << "-1" << "\n";
	else{
		ll i = 1;
		while((x*i) % y == 0) i++;
		cout << x * i << "\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    string s;
    int n;
    cin >> s >> n;
    rep(i, s.size()){
        if(n == 0) break;
        if(i == s.size() - 1) {
            n %= 26;
            while(n != 0) {
                if(s[i] == 'z') {
                    s[i] = 'a';
                    n--;
                } else {
                    s[i] += 1;
                    n--;
                }
            }
        }
        if('z' - s[i] < n) {
            if(s[i] == 'a') continue;
            int a = 'z' + 1 - s[i];
            s[i] = 'a';
            n -= a;
        }
    }

    cout << s << endl;

    return 0;
}

Measured memory_bytes: 512
def solve(n, block)
  fall!(block)
  while delete!(n, block) != 0 do
    fall!(block)
  end
  clear(block)
end

def delete!(n, block)
  h = block.size
  w = block.first.size
  delete = Array.new(h) {Array.new(w)}
  for i in 0...h do
    for j in n-1...w do
      next if block[i][j] == "."
      ok = true
      for k in 1...n do
        ok = false if(block[i][j] != block[i][j-k])
      end
      next if !ok
      for k in 0...n do
        delete[i][j-k] = true
      end
    end
  end
  for j in 0...w do
    for i in n-1...h do
      next if block[i][j] == "."
      ok = true
      for k in 1...n do
        ok = false if(block[i][j] != block[i-k][j])
      end
      next if !ok
      for k in 0...n do
        delete[i-k][j] = true
      end
    end
  end
  count = 0
  for i in 0...h do
    for j in 0...w do
      next if !delete[i][j]
      block[i][j] = "."
      count += 1
    end
  end
  count
end

def fall!(block)
  h = block.size
  w = block.first.size
  for j in 0...w do
    for i in 0...h do
      next if block[h-i-1][j] != "."
      for k in i+1...h do
        next if block[h-k-1][j] == "."
        block[h-i-1][j], block[h-k-1][j] = block[h-k-1][j], block[h-i-1][j]
        break
      end
    end
  end
end

def clear(block)
  h = block.size
  w = block.first.size
  ok = true
  for i in 0...h do
    for j in 0...w do
      ok = false if block[i][j] != "."
    end
  end
  ok
end

h, w, n = gets.split.map(&:to_i)
block = []
h.times do
  block.push(gets.chomp)
end
ok = false
for i in 0...h do
  for j in 1...w do
    next if block[i][j-1] == block[i][j]
    block[i][j-1], block[i][j] = block[i][j], block[i][j-1]
    ok = true if solve(n, Marshal.load(Marshal.dump(block)))
    block[i][j-1], block[i][j] = block[i][j], block[i][j-1]
  end
end
puts ok ? "YES" : "NO"

Measured memory_bytes: 6132
#include <stdio.h>
    int a;
  	int b;
	int c;
int main(void) {	
  scanf("%d %d %d",&a,&b,&c);
  if (a < c && c < b || b < c && c < a){
     printf("Yes");
  }
  else{ 
   printf("No");
  }
  return 0;
}

Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		PrintWriter pw=new PrintWriter(System.out);
		int t=scan.nextInt();
		Set<String> set=new HashSet<String>();
		while((t--)!=0){
			String s=scan.next();
			String ch=scan.next();
			if(s.charAt(0)=='i'){
				set.add(ch);
			}else{
				if(set.contains(ch))
					pw.println("yes");
				else
					pw.println("no");
			}
		}
		pw.close();
	}


}

Measured memory_bytes: 228756
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/detail/standard_policies.hpp>

// common
#define endl     "\n"
#define M_PI     3.14159265358979323846

// fast input output
#define fast_io  ios_base::sync_with_stdio(false); cin.tie(NULL);  cout.tie(NULL)

// fixed float field
#define fix_prec cout.setf( std::ios::fixed, std:: ios::floatfield ); cout.precision(9);

// vector
#define vi       vector<int>
#define vvi      vector<vector<int>>
#define vpii     vector<pair<int,int>>
#define pb(v,x)  v.push_back(x)

// pair
#define pii      pair<int,int>
#define mp(a,b)  make_pair(a,b)
#define F        first
#define S        second

// sort
#define all(x)   x.begin(),x.end()

// bound
#define lb(v,x)  lower_bound(v.begin(),v.end(),x)
#define ub(v,x)  upper_bound(v.begin(),v.end(),x)

using namespace std;
//using namespace __gnu_pbds;

//typedef tree < int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update > ordered_set;
typedef long long int lli;
typedef unsigned long long int ulli;

// constants
lli const mod  = 1e9;
lli const modl = 1e18;

void solve()
{
	int x;
	cin>>x;
	if(x>=30)
		cout<<"Yes";
	else
		cout<<"No";
}

int main()
{
  fast_io;
  fix_prec;
  int t=1;
  //cin>>t;
  while(t--)
  {
    solve();
    cout<<endl;     
  }
  return 0;	
}


Measured memory_bytes: 3664
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#define rep(i,n) for (int i = 0; (i) < (n); ++ (i))
#define int long long
using namespace std;
 
signed main(void){
    int n,mone = 0,mtwo = 0;
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    vector<int> aligns(n);
    rep(i,n) {
        cin >> aligns[i];
    }
    sort(aligns.begin(),aligns.end());
    if(aligns.size() == 2) {
        cout << aligns[1] - aligns[0] << endl;
        return 0;
    }
    rep(i,n) {
        mone += aligns[n-1-i] - aligns[i];
        mtwo += aligns[n-1-i] - aligns[i];
        if(n-1-i-i == 2) {
            mone += aligns[n-1] - aligns[i+1];
            mtwo += aligns[i+1] - aligns[0];
            break;
        } else if(n-1-i-i == 3) {
            mone += aligns[n-2-i] - aligns[i];
            mtwo += aligns[n-1-i] - aligns[i+1];
            mone += aligns[n-1] - aligns[i+1];
            mtwo += aligns[i+2] - aligns[0];
            break;
        } else {
            mone += aligns[n-2-i] - aligns[i];
            mtwo += aligns[n-1-i] - aligns[i+1]; 
        }
    }
    cout << max(mone,mtwo) << endl;
    return 0;
}

Measured memory_bytes: 1024
import itertools

n = int(input())
perm_a = [int(x) for x in input().split()]
perm_b = [int(x) for x in input().split()]
perm_a = tuple(perm_a)
perm_b = tuple(perm_b)


ind_a = -1
ind_b = -1
for i, perm in enumerate(itertools.permutations(range(1, n+1))):
    if perm == perm_a:
        ind_a = i
    if perm == perm_b:
        ind_b = i

print(abs(ind_b - ind_a))


Measured memory_bytes: 3064
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<tuple>
#include<bitset>
#include<iomanip>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-15
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N,H,W;
	int A[1001],B[1001];
	int ans=0;
	scan(N);scan(H);scan(W);
	rep(i,N){
		scan(A[i]);scan(B[i]);
		if(A[i]>=H&&B[i]>=W) ans++;
	}
	prin(ans);
	return 0;
}


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

int main(){
	int i = 0;
	while (1){
		i++;
		int num;
		cin >> num;
		if (num == 0){ break; }
		else{
			cout <<"Case "<<i<<": "<< num<<"\n";
		}
	}
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

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

    while (true)
    {
        int n, w;
        cin >> n >> w;
        if (n == 0)
            break;
        ld res = 0.01;
        int v[101] = {0};
        for (int i = 0; i < n; i++)
        {
            int a;
            cin >> a;
            v[a / w]++;
        }
        ld ma = -1, koumoku = 0;
        for (int i = 0; i < 101; i++)
        {
            if (ma < v[i])
                ma = v[i];
            if (v[i] != 0)
                koumoku = i;
        }
        for (int i = 0; i < koumoku; i++)
        {
            res += (1 - i / koumoku) * (v[i] / ma);
        }
        cout << setprecision(10) << res << endl;
    }
}


Measured memory_bytes: 3268
#include<iostream>
#include<vector>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <sstream>
#include <cmath>
#include <ctime>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>

using namespace std;

int main()
{
    long long a,b,c,sum;
    //freopen("11854.txt","r",stdin);
    while(scanf("%llu %llu",&a,&b)==2)
    {
        sum=0;
        c=0;
        sum=a+b;
        while(sum!=0)
        {
            sum=sum/10;
            c++;
        }
        printf("%llu\n",c);
    }
    return 0;
}

Measured memory_bytes: 1196
N,K = map(int,input().split())
log_ls = list(map(int,input().split()))

Max = max(log_ls)

def less_k(min_length,log_ls = log_ls,K=K):
    times = 0
    for log in log_ls:
        if log % min_length == 0:
            times += log // min_length -1
        else:
            times += log // min_length
    if times <= K:
        return True
    else:
        return False
#print(less_k(5,[10,10],2))

def return_min_length():
    r = Max
    l = -1
    while True:
        next_length = (r+l) // 2
        if next_length == 0 or not less_k(next_length):
            l = next_length
        else:
            r = next_length
        if r - l == 1:
            return r

ans = return_min_length()
print(ans)


Measured memory_bytes: 30776