akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}

void genans(int k,string s, string t) {
  rep(i,k) {
    if(s[i] != '?') {
      cout << s[i];
    } else {
      cout << 'a';
    }
  }
  cout << t;
  srep(i,sz(t)+k,sz(s)) {
    if(s[i] != '?') {
      cout << s[i];
    } else {
      cout << 'a';
    }
  }
  cout << endl;
}
  
int main() {
  string s;
  cin >> s;
  int slen = sz(s);
  string t;
  cin >> t;
  int tlen = sz(t);
  vi d(26,tlen);
  rep(i,26) {
    char c = i + 'a';
    auto it = find(rng(t),c);
    if(it != t.end()) {
      d[i] = distance(t.begin(),it);
    }
  }
  int k = slen - tlen;
  while(k >= 0) {
    int shift = -1;
    rep(i,tlen) {
      if(s[i+k] != '?' && s[i+k] != t[i]) {
        shift = max(1,d[s[i+k] - 'a']-i);
        break;
      }
    }
    if(shift == -1) {
      genans(k,s,t);
      return 0;
    } else {
      k -= shift;
    }
  }
  cout << "UNRESTORABLE" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>

using namespace std;

const int INF = 1e9;

const int diff[4][2] = { {-1, 0}, {0, -1}, {1, 0}, {0, 1}};

int main(int argc, char *argv[])
{
  int H, W, ans[1020][1020], aaa = 0;
  string A[1020];
  queue<pair<int, int> > que;
  cin >> H >> W;

  for (int i = 0; i < H; i++) {
    cin >> A[i];

    for (int j = 0; j < W; j++) {
      if (A[i][j] == '#') {
        que.push(make_pair(i, j));
      }
      ans[i][j] = 0;
    }
  }

  while (!que.empty()) {
    auto p = que.front();
    que.pop();

    int i = p.first;
    int j = p.second;
    for (int k = 0; k < 4; k++) {
      int ii = i + diff[k][0];
      int jj = j + diff[k][1];
      if (ii >= 0 && jj >= 0 && ii < H && jj < W && A[ii][jj] == '.') {
        A[ii][jj] = '#';
        que.push(make_pair(ii, jj));
        ans[ii][jj] = ans[i][j] + 1;
        aaa = max(ans[ii][jj], aaa);
      }
    }
  }

  cout << aaa << endl;
  return 0;
}


Measured memory_bytes: 13456
N = int(input())
a = list(map(int, input().split()))
alice_point = 0
bob_point = 0
a.sort(reverse=True)
for i in range(N):
    if i % 2 == 0:
        alice_point += a[i]
    else:
        bob_point += a[i]
print(alice_point-bob_point)

Measured memory_bytes: 3316
b = input()

ans = ""
for i in range(len(b)):
    if b[i] == "A":
        ans += "T"
    elif b[i] == "T":
        ans += "A"
    elif b[i] == "C":
        ans += "G"
    elif b[i] == "G":
        ans += "C"

print(ans)


Measured memory_bytes: 2940
import sys


A,B,K = sys.stdin.readline().strip().split()
A = int(A)
B = int(B)
K = int(K)

cnt=0
num=1
N = []
while cnt<=100:
    if(A%num==0 and B%num==0):
        N.append(num)
    num += 1
    cnt += 1

print(N[-K])

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

using namespace std;

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

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

  int count = 0;
  for (int i=0; i<n; i++) {
    uint64_t a_tmp = a[i];
    while (true) {
      if (a_tmp % 2 == 0) {
        a_tmp = a_tmp / 2;
        count++;
      } else {
        break;
      }
    }
  }

  cout << count << endl;

  return 0;
}


Measured memory_bytes: 384
function main(input) {
  var nums = input.split("\n")[1].split(" ").map(function (n) {
     return parseInt(n, 10);
  });

    var count = 0;
    while (
      nums.every(function (n) {
        return n % 2 === 0;
      })
    ) {
      count++;
      nums = nums.map(function (n) {
        return n / 2;
      });
    }

    console.log(count);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7500
// Reads multiple ints in a line, separate by a space.
// It works even if the actual number of ints is smaller than n.
// WARNING: This function does not work for -2^31.
// NOTE: This function does not handle error cases.
fun fastReadInts(n: Int): IntArray {
  val xs = IntArray(n)
  val s = readLine()!!
  var currentValue = 0
  var isNegative = false
  var currentIndex = 0
  for (c in s) {
    if (c == ' ') {
      xs[currentIndex] = currentValue * if (isNegative) -1 else 1
      currentValue = 0
      isNegative = false
      currentIndex++
    } else if (c == '-') {
      isNegative = true
    } else {
      currentValue *= 10
      currentValue += c - '0'
    }
  }
  xs[currentIndex] = currentValue * if (isNegative) -1 else 1
  return xs
}

fun countAtMost(xs: IntArray, z: Int): Int {
  if (xs[0] > z) return 0
  // Find largest m s.t. xs[m] <= z
  var l = 0
  var u = xs.size - 1
  while (l < u) {
    val m = (l + u + 1) / 2
    if (xs[m] <= z) {
      l = m

    } else {
      u = m - 1
    }
  }
  return l + 1
}

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val xs = fastReadInts(n)
  val ys = fastReadInts(n)

  val mods = Array(30, { IntArray(n) })
  for (b in 0 until 30) {
    for (i in 0 until n) {
      mods[b][i] = xs[i] % (1 shl (b + 1))
    }
    mods[b].sort()
  }

  var ans = 0
  for (b in 0 until 30) {
    for (y in ys) {
      val dy = y % (1 shl (b + 1))
      var count = 0
      // m + dy in [2 ^ b, 2 ^ (b + 1))
      // i.e.
      // If dy <= 2 ^ b: m in [2 ^ b - dy, 2 ^ (b + 1) - dy)
      // If not: [0, 2 ^ (b + 1) - dy), [2 ^ b - dy + 2 ^ (b + 1), 2^ (b + 1))
      if (dy <= 1 shl b) {
        count += countAtMost(mods[b], (1 shl (b + 1)) - dy - 1) -
            countAtMost(mods[b], (1 shl b) - dy - 1)
      } else {
        count += countAtMost(mods[b], (1 shl (b + 1)) - dy - 1) +
            n -
            countAtMost(mods[b], (1 shl b) - dy + (1 shl (b + 1)) - 1)
      }

      if (count % 2 == 1) {
        ans = ans xor (1 shl b)
      }
    }
  }
  println(ans)
}


Measured memory_bytes: 89756
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef long double ld;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
ll exp(ll x,ll y){if(y==0) return 1;if(y%2 == 1) return x*exp(x,y/2)*exp(x,y/2);return exp(x,y/2) * exp(x,y/2);}
ll exp(ll x,ll y,ll modd) {if(y==0) return 1;ll t=exp(x,y/2,modd);t = t%modd;t=t*t;t=t%modd;if(y % 2 == 1) return (x*t)%modd ;return t%modd;}
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC target ("sse4")
#define ios ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0)
#define so sizeof
#define pb push_back
#define cl clear() ;
#define vl vector<ll>
#define sz size()
#define len length()
#define emp empty()
#define el endl;cout.flush()
#define be begin()
#define fi first
#define se second
#define br break
#define en end()
#define ro return 0
#define eb emplace_back
#define con continue
#define ms(x) memset(x , 0ll, so x)
#define all(x) (x).be , (x).en
#define acc(x) accumulate((x).be , (x).en , 0ll)
#define forn(i,a,b) for(ll i=a;i<=b;++i)
#define revn(i,a,b) for(ll i=a;i>=b;--i)
#define rng_58 mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define vs vector<string>
#define vsi vector<pair<string,int>>
#define vll vector<pair<ll,ll> >
#define vlll vector<pair<ll,pair<ll,ll>>>
#define vlvl vector<pair<pair<ll,ll>,ll>>>
#define pll pair<ll,ll>
#define plll pair<ll,pair<ll,ll>>
#define plvl pair<pair<ll,ll> ,ll>
#define mp make_pair
#define trace3(a,b,c) cerr <<"a is " << a << " b is " << b << " c is " << c << el;
#define trace4(a,b,c,d) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << el ;
#define trace5(a,b,c,d,e) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << el;
#define trace6(a,b,c,d,e,f) cerr <<"a is " << a << " b is " << b << " c is " << c <<" d is " << d << " e is " << e << " f is " << f << el ;

const ll inf= 1e9 +5;

int main()
{
    ios;
    int n, w;
	cin>>n>>w;
	 
	vector<int> val(n), wt(n);
	
	for(int i=0;i<n;i++)
		cin>>wt[i]>>val[i];
	
	int sum_val=0;
	for(int i=0;i<n;i++)
		sum_val+=val[i];
	
	vector<int> dp(sum_val+1, inf);
	
	dp[0]=0;
	
	
	for(int i=0;i<n;i++)
		for(int j=sum_val;j>=val[i];j--)
		{
			int p1 = dp[j-val[i]] + wt[i];
			
			dp[j] = min(dp[j], p1);
		}
	for(int j=sum_val;j>=0;j--)
		if(dp[j]<=w)
		{
			cout<<j;
			break;
		}
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
  using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define f first
  #define s second
  #define PB push_back
  #define MP make_pair
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)
  #define MOD 998244353
  #define N 200005
  #define INF 1000000000000
  #define eps 1e-6



int32_t main()
{



    int n;
    cin >> n;
    if(n == 25)
    {
      cout << "Christmas";
    }
    else if(n == 24)
    {
      cout << "Christmas Eve";
    }
    else if(n == 23)
    {
      cout << "Christmas Eve Eve";
    }
    else if(n == 22)
    {
      cout << "Christmas Eve Eve Eve";
    }



    return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    int N, M;
    cin >> N >> M;
    vector<int> C(M);
    for (int m = 0; m < M; ++m) {
        cin >> C[m];
    }
    
    vector<int> DP(N+1);
    DP[0] = 0;
    DP[1] = 1;
    for (int n = 2; n <= N; ++n) {
        DP[n] = DP[n-1] + 1;
        for (int m = 0; m < M; ++m) {
            if (n-C[m] >= 0) {
                DP[n] = min(DP[n], DP[n-C[m]] + 1);
            }
        }
    }
    cout << DP[N] << endl;

    return 0;
}



Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;
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; }
#define ll long long
 
const ll INF= 1LL << 60;
 
//入力
string s,t;

//dp
ll dp[3010][3010]={0};

int main(){
  cin>> s >> t;
  for(int i=0;i<s.size();i++){
    for(int j=0;j<t.size();j++){
      if(s[i]==t[j]) chmax(dp[i+1][j+1],dp[i][j]+1);
      chmax(dp[i+1][j+1],dp[i+1][j]);
      chmax(dp[i+1][j+1],dp[i][j+1]);
    }
  }
  /*
  for(int i=0;i<=s.size();i++){
    for(int j=0;j<=t.size();j++){
      cout<<dp[i][j]<<" ";
    }
    cout<<endl;
  }
  */
  int i=s.size();
  int j=t.size();
  string res="";
  while(i>0&&j>0){
    if(dp[i-1][j]==dp[i][j]){
      i--;
    }else if(dp[i][j-1]==dp[i][j]){
      j--;
    }else{
      res=s[i-1]+res;
      i--;
      j--;
    }
  }
  cout << res << endl;
}

Measured memory_bytes: 70784
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <iterator>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
 
#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)c.size())

typedef unsigned long long ull;
const int INF = (int)1e8;


int main(){
	int n;
	while(cin>>n,n){
		vector<Pii> v(n);
		FOR(i,n){
			int id; cin>>id;
			int t = 0;
			FOR(j,4){
				int x,y; cin>>x>>y;
				t += x*60+y;
			}
			v[i].first = t,v[i].second = id;
		}

		int id1 = min_element(v.begin(),v.end()) - v.begin();
		cout << v[id1].second << endl;
		int id1_val = INF;
		swap(v[id1].first,id1_val);
		int id2 = min_element(v.begin(),v.end()) - v.begin();
		cout << v[id2].second << endl;
		swap(v[id1].first,id1_val);

		id1 = max_element(v.begin(),v.end()) - v.begin();
		id1_val = -1;
		swap(v[id1].first,id1_val);
		id2 = max_element(v.begin(),v.end()) - v.begin();
		cout << v[id2].second << endl;
	}

	return 0;
}

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

const int INF = 1e9 + 5;

int main(int argc, char const *argv[])
{
	int n,k;
	cin>>n>>k;
	std::vector<int> v(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>v[i];
	}
	std::vector<int> dp(n,INF);
	dp[0] = 0;
	for (int i = 0; i < n; ++i)
	{
		for (int j=i+1;j<i+k+1;j++)
		{
			if(j<n){
				dp[j] = min(dp[j],dp[i]+abs(v[i]-v[j]));
			}
		}
	}
	cout<<dp[n-1];
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define DEKAI 1000000007
/* ┗(^o^)┛ｗｗｗｗｗ┏(^o^)┓ﾄﾞｺﾄﾞｺﾄﾞｺﾄﾞｺｗｗｗｗｗ */

int gcd(int a,int b){
	if(a<b) swap(a,b);
	while(!b==0){
		int r=a%b;
		a=b;
		b=r;
	}
	return a;
}

int main(){
	int n,x;
	cin>>n>>x;
	queue<int> q;
	lp(i,n){
		int a;
		cin>>a;
		q.push(abs(a-x));
	}
	int ans;
	int hoge=q.front();
	q.pop();
	ans=hoge;
	while(!q.empty()){
		hoge=q.front();
		q.pop();
		ans=gcd(ans,hoge);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

int main() {
	std::string s; cin >> s;
	
	if(s == "ani") printf("square1001\n");
	else printf("e869120\n");
	return 0;
}



Measured memory_bytes: 3152
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {
    
    new Main().run();
  }

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      Graph graph = new Graph(n);
      int[] ajacent;
      String[] vInfo;
      int id,degree;

      for(int i=0,v=0; i<n; i++) {
        vInfo  = br.readLine().split(" ");
        id     = Integer.parseInt(vInfo[0]);
        degree = Integer.parseInt(vInfo[1]);
        ajacent = new int[degree];
        for(int j=0; j<degree; j++) {
          ajacent[j] = graph.convIdToIndex( Integer.parseInt(vInfo[j+2]) );
        }
        graph.setVertex(id, ajacent);
      }

      graph.vertexSearch();

      graph.dispReport();
    }
    catch (IOException e) {
      System.err.println(e);
    }
  }

  class Graph {

    Vertex[] vertices;
    int time;

    public Graph(int size ) {
      vertices  = new Vertex[size];
      time = 0;
    }

    public void setVertex(int id) {
      vertices[id-1] = new Vertex(id);
    }
    public void setVertex(int id, int[] ajacent) {
      setVertex(id);
      setAjacent(id, ajacent);
    }
    public void setAjacent(int id, int[] ajacent) {
      vertices[id-1].ajacent = ajacent;
    }
    public void vertexSearch() {
      for (Vertex v : vertices) {
        if(v.state == Vertex.WHITE)
          depthFirstSearch(v.index);
      }
    }
    public void dispReport() {
      StringBuilder buf = new StringBuilder();

      for (Vertex v : vertices) {
          buf.append(v.id).append(" ")
             .append(v.findTime).append(" ")
             .append(v.doneTime).append("\n");
      }

      System.out.print(buf);
    }
    public int convIdToIndex(int id) {
      return id-1;
    }

    private void depthFirstSearch(int index) {
      vertices[index].state = Vertex.GRAY;
      vertices[index].findTime = ++time;
      
      for(int ajcIndex: vertices[index].ajacent) {
        if(vertices[ajcIndex].state == Vertex.WHITE)
          depthFirstSearch(ajcIndex);
      }
      vertices[index].state = Vertex.BLACK;
      vertices[index].doneTime = ++time;
    }

    class Vertex {

      static final int WHITE = 0;
      static final int GRAY  = 1;
      static final int BLACK = 2;
      int id;
      int index;
      int state;
      int[] ajacent;
      int findTime;
      int doneTime;

      public Vertex(int id) {
        this.id = id;
        index = id-1;
        state = WHITE;
      }
    }
  }
}


Measured memory_bytes: 24192
#include <stdio.h>
int main(void)
{
  int a, b, d, r;
  double f;

  scanf("%d %d",&a,&b);

  d=a/b;
  r=a%b;
  f=(double)a/(double)b;

  printf("%d %d %lf\n",d,r,f);

  return 0;
}

Measured memory_bytes: 636
#include "bits/stdc++.h"

using namespace std;

string s;

int get(char c)
{
	vector <int> pos;

	pos.push_back(-1);
	for (int i = 0; i < s.size(); ++i)
		if (s[i] == c)
			pos.push_back(i);

	pos.push_back(s.size());

	int ans = 0;

	if (pos.size() == 2) return INT_MAX;

	for (int i = 1; i < pos.size(); ++i)
		ans = max(ans, pos[i] - pos[i - 1] - 1);

	return ans;
}

int solve()
{
	int ans = INT_MAX;
	for (char c = 'a'; c <= 'z'; ++c) ans = min(ans, get(c));
	return ans;
}

int main()
{
	cin >> s;
	cout << solve() << '\n';
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int setLength = scanner.nextInt();
		int[] times = new int[setLength];
		int[] xs = new int[setLength];
		int[] ys = new int[setLength];
		for (int i = 0; i < setLength; i++) {
			times[i] = scanner.nextInt();
			xs[i] = scanner.nextInt();
			ys[i] = scanner.nextInt();		
		}
		int x = 0;
		int y = 0;
		int num = 0;
		boolean success = false;
		
		for (int time = 0; time <= times[setLength-1]; time++) {
			if(time > times[num]) {
				success =false;
				break;
			}
			if(x==xs[num] && y==ys[num]) {
				if(time == times[num]) {
					if(num < setLength-1) {
						num++;
					} else {
						success = true;
						break;
					}
				}
				
			}
			if(Math.abs(x-xs[num]) != 0) {
				if(x<xs[num]) {
					x++;
				} else {
					x--;
				}
			} else if(Math.abs(y-ys[num]) != 0) {
				if(y<ys[num]) {
					y++;
				} else {
					y--;
				}
			} else {
				x++;
			}
		}
		if (success) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 90864
import math
A, B, H, M = map(int, input().split())
# 点A（時針の先端）の座標
a = (H*30 + M*0.5 - 90) * (-1)
tena = math.sin(math.radians(a)) * A, math.cos(math.radians(a)) * A
# 点B（時針の先端）の座標
b = (M*6 - 90) * (-1)
tenb = math.sin(math.radians(b)) * B, math.cos(math.radians(b)) * B
D = math.sqrt((tena[0]-tenb[0])**2 + (tena[1]-tenb[1])**2)
print(D)

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

struct Node {
  int key;
  Node *next, *prev;
};

Node *nil;
void init() {
  nil = (Node *)malloc(sizeof(Node));
  nil->next = nil;
  nil->prev = nil;
}

void printList() {
  Node *cur = nil->next;
  int isf = 0;
  while ( 1 ) {
    if ( cur == nil ) break;
    if ( isf++ > 0 ) printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  printf("\n");
}

Node* listSearch(int key) {
  Node *cur = nil->next;
  while ( cur != nil && cur->key != key )
    cur = cur->next;
  return cur;
}

void deleteNode(Node *t) {
  if ( t == nil ) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void deleteFirst() {
  deleteNode(nil->next);
}

void deleteLast() {
  deleteNode(nil->prev);
}

void deleteKey(int key) {
  deleteNode(listSearch(key));
}

void insert(int key) {
  Node *x = (Node *)malloc(sizeof(Node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main() {
  int key, n, i;
  char com[20];
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ) {
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) insert(key);
    else if ( strlen(com) == 6 ) deleteKey(key);
    else if ( com[6] == 'F' ) deleteFirst();
    else deleteLast();
  }

  printList();

  return 0;
}



Measured memory_bytes: 34364
#include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main() {
	int n;
	cin >> n;
	int sum = 0;
	for (int i = 1; i <= n; ++i) {
		if (i % 3 != 0 && i % 5 != 0)
			sum += i;
	}
	cout << sum << "\n";
}


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

int main () {
    char a[10];
    char b[10];
    char c[10];
    scanf("%s %s %s", a, b, c);
    if (a[strlen(a) - 1] == b[0] && b[strlen(b) - 1] == c[0]) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }
}

Measured memory_bytes: 128
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 入力値を数値で返却する
def gets_i()
  gets.chomp.to_i
end
n = gets_i
slist = []
tlist = []

n.times do
  slist.push gets.chomp
end

m = gets_i
m.times do
  tlist.push gets.chomp
end

sh = slist.tally
th = tlist.tally

max = 0
sh.each do |k, v|
  max = [max, v - th[k].to_i].max
end

puts max

Measured memory_bytes: 14496
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000

int main(){
  int *A, *B;
  int C[VMAX+1];
  int n, i, j;

  scanf("%d", &n);

  A = malloc(sizeof(int)*n+1);
  B = malloc(sizeof(int)*n+1);

  /* your code */

  for(i=0;i<=VMAX;i++){
    C[i]=0;
  }

  for(j=1;j<=n;j++){
    scanf("%d",&A[j]);
    C[A[j]]++;
  }

  for(i=1;i<=VMAX;i++){
    C[i]=C[i]+C[i-1];
  }
  for(j=1;j<=n;j++){
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }

  for(i=1;i<=n;i++){
    printf("%d",B[i]);
    if(i!=n)printf(" ");
  }

  printf("\n");
  return 0;
}



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

typedef  long long int ll;
#define ent cout << "\n"
#define pb push_back
#define mp make_pair
#define sz(x) x.size()
#define pair < ll, ll > pp
#define f(a, b) for(auto i = a;i < b;i++)
#define rev_f(a, b) for(auto i = b;i >= a;i--)
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define st(x) sort(x.begin(), x.end()) 
#define rv(x) reverse(x.begin(), x.end()) 
#define cintc() ll tc;while(tc--) 
#define deb(x) cout << x << "\n";
#define cin() ll a; cin >> a;
#define cin2() ll a, b; cin >> a >> b
#define cin3() ll a, b, c; cin >> a >> b >> c
#define cinn(vect, n) def_v vect(n); f(0, n) cin >> vect[i]
#define coutn(vect, n)  f(0, n) {cout << vect[i] << " ";}ent;

typedef vector < ll > def_v;
typedef tuple< ll, ll, ll> def_tuple;
ll mod = 1e9 + 7,cnt = 0;

vector < ll > bfs(vector < ll > graph[], vector < ll > vect, ll start, ll flag, ll n)
{

    ll vis[n + 1] = {0};
    vis[start] = 1;
    queue < ll > q;
    q.push(start);
    while(!q.empty())
    {

        ll start = q.front();
        q.pop();
        auto size = ll(graph[start].size());
        for(ll j = 0;j < size;j++)
        {
            ll x = graph[start][j];
            if(!vis[x])
            {
                vis[x] = 1;
                if(x == 1 && flag == 2)
                {
                    flag = 2;
                }
                else
                    q.push(x);
                vect[x] = flag;
            }
        }
    }

    return vect;
}

void solve()
{   
    ll n, k;
    cin >> n >> k;
    // cout << "Hello\n";
    cinn(vect, n);
    map < ll, ll > hm;
    ll i = 0;
    vector < ll > v;
    vector < ll > v1;
    v.pb(vect[0]);
    hm[1] = vect[0];
    i = vect[i];
    while(hm[i] == 0)
    {
        // cout << vect[i - 1] << " ";
        hm[i] = vect[i - 1];
        v.pb(vect[i - 1]);
        i = vect[i - 1];
    }

    ll save = i;
    while(hm[i] != save)
    {
        v1.pb(hm[i]);
        i = hm[i];
    }

    v1.pb(save);
    if(k <= v.size())
    {
        cout << v[k - 1] << "\n";
    }
    else
    {
        k -= v.size();

        cout << v1[(k - 1)%(v1.size())] << "\n";
    }

    return ;
}
int main()
{
    fastio();
    ll tc = 1;
    // cin >> tc;
    while(tc--)
        solve();
    return 0;
}

Measured memory_bytes: 20576
/*input
100 4 16
*/
#include "bits/stdc++.h"
using namespace std;
int s(int x)
{
	int r=0;
	while(x>0)
	{
		r+=x%10;x/=10;
	}
	return r;
}
int main()
{
	int n , a , b;
	cin>>n>>a>>b;
	int sum=0;
	for(int i=1;i<=n;i++)
	{
		int x=s(i);
		if(x>=a&&x<=b)
			sum+=i;
	}
	cout<<sum<<endl;
}

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

int findSumDigits(int n) {
  int sum=0;
  while(n>0){
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main() {
  int N,A,B;
  cin >> N >> A >> B;
  int total = 0;
  for(int i=1; i<=N; i++){
    int sum = findSumDigits(i);
    if(A <= sum && sum <= B){
      total += i;
    }
  }
  cout << total << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF 1e18
#define INF 1e9
using namespace std;

#define fs first
#define sc second

using P = pair<ll,ll>;
using Pll = pair<P,ll>;
using PQ = priority_queue<P,vector<P>,greater<P>>;


const ll MOD = 1e9+7;
 
template <ll MOD>
struct modint{
    ll x;
    modint() : x(0) {}
    modint(ll a): x((a % MOD + MOD) % MOD) {}
    
    
 
    bool operator!() const{return !x;}
 
    bool operator<(const modint &a) const{
        modint res(*this);
        return res.x < a.x;
    }
    
    bool operator>(const modint &a) const{
        modint res(*this);
        return res.x > a.x;
    }
 
    modint &operator+=(const modint &a){
        if((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
 
    modint &operator-=(const modint &a){
        if((x += MOD - a.x) >= MOD) x -= MOD;
        return *this;
    }
 
    modint &operator*=(const modint &a){
        (x *= a.x) %= MOD;
        return *this;
    }
 
    modint &operator/=(const modint &a){
        *this *= a.inv();
        return *this;
    }
 
    modint &operator%=(const modint &a){
        x %= a.x;
        return *this;
    }
 
    modint operator-() const{ return modint(-x); }
 
    modint operator+(const modint &a) const{ return modint(*this) += a; }
    modint operator-(const modint &a) const{ return modint(*this) -= a; }
    modint operator*(const modint &a) const{ return modint(*this) *= a; }
    modint operator/(const modint &a) const{ return modint(*this) /= a; }
    modint operator%(const modint &a) const{ return modint(*this) %= a; }
    bool operator==(const modint &a) const{ return x == a.x; }
    bool operator!=(const modint &a) const{ return x != a.x; }
 
 
    modint pow(ll n) const{
        modint res(1), a(x);
        while(n > 0){
            if(n & 1) res *= a;
            a *= a;
            n /= 2;
        }
        return res;
    }
 
    modint inv() const{
        return this->pow(MOD-2);
    }
 
    friend ostream &operator<<(ostream &os, const modint &m){
        return os << m.x;
    }
 
    friend istream &operator>>(istream &is, modint &m){
        ll t;
        is >> t;
        m = modint<MOD>(t);
        return (is);
    }
    
    static ll get_mod(){ return MOD; }
};
using mint = modint<MOD>;

signed main(){
    ll x,y;
    cin >> x >> y;
    if((x+y) % 3 != 0){
        cout << 0 << endl;
    }
    else if(2*x >= y){
        ll k = (2*x - y)/3;
        ll n = (x+y)/3;
        mint ans = 1;
        rep(i,1,k+1){
            ans *= n-i+1;
            ans /= i;
        }
        cout << ans << endl;
    }
    else{
        ll k = (2*y - x)/3;
        ll n = (x+y)/3;
        mint ans = 1;
        rep(i,1,k+1){
            ans *= n-i+1;
            ans /= i;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 256
IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_072_A.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 INP    PIC X(21).
    01 X      PIC S9(10).
    01 t      PIC 9(10).
    01 ans    PIC X(10).

    01 tmp    PIC 9(10).

    01 ZS     PIC Z(10)9.
    01 DUMMY  PIC X(1).

PROCEDURE                        DIVISION.
MAIN.
    ACCEPT INP.

    UNSTRING INP
    DELIMITED BY SPACE
    INTO X t.

    SUBTRACT t FROM X.

    IF X < 0 THEN
        MOVE 0 TO tmp
    ELSE
        MOVE X TO tmp
    END-IF.

    MOVE tmp TO ZS
    PERFORM UNANS
    DISPLAY ans(1:FUNCTION STORED-CHAR-LENGTH(ans))

    STOP RUN.

UNANS                            SECTION.
    UNSTRING
        ZS DELIMITED BY ALL SPACE
        INTO DUMMY ans
    END-UNSTRING.


Measured memory_bytes: 764
a, b, c, d = map(int, input().split())

if c < a:
    a, c = c, a

if a <= b and b <= c:
    if b - a <= d and c - b <= d:
        print('Yes')
    else:
        print ('No')
else:
    if c - a <= d:
        print('Yes')
    else:
        print ('No')


Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int a;
int main(){
	cin>>a;
	if(a==19||a==29||a==39||a==49||a==59||a==69||a==79||a==89||a==90||a==91||a==92||a==93||a==94||a==95||a==96||a==97||a==98||a==99)
	cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


Measured memory_bytes: 256
<?php
  $num = intval(fgets(STDIN));
  $AC = 0;
  $WA = 0;
  $TLE = 0;
  $RE = 0;
  for($i = 0;$i < $num;$i++){
    $str = rtrim(fgets(STDIN));
    if($str == "AC"){
      $AC += 1;
    }else if($str == "WA"){
      $WA += 1;  
    }else if($str == "TLE"){
      $TLE += 1;
    }else{
      $RE += 1;
    }
   }
    echo "AC x ".$AC."\n";
    echo "WA x ".$WA."\n";
    echo "TLE x ".$TLE."\n";
    echo "RE x ".$RE;
?>

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

class Program
{
    static void Main(string[] args)
    {
        string[] str = Console.ReadLine().Split(' ');
        char x = char.Parse(str[0]);
        char y = char.Parse(str[1]);
        
        if( x < y){
            Console.WriteLine('<');
        }else if(x > y){
            Console.WriteLine('>');
        }else{
            
        Console.WriteLine('=');
        }
        
    }
}



Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007; // 998244353
using ll = long long;
using namespace std;

int n, wmax;
vector<int> w;
vector<ll> v;

ll memo[110][100010];
bool done[110][100010];

ll f( int k, int g ){
	// cout << "callback: " << k << ", " << g << endl;
	if( g < 0 ) return -inf;
	if( k == -1 ) return 0;
	if( done[k][g] ) return memo[k][g];
	done[k][g] = true;
	ll ans = -inf;
	ans = max( f(k-1, g-w[k])+v[k], f(k-1, g) );
	// cout << "answer: " << k << ", " << g << " -> " << ans << endl;
 	return memo[k][g] = ans;
}

int main(){
	cin >> n >> wmax;
	w.resize(n); v.resize(n);
	for( int i = 0; i < n; ++i ) cin >> w[i] >> v[i];
	cout << f(n-1, wmax) << endl;
}

Measured memory_bytes: 90368
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

if sum(a) < sum(b):
  print(-1)
else:
  c_p=[]
  c_m=[]
  for i in range(len(a)):
    if a[i] > b[i]:
      c_p.append(a[i]-b[i])
    elif a[i] <b[i]:
      c_m.append(a[i]-b[i])
  #print(c_p,c_m)
  sum_c_m = sum(c_m)
  result = len(c_m)
  c_p.sort(reverse=True)
  #print("c_p",c_p)
  index=0
  #print("sum_c_m", sum_c_m)
  while sum_c_m<0:
    sum_c_m += c_p[index]
    index+=1
  result += index
  print(result)

Measured memory_bytes: 18956
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;


int main()
{


int n,m;
cin >> n >> m;
vector <long double> a(n);
int now;
for (int i=0; i<n; i++){ cin >> now; a[i] = (long double)(now+1)/2;}

vector <long double> sum(n); sum[0] = a[0];
for (int i=1; i<m; i++) sum[i] = sum[i-1] + a[i];
for (int i=m; i<n; i++) sum[i] = sum[i-1] + a[i] - a[i-m];

//for (int i=0; i<n; i++) cout << a[i] << "" << "\n"[i!=n-1];
//for (int i=0; i<n; i++) cout << sum[i] << "" << "\n"[i!=n-1];


long double max_sum = 0;
for (int i=m-1; i<n; i++)
       max_sum = max(max_sum,sum[i]);



printf("%Lf",max_sum);// max_sum;

}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
//#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
const int64 INF = 1LL << 58;
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 (a>b) { a=b; return 1; } return 0; }
template<typename T> void remove(T & vector, unsigned int index){vector.erase(vector.begin() + index);}

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

    int a,b; cin>>a>>b;

    if(a+b == 15) cout << "+" << endl;
  	else if(a * b == 15) cout << "*" << endl;
  	else cout << "x"<<endl;
    return 0;
}



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

using namespace std;

void solve()
{
	string str;
	while(cin >> str, str != "0")
	{
		int size = str.size();
		int countA = 0;
		int countB = 0;
		for(int i = 1; i < size; ++i)
		{
			str[i] == 'A' ? countA++ : countB++;
		}
		countA > countB ? countA++ : countB++;
		cout << countA << " " << countB << endl;
	}
}

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

Measured memory_bytes: 0
# include <bits/stdc++.h>
# define sz(x) (int)((x).size())
# define f first 
# define s second
# define pb push_back
# define ub upper_bound
# define lb lower_bound
# define all(x) x.begin(), x.end()
# define rep(i,n) for(int i=0;i<n;++i)
# define forn(i,n) for(int i=1;i<=n;++i)
# define pqueue priority_queue

using namespace std;

template<class T> void umin(T &a,T b){a=min(a,b);}
template<class T> void umax(T &a,T b){a=max(a,b);}

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

const int mod=1e9+7,N=1e6+3;


set<char> pref[N],suf[N];

void solve(){
	int n;
	cin>>n;	
	string s;
	cin>>s;
	int ans=0;
	//int n=sz(s);
	set<char>st;
	for(int i=0;i<n;++i){
		st.insert(s[i]);
		pref[i]=st;
	}
	st.clear();
	for(int i=n-1;i>=0;i--){
		st.insert(s[i]);
		suf[i]=st;
	}
	for(int i=1;i<n;++i){
		int cnt=0;
		for(auto j:pref[i-1]){
			if(suf[i].count(j))cnt++;
		}
		umax(ans,cnt);
	}
	cout<<ans;



}

int main(){
 	ios_base::sync_with_stdio(0);
 	cin.tie(0);cout.tie(0);
	int T=1; 
	//cin>>T;	
	while(T--)solve();
}

Measured memory_bytes: 97508
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    int a[n][3],dp[n][3];
    for(int i=0;i<n;i++)
        cin>>a[i][0]>>a[i][1]>>a[i][2];
    dp[0][0]=a[0][0];dp[0][1]=a[0][1];dp[0][2]=a[0][2];
    for(int i=1;i<n;i++)
    {
        dp[i][0]=a[i][0]+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=a[i][1]+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2]=a[i][2]+max(dp[i-1][0],dp[i-1][1]);
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
    return 0;
}

/*
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
*/


Measured memory_bytes: 2560
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int d = sc.nextInt();
		int n = sc.nextInt();
		sc.close();

		if (d == 0) {
			int cnt = 0;
			for (int i = 1; ; i++) {
				if (i % 100 != 0) {
					cnt++;
					if (cnt == n) {
						System.out.println(i);
						return;
					}
				}
			}
		}
		if (d == 1) {
			int cnt = 0;
			for (int i = 100; ; i+=100) {
				if (i % 10000 != 0) {
					cnt++;
					if (cnt == n) {
						System.out.println(i);
						return;
					}
				}
			}
		}
		if (d == 2) {
			int cnt = 0;
			for (int i = 10000; ; i+=10000) {
				if (i % 1000000 != 0) {
					cnt++;
					if (cnt == n) {
						System.out.println(i);
						return;
					}
				}
			}
		}
	}
}


Measured memory_bytes: 21844
S = input().rstrip()
T = input().rstrip()

s = len(S)
t = len(T)
u = s-t+1

A = []
for i in range(u):
  count = 0
  for j in range(t):
    if T[j] != S[i+j]:
      count += 1
  A.append(count)
print(min(A))


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

int n, m;

int main(){
    while(cin >> n >> m){
        if(n + m == 0)  break;

        int diff[n+1];
        for(int i = 1; i < n+1; i++)    cin >> diff[i];
        int pos = 1;

        int x, ans;
        for(int i = 0; i < m; i++){
            cin >> x;
            pos = pos + x + diff[pos+x];
            if(pos >= n){
                ans = i+1;
                for(int j = i+1; j < m; j++)  cin >> x;
                break;
            }
        }

        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3072
import sys
from collections import defaultdict
N, M = [int(x) for x in sys.stdin.readline().split()]
edges = defaultdict(list)
for i in range(M):
    A, B = [int(x) for x in sys.stdin.readline().split()]
    edges[A].append(B)
    edges[B].append(A)

answer = [None] * (N + 1)
visited = [1]
while True:
    new_visited = []
    for v in visited:
        for w in edges[v]:
            if answer[w] == None:
                answer[w] = v
                new_visited.append(w)
    visited = new_visited
    if not visited:
        break

answer = answer[2:]
if None in answer:
    print("No")
else:
    print("Yes")
    for a in answer:
        print(a)


Measured memory_bytes: 39264
S = input()
K = int(input())
store = []
for i in range(len(S)):
  N = i+1
  while N <= i + 5:
    store.append(S[i:N])
    N += 1
store_set = set(store)
store_list = list(store_set)

List = [ x for x in store_list  if len(x) <= K ]
List.sort()
print(List[K-1])
  

Measured memory_bytes: 5068
k = int(input())
cnt = 0

if k % 2 == 0:
	print(-1)
elif k % 5 == 0:
	print(-1)
else:
	val = 0
	keta = 7
	while True:
		if cnt == 0:
			keta = 7
		else:
			keta = (keta * 10) % k
		val = (val + keta) % k
		
		if val % k == 0:
			break
		else:
			cnt += 1
	print(cnt + 1)


Measured memory_bytes: 9176
L, R = map(int, input().split())
ans = 2018

if R - L >= 2018:
    ans = 0
    print(ans)
else:
    L_dash = L - (L // 2019) * 2019
    R_dash = R - (L // 2019) * 2019
    for i in range(L_dash, R_dash):
        for j in range(i + 1, R_dash + 1):
            ans = min(ans, (i * j) % 2019)
    print(ans)

Measured memory_bytes: 3060
/**
  * @brief atcoder
  * @author yao
  */
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <utility>
#include <algorithm>
#include <functional>
#include <climits>
#include <queue>
#define ft first
#define sd second
#ifdef DBG
#   define dbg_pri(x...) fprintf(stderr,x)
#else
#   define dbg_pri(x...) 0
#   define NDEBUG
#endif //DBG
#include <cassert>

typedef unsigned int uint;
typedef long long int lli;
typedef unsigned long long int ulli;

#define N 262144

std::pair<int,int> a[N], b[N];

lli solve(std::pair<int,int> *p, int n)
{
    lli res = 0;
    std::sort(p,p+n);
    std::priority_queue<int> pq;
    for(int i=0;i<n;++i)
    {
        pq.push(p[i].sd);
        assert(p[i].ft>=0);
        dbg_pri("poi 1: %zd %d %d\n", pq.size(), p[i].ft, p[i].sd);
        while((int)pq.size() > p[i].ft) res += pq.top(), pq.pop();
    }
    dbg_pri("poi 2: %lld\n", res);
    return res;
}

int main()
{
    int T;
    scanf("%d", &T);
    for(int tc=1; tc<=T; ++tc)
    {
        int n, na=0, nb=0;
        lli ans = 0;
        scanf("%d", &n);
        for(int i=0;i<n;++i)
        {
            int k, l, r;
            scanf("%d%d%d", &k,&l,&r);
            if(l<r) b[nb++] = {n-k,l-r}, ans += r;
            else a[na++] = {k,r-l}, ans += l;
        }
        dbg_pri("poi 3: %lld\n", ans);
        ans += solve(a,na);
        ans += solve(b,nb);
        printf("%lld\n", ans);
    }
    return 0;
}


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

#define inf 0x3f3f3f3f
#define pb push_back
#define fi first
#define se second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <ull> vu;
typedef vector <vector <int>> vvi;
typedef pair <int, int> pi;
typedef vector <pair <int, int>> vpi;

string s;

void read() {
  cin >> s;
}

void solve() {
  if (s[0] != 'A') {
    cout << "WA";
    return;
  }
  bool p = 0;
  for(int i = 2; s[i + 1]; ++i) {
    if (s[i] == 'C') {
      if (!p)
        p = 1;
      else {
        cout << "WA";
        return;
      }
    }
    else if (s[i] == 'A' || (s[i] >= 'A' && s[i] <= 'Z')) {
      cout << "WA";
      return;
    }
  }
  if (s[1] >= 'A' && s[1] <= 'Z' || s[s.size() - 1] >= 'A' && s[s.size() - 1] <= 'Z' || !p)
    cout << "WA";
  else cout << "AC";
}

int main() {
  ios :: sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1;
  //cin >> t; //please do not forget to comment this if there are no queries
  while(t) {
    --t;
    read();
    solve();
  }
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

using namespace std; 
const int Max_N(300050);

namespace io
{
	const int SIZE = (1 << 21) + 1;
	char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr;
	#define gc() (iS == iT ? (iT = (iS = ibuf) + fread (ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++)
	inline void flush (){fwrite (obuf, 1, oS - obuf, stdout);oS = obuf;}
	inline void putc (char x){*oS ++ = x;if (oS == oT) flush ();}
	template <class I>
	inline void gi (I &x) {for (f = 1, c = gc(); c < '0' || c > '9'; c = gc()) if (c == '-') f = -1;
		for (x = 0; c <= '9' && c >= '0'; c = gc()) x = x * 10 + (c & 15); x *= f;}
	template <class I>
	inline void print (I x){
		if (!x) putc ('0'); if (x < 0) putc ('-'), x = -x;while(x) qu[++ qr] = x % 10 + '0',  x /= 10;while (qr) putc (qu[qr--]);}
	struct Flusher_ {~Flusher_(){flush();}}io_flusher_;
}
using io::gi;
using io::putc;
using io::print;

int N, A[Max_N], white, black, Pre[Max_N];

bool check(int mid)
{
	int nowmin(0);
	for (int i = 1;i <= N;i += 2)
	{
		if (Pre[i] - nowmin >= mid)
			nowmin = min(nowmin, Pre[i + 1]);
	}
	return Pre[N] - nowmin >= mid;
}

int main()
{
	gi(N);
	for (int i = 1;i <= N;++i)
	{
		gi(A[i]);
		if (i & 1)
			black += A[i], Pre[i] = Pre[i - 1] + A[i];
		else
			white += A[i], Pre[i] = Pre[i - 1] - A[i];
	}
	if ((N & 1) == 0)
		print(max(black, white)), putc(' '), print(min(black, white));
	else
	{
		int l = 0, r = black + 1, mid;
		while (l < r)
		{
			mid = l + ((r - l) >> 1);
			if (check(mid))
				l = mid + 1;
			else
				r = mid;
		}
		print(white + (l - 1)), putc(' '), print(black - (l - 1));
	}
	return 0;
}

Measured memory_bytes: 6400
#include<bits/stdc++.h>
#include<iomanip>
#include<numeric>

using namespace std;
using ll = long long;
constexpr int mo = 1e9+7;
constexpr int  mod = mo;
constexpr int inf = 1<<30;
int main(){
    int n,m;
    cin>>n>>m;
    vector<int> v(n+1);
    
    for(int i=0;i<m;++i){
        int a,b;
        cin>>a>>b;
        v[a]++;
        v[b]++;
    }
    for(int i=1;i<=n;++i)if(v[i]%2){
        cout << "NO" << endl;
        return 0;
    }
    cout << "YES" << endl;
    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0;i < n;i++)
typedef long long ll;

using namespace std;

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

  vector<vector<int> > arr(3, vector<int>(3));
  vector<vector<bool> > card(3, vector<bool>(3));
  int n;

  rep(i,3) {
    rep(j,3) {
      cin >> arr[i][j];
    }
  }
  cin >> n;
  int b[10];
  rep(i, n){
    cin >> b[i];
  }

  rep(i,3) {
    rep(j, 3){
      card[i][j] = false;
      rep(k, n)
      {
        if (b[k] == arr[i][j])
        {
          card[i][j] = true;
        }
      }
    }
  }

  string ans = "No";
  rep(j, 3)
  {
    if (card[0][j] && card[1][j] && card[2][j]) {
      ans = "Yes";
    }
  }

  rep(j,3){
    if (card[j][0] && card[j][1] && card[j][2]){
      ans = "Yes";
    }
  }

  if (card[0][0] && card[1][1] && card[2][2]){
      ans = "Yes";
  } else if (card[0][2] && card[1][1] && card[2][0]){
      ans = "Yes";
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
//=============================================================================
//!	@breif	第１章　コンピュータ入出力　(1)
//-----------------------------------------------------------------------------
#include <stdlib.h>
#include <iostream>
#include <string>
#include <typeinfo>
#include <bitset>

using namespace std;

//=============================================================================
//!	@breif	main関数
//-----------------------------------------------------------------------------
int main()
{
	
	int a, b, c, d;
	cin >> a;
	d = a % 10;
	c = (a % 100) / 10;
	b = (a % 1000) / 100;
	a = a / 1000;

	int num[4] = { a,b,c,d };


	for (int bit = 0;bit < (1 << 3); bit++)
	{
		bitset<4> bit2 = bit;
		int sum = a;
		string hairetu[5] = { "" };
		for (int i=2;i>=0;i--)
		{
			if (bit & (1 << i))
			{
				sum += num[3 - i];
				hairetu[3 - i] = "+";
			}
			else
			{
				sum -= num[3 - i];
				hairetu[3-i] = "-";
			}
		}
		if (sum == 7)
		{
			for (int i = 0; i < 4; i++)
			{
				cout << num[i] << hairetu[i + 1];
			}
			cout << "=7" << endl;
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h> 
#define int long long 
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
using namespace std; 
void fastio()
{
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
signed main()
{
    fastio();
   int n,c=0,z=0,zz=0;
   cin>>n;
   for(int i=1;i<=9;i++)
   {
       for(int j=1;j<=9;j++)
       {
           if(i*j==n)
           {
           c++;
           break;
           }
       }
   }
   if(c)
   cout<<"Yes";
   else
   cout<<"No";
   
}


Measured memory_bytes: 3596