akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
void debug() {cout<<endl;}
template<typename T,typename... Args>
void debug(T x,Args... args) {cout<<x<<" ";debug(args...);}
#define forn(i,a,b) for(int i=a;i<b;++i)
#define pb push_back
#define F first
#define S second
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    
    int n, m = 3;
    cin >> n;
    
    int dp[n][m];
    forn(i, 0, m) {
        cin >> dp[0][i];
    }
    
    forn(i, 1, n) {
        forn(j, 0, m) {
            cin >> dp[i][j];
            int a = dp[i-1][(j+1)%m];
            int b = dp[i-1][(j-1+m)%m];
            dp[i][j] += max(a, b);
        }
    }
    
    int ans = 0;
    forn(i, 0, m) {
        ans = max(ans, dp[n-1][i]);
    }
    cout << ans << endl;
}


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

public class Main {

	static final int x = 1000000007;

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] input = br.readLine().split(" ");

		int n = Integer.parseInt(input[0]);
		int k = Integer.parseInt(input[1]);

		// nCr取得用テーブル
		int height = n - k + 1 > k - 1 ? n - k + 1 : k - 1;
		int width = k;
		long[][] tb = makePscalsTable(height + 1, width + 1);

		for ( int i = 1; i <= k; i++ ) {
			if ( n - k + 1 < i ) {
				System.out.println("0");
				continue;
			}
			// (n-k)個の赤玉の隙間＋両サイド (n-k+1)カ所から青のグループを差し込むiカ所を選ぶ
			long res2 = tb[n - k + 1 - i][i];   //nCr(n - k + 1, i);

			// k個の青ボールをi個のグループ順列に分ける（全グループに最低一つ配る） 
			// → (k-1)カ所の隙間から(i-1)カ所選んで仕切りを差し込む並べ方に等しい
			long res1 = tb[k - 1 - (i - 1)][i - 1];     //nCr(k - 1, i - 1);

			System.out.println((res1 * res2) % x);
		}

		br.close();
	}

	// height*width のテーブルを作る nCr = tb[n-r][r]
	private static long[][] makePscalsTable(int height, int width) {
		long[][] tb = new long[height][width];
		tb[0][0] = 1;

		for ( int row = 0; row < height; row++ ) {
			for ( int col = 0; col < width; col++ ) {
				if ( 0 < col ) tb[row][col] += tb[row][col - 1]; // 左を加算
				if ( 0 < row ) tb[row][col] += tb[row - 1][col]; // 上を加算
				if ( tb[row][col] > x ) tb[row][col] %= x;
			}
		}
		return tb;
	}
}


Measured memory_bytes: 79188
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

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

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll H,W,M;
    cin >> H >> W >> M;
    vl h(M),w(M);
    vl cnt0(H),cnt1(W);
    rep(i,M){
        cin >> h[i] >> w[i];
        h[i]--;w[i]--;
        cnt0[h[i]]++;cnt1[w[i]]++;
    }
    vP p0(H),p1(W);
    rep(i,H){
        p0[i].first=cnt0[i];
        p0[i].second=i;
    }
    rep(i,W){
        p1[i].first=cnt1[i];
        p1[i].second=i;
    }
    sort(p0.begin(),p0.end());sort(p1.begin(),p1.end());
    set<int> seth,setw;
    ll now0=0,now1=0;
    per(i,H-1){
        if(p0[H-1].first==p0[i].first){
            seth.insert(p0[i].second);
            now0++;
        }
    }
    per(i,W-1){
        if(p1[W-1].first==p1[i].first){
            setw.insert(p1[i].second);
            now1++;
        }
    }
    set<P> st;
    rep(i,M){
        if(seth.count(h[i])||setw.count(w[i])){
            st.insert({h[i],w[i]});
        }
    }
    //cout << st.size() << ' ' << now0 << ' ' << now1 << endl;
    //cout << p0[H-1].first << ' ' << p1[W-1].first << endl;
    if(st.size()==p0[H-1].first*now0+p1[W-1].first*now1-now0*now1){
        cout << p0[H-1].first+p1[W-1].first-1 << endl;
    }
    else{
        cout << p0[H-1].first+p1[W-1].first << endl;
    }
}
/*
overflow checked?
corner case checked?
boundary checked?
not TLE in worst case checked?
*/


Measured memory_bytes: 68900
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<numeric>
using namespace std;
#define INF (1 << 30) - 1
#define LINF 1LL << 60
const int MOD = 1000000007;
using ll = long long;
using P = pair<int, int>;

int main(){
  int n, k, c;
  cin >> n >> k >> c;
  string s;
  cin >> s;

  vector<int> can_work;
  for(int i = 0; i < n; ++i){
  	if(s[i] == 'o')can_work.push_back(i);
  }

  vector<P> group(n);
  int start = 1;
  if(s[0] == 'o'){
  	group[0] = {0, 1}; 
  	for(int i = 1; i <= c; ++i){
  		if(i >= n)break;
  		group[i] = group[0];
  	}
  	start += c;
  }
  else group[0] = {-1, 0}; 
  for(int i = start; i < n; ++i){
  	group[i] = group[i - 1];
  	if(s[i] == 'o'){
  		group[i] = {i, group[i].second + 1}; 
  		for(int j = 1; j <= c; ++j){
  			if(i + j >= n)break;
  			group[i + j] = group[i]; 
  		}
  		i += c;
  	}
  }

  vector<P> group2(n);
  int start2 = n - 2;
  if(s[n - 1] == 'o'){
  	group2[n - 1] = {n - 1, 1}; 
  	for(int i = 1; i <= c; ++i){
  		if(n - 1 - i < 0)break;
  		group2[n - 1 - i] = group2[n - 1];
  	}
  	start2 -= c;
  }
  else group2[n - 1] = {-1, 0}; 
  for(int i = start2; i >= 0; --i){
  	group2[i] = group2[i + 1];
  	if(s[i] == 'o'){
  		group2[i] = {i, group2[i].second + 1};
  		for(int j = 1; j <= c; ++j){
  			if(i - j < 0)break;
  			group2[i - j] = group2[i]; 
  		}
  		i -= c;
  	}
  }

  vector<int> ans;
  for(int i = 0; i < can_work.size(); ++i){
  	int j = can_work[i];
  	int id = group[j].first;
  	int id2 = group2[j].first;
  	int cnt = group[j].second + group2[j].second;
  	if(id == j || id2 == j){
  		if(id == j)--cnt;
  		if(id2 == j)--cnt;
  	}
  	else if(id + c > id2)--cnt;
  	if(cnt < k)ans.push_back(j);
  }

  for(int i = 0; i < ans.size(); ++i)cout << ans[i] + 1 << endl;
  return 0;
}


Measured memory_bytes: 6520
#include <stdio.h>

int main()
{
    unsigned int N,M,g;
    scanf("%d %d",&N,&M);
    g=M/N;
     int flag=1;;
     do{
     if(M%g==0)
     {flag=0;}
     g--;
    }while(flag) ;
    printf("%d",g+1);
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int x, d; cin>>x>>d;
	int ct = 0;
	for(int i = 0; i<x; i++){
		ll a, b;
		cin>>a>>b;
		if(abs(a)>d || abs(b)>d) continue;
		ll l = (a-b)*(a-b);
		ll m = 2*a*b;
		ll n = l+m;
		if(sqrt(n)<=d) ct++;
	}
	cout<<ct<<endl;
	return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define lli long long
using namespace std;
lli mod=1e9+7;


lli black[100000+5];
lli white[100000+5];
vector<int>edge[100010];

void dpp(int v,int par)
{
   bool fl=0;
   white[v]=black[v]=1;
   for(int x:edge[v])
   {
     if(x==par)
     continue;
     fl=1;

     dpp(x,v);
     black[v]*=(white[x]);
     if(black[v]>=mod)
     black[v]%=mod;
     white[v]*=(white[x]+black[x]);
     if(white[v]>=mod)
     white[v]%=mod;

   }



}

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

   for(int i=1;i<n;i++)
   {
     int a,b;
     cin>>a>>b;
     edge[a].push_back(b);
     edge[b].push_back(a);
   }
   dpp(1,-1);

   cout <<(white[1]+black[1])%mod;
}






Measured memory_bytes: 12800
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    a, b, c, d = map(int, rl().split())
    for i in range(200):
        if i % 2 == 0:
            c -= b
            if c <= 0:
                print('Yes')
                exit()
        else:
            a -= d
            if a <= 0:
                print('No')
                exit()
    

if __name__ == '__main__':
    solve()

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

int main()
{
  std::string S;
  std::cin >> S;
  
  std::cout << ((S.size() % 2 == 0) ^ (S[0] == S[S.size() - 1]) ? "Second" : "First") << std::endl;
  
  return 0;
}

Measured memory_bytes: 512
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.stream.IntStream;

/**
 * 一時的な汚いコード
 */
public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int x = scanner.nextInt(), y = scanner.nextInt();
			int a = scanner.nextInt(), b = scanner.nextInt(), c = scanner.nextInt();
			Queue<Integer> redQueue = new PriorityQueue<>(Collections.reverseOrder());
			Queue<Integer> greenQueue = new PriorityQueue<>(Collections.reverseOrder());
			Queue<Integer> colorlessQueue = new PriorityQueue<>(Collections.reverseOrder());
			IntStream.range(0, a).forEach(i -> redQueue.add(scanner.nextInt()));
			IntStream.range(0, b).forEach(i -> greenQueue.add(scanner.nextInt()));
			IntStream.range(0, c).forEach(i -> colorlessQueue.add(scanner.nextInt()));
			redQueue.add(0);
			greenQueue.add(0);
			colorlessQueue.add(0);
			int red = 0, green = 0, colorless = 0;
			long answer = 0L;
			while (red + green + colorless < x + y) {
				int redNow = redQueue.peek();
				int greenNow = greenQueue.peek();
				int colorlessNow = colorlessQueue.peek();
				if ((red < x) && (green < y)) {
					if ((redNow >= greenNow) && (redNow >= colorlessNow)) {
						red++;
						answer += redQueue.poll();
					} else if ((greenNow >= redNow) && (greenNow >= colorlessNow)) {
						green++;
						answer += greenQueue.poll();
					} else {
						colorless++;
						answer += colorlessQueue.poll();
					}
				} else if (red == x) {
					// 赤のリンゴをこれ以上食べない
					if (greenNow >= colorlessNow) {
						green++;
						answer += greenQueue.poll();
					} else {
						colorless++;
						answer += colorlessQueue.poll();
					}
				} else {
					// 緑のリンゴをこれ以上食べない
					if (redNow >= colorlessNow) {
						red++;
						answer += redQueue.poll();
					} else {
						colorless++;
						answer += colorlessQueue.poll();
					}
				}
			}
			System.out.println(answer);
		}
	}
}


Measured memory_bytes: 103280
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] suuji=new int[101];
		int[] ruikei=new int[101];
		int a=0;		//入力受付
		int kosu=0;
		int max_atai=0;
		int max_kosu=0;
		while(sc.hasNext()) {
			a=sc.nextInt();
			suuji[a]++;
		}
		for(int i=1; i<101; i++) {
			ruikei[i]=ruikei[i-1]+suuji[i];
			if(suuji[i]>max_kosu) {
				max_kosu=suuji[i];
				max_atai=i;
			}
		}

		for(int i=0; i<101; i++) {
			if(suuji[i]==max_kosu) {
				System.out.println(i);
			}
		}
	}
}


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

int main(){
    int n;
    cin >> n;
    for(int p=0; p < n; p++){
        int h, m;
        scanf("%d:%d", &h,&m);
        double hAngle = (360/12)*h + (360.0/12/60)*m;
        double mAngle = (360/60)*m;
        double angle = min(abs(hAngle-mAngle), abs(mAngle-hAngle));
        if(angle >= 180) angle = 360-angle;
        if(0 <= angle && angle < 30) cout << "alert" << endl;
        else if(90 <= angle && angle <= 180) cout << "safe" << endl;
        else cout << "warning" << endl;
    }
}

Measured memory_bytes: 1236
#include <bits/stdc++.h>
 
#define rep(...) overload_rep(__VA_ARGS__, rep_1, rep_0)(__VA_ARGS__)
#define rep_0(i, end) for(int i = 0; i < (end); ++i)
#define rep_1(i, fr, ba) for(int i = (fr); i <= (ba); ++i)
#define overload_rep(arg0, arg1, arg2, name, ...) name
#define all(box) box.begin(), box.end()
 
template <class T, class U> inline bool chmax(T& lhs, const U& rhs) { if (lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T, class U> inline bool chmin(T& lhs, const U& rhs) { if (lhs > rhs) { lhs = rhs; return 1; } return 0; }

constexpr int inf = (1 << 30) - 1;

int main() {

    int N;
    std::cin >> N;
    std::vector<std::vector<int>> graph(N);
    rep (i, N - 1) {
        int a, b;
        std::cin >> a >> b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    std::function<int(int, int)> dfs = [&] (const int& v, const int& p) {
        int sum = 0, zero_count = 0;
        for (const int& u : graph[v]) {
            if (u == p) continue;
            int tmp = dfs(u, v);
            sum += tmp;
            if (tmp == 0) ++zero_count;
        }
        if (zero_count > 1) sum += zero_count - 1;
        return sum;
    };

    rep (v, N) {
        if (graph[v].size() <= 2) continue;
        std::cout << dfs(v, -1) << '\n';
        return 0;
    }

    puts("1");
    return 0;

}


Measured memory_bytes: 10752
#include <stdio.h>

 #define N 8
 #define FREE 0
 #define NOT_FREE 1

 void putQueen(int);
 void PrintBoard(void);

 int Queen[N][N];
 int dpos[2*N-1];
 int dneg[2*N-1];
 int row[N];
 int col[N];

 int main(){

 int i;
 int n;
 int q_row;
 int q_col;

 scanf("%d",&n);

 for(i=0;i<n;i++){
 scanf("%d%d",&q_row,&q_col);
 Queen[q_row][q_col] = NOT_FREE;
 }

 putQueen(0);

   return 0;
}
void putQueen(int i){

 int j;

 if(i==N){
 PrintBoard();
 return;
 }

 for(j=0;j<N;j++){
 if(col[j]==NOT_FREE || dpos[i+j]==NOT_FREE || dneg[i-j+N-1]==NOT_FREE) continue;

 row[i] = j;
 col[j] = dpos[i+j] = dneg[i-j+N-1] = NOT_FREE;
 putQueen(i+1);

 col[j] = dpos[i+j] = dneg[i-j+N-1] = FREE;
 }

}
void PrintBoard(void){

 int i;
 int j;

 for(i=0;i<N;i++){
  for(j=0;j<N;j++){

 if(Queen[i][j]==NOT_FREE){
    if(row[i]!=j) return;
    }

   }
  }

 for(i=0;i<N;i++){
  for(j=0;j<N;j++){

 if(row[i]==j){
  printf("Q");
   }

 else{
  printf(".");
   }

   }
  printf("\n");
   }
 }

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

#define ll long long int
#define str string

ll MOD = 1000000007,INFL = 1ll << 60,INF = 1 << 30;
pair <ll, ll> A[10000000] = {}, X[1000000] = {};
int dy[]={0, 0, 1, -1},dx[]={1, -1, 0, 0};
vector <ll> v;
ll a = 0,m = 0,c = 0,n = 0,sum = 0, max = INF;
str S;
int ans = 0;

int findDigits(int n) {
        int i = 0;
        while (n > 0) {

                sum += n%10;
                n /= 10;
                i++;
        }
        return i;
}


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

cin >> S;
for(int i = 0;i < S.size();i++){
  if(S[i]== 'A' || S[i]== 'T'|| S[i]== 'G' || S[i]== 'C'){
    ans++;
    if(a < ans)a = ans;
  }
  else {
    if(a < ans)a = ans;
    ans = 0;
  }
}
cout << a << endl;
  //Code Line
        return 0;
}


Measured memory_bytes: 172160
s = input()
ans = "AC"

if s[0] != 'A':
    ans = "WA"
if s[2:-1].count('C') != 1:
    ans = "WA"
cnt = 0
for c in s[1:]:
    if c.isupper():
        cnt += 1
if cnt != 1:
    ans = "WA"
print(ans)


Measured memory_bytes: 3060
#!/usr/bin/env python3
import math
x = int(input())
while True:
    key=1
    for k in range(2, int(math.sqrt(x)) + 1):
        if x % k == 0:
            key=0
    if key==1:
        print(x)
        exit()
    else:
        x += 1
print(x)

Measured memory_bytes: 9028
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define rep3(i, s, n) for (int i = s; i > (int)(n); i--)
#define all(obj) obj.begin(), obj.end()
#define db(x) cerr << #x << ":" << x << " "
#define dbl(x) cerr << #x << ":" << x << "\n"
#define dbv(vec) cerr << #vec << ":"; for (auto e : vec) cerr << e << " "; cout << "\n"
#define dbvv(vv) cerr << #vv << ":\n"; for (auto vec : vv) { for (auto e : vec) cerr << e << " "; cerr << "\n"; }
#define dbm(map) cerr << #map << ":"; for (auto p : map) cerr << "(" << p.first << ", " << p.second << "), "; cerr << "\n";
#define YN(f) cout << (f ? "YES" : "NO") << "\n"
#define Yn(f) cout << (f ? "Yes" : "No") << "\n"
#define yn(f) cout << (f ? "yes" : "no") << "\n"
using ll = long long;
using vi = vector<int>; using vl = vector<ll>; using vs = vector<string>; using vb = vector<bool>;
using vvi = vector<vi>; using vvl = vector<vl>; using vvb = vector<vb>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using vpii = vector<pii>; using vpll = vector<pll>;
using ti3 = tuple<int, int, int>; using tl3 = tuple<ll, ll, ll>;
using mii = map<int, int>; using mil = map<int, ll>; using mli = map<ll, int>; using mll = map<ll, ll>;

int main() {
	int H, W; cin >> H >> W;
	vector<vector<bool>> g(H + 2, vector<bool>(W + 2));
	rep2(i, 1, H + 1) {
		string A; cin >> A;
		rep2(j, 1, W + 1) g[i][j] = A[j - 1] == '#'; // 黒#がtrue		
	}
	// dbvv(g);
	vector<vector<int>> d(H + 2, vector<int>(W + 2, -1));
	queue<pii> q;
	rep2(i, 1, H + 1) rep2(j, 1, W + 1) if (g[i][j]) {
		pii p(i, j); q.push(p); d[i][j] = 0;
	}
	while (!q.empty()) {
		int i, j; tie(i, j) = q.front(); q.pop();
		vi di = { 1, 0, -1, 0 }, dj = { 0, 1, 0, -1 };
		rep(k, 4) {
			int ni = i + di[k], nj = j + dj[k];
			if (ni <= 0 or ni > H or nj <= 0 or nj > W) continue;
			if (d[ni][nj] != -1) continue;
			// db(ni); dbl(nj);
			d[ni][nj] = d[i][j] + 1;
			pii p(ni, nj); q.push(p);
		}
		// dbvv(d);
	}
	int ans = 0;
	rep2(i, 1, H + 1) rep2(j, 1, W + 1) ans = max(ans, d[i][j]);
	cout << ans << endl;	
}

Measured memory_bytes: 12560
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <climits>

using namespace std;
#define forn(x, n)         for (int x = 0; x < n; x++)
#define forr(x, n)         for (int x = n; x >= 0; x--)
#define for1(x, n)         for (int x = 1; x < n; x++)
#define fore(x, a, b, c)   for (int x = a; x <= b; x += c)
#define all(container)     (container).begin(), container.end()
#define rall(container)    (container).rbegin(), container.rend()
#define sz(container)      (int) (container).size()
#define pb                 push_back
#define eb                 emplace_back
#define fi                 first
#define sc                 second

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#ifdef LOCAL_DEFINE
    #include "DEBUG.hpp"
#else
    #define eprint(...) 0
#endif
template<class T> bool smin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool smax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int N = 200010;
ll arr[N];

int main(void)
{
    int n;
    scanf("%d", &n);
    forn(i, n) scanf("%lld", &arr[i]);
    sort(arr, arr + n);
    reverse(arr, arr + n);
    ll ans = 0;
    ans += arr[0];
    int tot = n - 2;
    int pos = 1;
    while (tot > 0) {
        if (tot >= 2) ans += 2 * arr[pos++], tot -= 2;
        else ans += tot * arr[pos++], tot = 0;        
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 5376
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

char ss[25000][6];

int compare_s(const void*a, const void*b){
    int* A = (int*)a;
    int* B = (int*)b;
    return strcmp(ss[*A], ss[*B]);
}

int main(void){
    char s[5001];
    int k;
    scanf("%s", s);
    scanf("%d", &k);

    char *ps;
    int ls = strlen(s);

    int index = 0;
    for(int h = 1; h <= 5; h++){
        ps = s;
        for(int i = 0; i < ls-h+1; i++){
            strncpy(ss[index], ps, h);
            ss[index][h] = '\0';
            ps++;
            index++;
        }
    }
        
    int num[25000];
    for(int i = 0; i < index; i++){num[i] = i;}
    
    qsort(num, index, sizeof(int), compare_s);
    
    char tmp[6];
    strcpy(tmp, ss[num[0]]);
  
    // int cnt = 1;
    // if(index == 1){printf("%s\n", tmp); return 0;}
    
    // for(int i = 0; i < index-1; i++){
    //     if(strcmp(tmp, ss[num[i+1]])==0){
    //         continue;
    //     }else{
    //         cnt++;
    //         strcpy(tmp, ss[num[i+1]]);
    //     }
    //     if(cnt == k){printf("%s\n", ss[num[i+1]]); return 0;}
    // }
    
    //ACされてる方のをコピー
    int count=0;
	for(int i=0;i<index;i++){
		if(count==k-1){
			printf("%s\n",ss[num[i]]);
			return 0;
		}
		if(strcmp(ss[num[i]],ss[num[i+1]])<0)count++;
	}
}



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

int main()
{
int h,a;
cin>>h>>a;

int sum=0;
for(int index=0;index<a;index++)
{
    int c;
    cin>>c;
    sum+=c;
}
if(sum>=h)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
   
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES // M_PI
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define rREP(i,a,n) for(int (i)=(n)-1; (i)>=(a);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 2147483647;
constexpr ll mod = 1000000007;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int k, x; cin >> k >> x;
	x -= k - 1;
	k *= 2;
	rep(i, k - 1) {
		cout << x + i << (i == k - 1 ? "\n" : " ");
	}

	return 0;
}

Measured memory_bytes: 256
using System;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(ReadLine());

        var t = new int[n];
        var x = new int[n];
        var y = new int[n];

        for (int i = 0; i < n; i++)
        {
            var strArr = ReadLine().Split();
            t[i] = int.Parse(strArr[0]);
            x[i] = int.Parse(strArr[1]); 
            y[i] = int.Parse(strArr[2]);
        }

        var time = 0;
        var posx = 0;
        var posy = 0;

        for (int i = 0; i < n ; i++)
        {
            var stx = Math.Abs(posx - x[i]);
            var sty = Math.Abs(posy - y[i]);
            if ((t[i] - time - stx - sty) % 2 == 0 && t[i] - time >= stx + sty)
            {
                time = t[i];
                posx = x[i];
                posy = y[i];
            }
            else
            {
                WriteLine("No");
                return;
            }          
        }

        WriteLine("Yes");
    }
}


Measured memory_bytes: 14152
#include <bits/stdc++.h>
#include <algorithm>
#include <stdio.h>
#include <math.h>
using namespace std;

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> PP;

struct edge {
	int to, cost;
	edge(int t,int c):to(t),cost(c) {}
};

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

ll mypow(ll x,ll n,ll m) {	//xのn乗をmで割った余り
	if(n==0) return 1;
	if(n%2==0) return mypow(x*x%m,n/2,m);
	else return x*mypow(x,n-1,m)%m;
}

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

string s,t;
int A[100001],B[100001];
int q,a,b,c,d;

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

	cin>>s>>t;
	REP(i,s.size()) A[i+1]=A[i]+(s[i]=='A'?1:2);
	REP(i,t.size()) B[i+1]=B[i]+(t[i]=='A'?1:2);
	cin>>q;
	REP(i,q) {
		cin>>a>>b>>c>>d;
		int x=A[b]-A[a-1],y=B[d]-B[c-1];
		if((x%3)==(y%3)) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}

	return 0;
}


Measured memory_bytes: 1744
#include <cstdio>

using namespace std;

int main()
{
	int h, w;
	char str[100][100];
	
	while (scanf("%d %d", &h, &w), !(h == 0 && w == 0)){
		bool flag = true;
		
		for (int i = 0; i < h; i++){
			scanf("%s", str[i]);
		}
		int x = 0, y = 0;
		while (str[y][x] != '.'){
			
			if (str[y][x] == 'l'){
				flag = false;
				break;
			}
			if (str[y][x] == '>'){
				str[y][x] = 'l';
				x++;
			}
			else if (str[y][x] == '<'){
				str[y][x] = 'l';
				x--;
			}
			else if (str[y][x] == '^'){
				str[y][x] = 'l';
				y--;
			}
			else if (str[y][x] == 'v'){
				str[y][x] = 'l';
				y++;
			}
		}
		if (flag){
			printf("%d %d\n", x, y);
		}
		else {
			printf("LOOP\n");
		}
	}
}

Measured memory_bytes: 1052
#include <cstdio>
#include <deque>
using namespace std;
#define min(a,b) (((a)<=(b))?(a):(b))
deque<int> Q;
void solve(int n,int m) {
	if(n==0) {
		for(int i=0;i<Q.size()-1;i++) printf("%d ",Q[i]);
		printf("%d\n",Q[Q.size()-1]);
	}else {
		for(int i=min(n,m);i>=1;i--) {
			Q.push_back(i);
			solve(n-i,i);
			Q.pop_back();
		}
	}
}
int main() {
	int n;
	while(scanf("%d",&n),n) solve(n,n);
}

Measured memory_bytes: 1036
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define call(var) cout<<#var<<"="<<var<<endl;
#define dup(x,y) (((x)+(y)-1)/(y))
using ll=long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;
const int INTMAX = 2147483647;
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

int main(){
    int n,m;cin >> n >> m;
    vi a(n);
    rep(i,n) cin >> a[i];
    int sum = accumulate(a.begin(),a.end(),0);
    int cnt = 0;
    rep(i,n){
        if(4*m*a[i] >= sum) ++cnt;
    }
    if(cnt>= m) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    // Find max volume
    int L;
    cin >> L;
    // Of sum(3) values == L
    // By geometry
    // (l1 * l2 * l3) ^ 1/3 <= l1 + l2 + l3 / 3
    // So l1*l2*l3 <= (l1+l2+l3/3)^3
    printf("%.12f\n", (double)L * L * L / 27);
    return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
		
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		
		int N = sc.nextInt();
		char[] S = sc.next().toCharArray();
		String ans = "";
		
		int numOpen = 0;
		for(int i = 0; i < S.length; i++){
			if(S[i] == '(') numOpen++;
			else numOpen--;
			
			if(S[i] == ')'){
				if(numOpen < 0){
					ans = "(" + ans;
					ans += ")";
					numOpen++;
				}else{
					ans += ')';
				}
			}else{
				ans += '(';
			}
		}
		
		while(numOpen > 0){
			ans += ")";
			numOpen--;
		}
		
		System.out.println(ans);
		/*
		if(ans.equals(sc.next())) System.out.println("true");
		else System.out.println("false");
		*/
		
	}//end main
	
}//end Main

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}


Measured memory_bytes: 22996
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;

namespace M_SOLUTIONS
{
    class Program
    {
        static public int[] Sarray() { return ReadLine().Split().Select(int.Parse).ToArray(); }
        static public List<int> Slist() { return ReadLine().Split().Select(int.Parse).ToList(); }
        static void Main(string[] args)
        {
            var n = Sarray()[0];
            var grf = new Graph(n);
        }
        public class Graph
        {
            List<int>[] graph;
            int[] v;
            class edgenum
            {
                public int V { get; }//頂点
                public int N { get; set; }//枝の数
                public edgenum(int v, int n) { V = v;N = n; }
            }
            public Graph(int n)//無向グラフ
            {
                graph = new List<int>[n];
                for (int i = 0; i < n; ++i)
                    graph[i] = new List<int>();
                v = new int[n];

                //入力方式に従って適当に
                for (int i = 0; i < n-1; ++i)
                {
                    var info = Sarray();//ai, bi
                    var ai = info[0]-1;
                    var bi = info[1]-1;
                    graph[ai].Add(bi);
                    graph[bi].Add(ai);
                }
                val = new int[n];
                ci = Slist();
                ci.Sort((l, r) => r - l);

                dfs(0);
                WriteLine(ci.Sum() - ci[0]);
                StringBuilder str = new StringBuilder();
                for(var i=0;i<n;++i)
                {
                    str.Append($"{val[i].ToString()} ");
                }
                WriteLine(str.ToString().Trim());
            }
            int[] val;
            List<int> ci;
            int cnt = 0;

            public void dfs(int next)
            {
                if (0 != v[next]) return;
                v[next] = 1;
                val[next] = ci[cnt++];
                foreach (var e in graph[next])
                {
                    dfs(e);
                }
            }
        }
    }
}


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

int main() {

    std::string s, p;

    std::cin >> s >> p;

    s += s;

    int c = 0;

    for ( int i = 0; i < s.size(); i++ ) {

        if ( s.substr(i, p.size()) == p ) c++;
    }

    c > 0 ? std::cout << "Yes" << std::endl
          : std::cout <<  "No" << std::endl ;

    return 0;
}



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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

ll MOD = 998244353;
ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        res %= MOD;
        a = a * a;
        a %= MOD;
        b >>= 1;
    }
    return res;
}


int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll A, B; cin >> A >> B;
	ll C, D; cin >> C >> D;

	vector<vll> dp (C+1, vll (D+1));
	F0R(r, C+1) {
		F0R(c, D+1) {
			if (r < A || c < B) dp[r][c] = 0;
			else if (r == A && c == B) dp[r][c] = 1;
			else if (r == A) dp[r][c] = r * dp[r][c-1];
			else if (c == B) dp[r][c] = c * dp[r-1][c];
			else {
				dp[r][c] = c * dp[r-1][c] % MOD + r * dp[r][c-1] % MOD - (r-1) * (c-1) * dp[r-1][c-1] % MOD;
			}
			dp[r][c] = (dp[r][c] % MOD + MOD) % MOD;
		}
	}
	print(dp[C][D]);
}

Measured memory_bytes: 73676
N, K = input().split()

arr = []

for i in range(int(K)):
    input()
    arr.append(list(input().split()))


snuk = [0] * int(N)

for di in arr:
    for i in di:
        snuk[int(i)-1] = 1


num = 0


for i in snuk:
    if i == 0:
        num = num+1

print(num)


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

int main() {
  int N, M;
  map<string, int> mp;
  cin >> N;
  rep(i,N) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cin >> M;
  rep(i,M) {
    string s;
    cin >> s;
    mp[s]--;
  }
  int mx = 0;
    for(auto p : mp) mx = max(mx, p.second);
    cout << mx << endl;
  return 0;
}

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

using namespace std;

typedef long long ll;

int main()
{
  int n;
  scanf("%d",&n);
  int res=1;
  int tp=0;
  while(res<=n)
  {
    tp=res;
    res*=2;
  }
  cout<<tp<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans = LLONG_MAX;
vector<ll> vp;
void exgcd(ll a, ll &x, ll b, ll&y, ll&g)
{
    if (b) {
        exgcd(b, y, a % b, x, g);
        y -= a/b*x;
    } else {
        x = 1;
        y = 0;
        g = a;
    }
}
void solve(ll a, ll b)
{
    ll x0, y0, g;
    exgcd(a, x0, b, y0, g);
    ll t = 2 - a * x0;
    if (t < 0)
        t /= a * b;
    else
        t = (t + a * b - 1) / (a * b);
    ll x = x0 + t * b;
    ll k = x * a - 1;
    assert(k > 0);
    //cerr << "a, b, k " << a << ' ' << b << ' ' << k << endl;
    ans = min(ans, k);
}
void dfs(int i, ll a = 1, ll b = 1)
{
    if (i == vp.size()) {
        solve(a, b);
        return;
    }
    dfs(i + 1, a * vp[i], b);
    dfs(i + 1, a, b * vp[i]);
}
int main()
{
    ll n;
    cin >> n;
    if (n == 1) {
        cout << "1\n";
        return 0;
    }
    for (ll i = 2; i * i <= n; ++i) {
        ll p = 1;
        while (n % i == 0) {
            n /= i;
            p *= i;
        }
        if (p > 1) {
            vp.emplace_back(p * (p % 2 == 0 ? 2 : 1));
        }
    }
    if (n > 1)
        vp.emplace_back(n);
    dfs(0);
    cout << ans << endl;
}


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

const int mod = 1000000007;

int dp[100005][40];
map < int, int > mp;
int main()
{
	int N, M;
	

	dp[0][0] = 1;

	cin >> N >> M;

	for ( int i = 1; i < 100005; i++ ) {
		for ( int j = 0; j < 40; j++ ) {
			dp[i][j] = dp[i - 1][j];
			if ( j > 0 ) (dp[i][j] += dp[i][j - 1]) %= mod;
		}
	}


	for ( int i = 2; i * i <= M; i++ ) {
		while ( M % i == 0 ) {
			mp[i]++;
			M /= i;
		}
	}
	if ( M != 1 ) mp[M]++;

	int ans = 1;
	for ( auto &x : mp ) {
		ans = ((long long)ans * dp[N][x.second]) % mod;
	}

	cout << ans << endl;

	return ( 0 );
}


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

using namespace std;

constexpr long long INF64 = 1e18;

using Weight=long long;

struct Edge{
    int src,dst;
    Weight weight;
    Edge(int src,int dst,Weight weight):
    src(src),dst(dst),weight(weight){}
};

auto operator < (const Edge &e,const Edge &f){
    if(e.weight!=f.weight)return e.weight>f.weight;
    else if(e.src!=f.src)return e.src<f.src;
    else return e.dst<f.dst;
}

using Edges=vector<Edge>;
using Graph=vector<Edges>;
//??????????????????
bool BellmanFord(const Graph &g,int s,vector<Weight>&dist,vector<int>&prev){
    const int V=g.size();
    bool negative_cycle=false;
    for(int i=0;i<V;++i){
        for(int j=0;j<V;++j){
            for(auto e:g[j]){
                if(dist[e.src]!=INF64 && dist[e.dst]>dist[e.src]+e.weight){
                    dist[e.dst]=dist[e.src]+e.weight;
                    prev[e.dst]=e.src;
                    if(i==V-1){
                        dist[e.dst]=-INF64;
                        negative_cycle=true;
                    }
                }
            }
        }
    }
    return negative_cycle;
}

int main(){
    cin.sync_with_stdio(false);
    int V,E,r;
    cin>>V>>E>>r;
    Graph g(V);
    for(int i=0;i<E;++i){
        int s,t,d;
        cin>>s>>t>>d;
        g[s].emplace_back(s,t,d);
    }
    vector<Weight>dist(V,INF64);//???????????§????????¢?????\???
    dist[r]=0;
    vector<int>prev(V,-1);//????????????????????\???
    if(BellmanFord(g,r,dist,prev)){
        cout<<"NEGATIVE CYCLE"<<endl;
    }else{
        for(int i=0;i<V;++i){
            if(dist[i]==INF64)cout<<"INF"<<endl;
            else cout<<dist[i]<<endl;
        }
    }
}

Measured memory_bytes: 3236
#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
  
  int k, x;
  cin>>k>>x;
  
  k--;
  
  for(int i=x-k;i<=x+k;i++){
    if( i != x-k ) cout<<' ';
    cout<<i;
  }
  
  cout<<endl;
  
  return 0;
}


Measured memory_bytes: 256
import math

def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, = read_line(int)

A = [int(x) for x in input().split()]

AA = [a - (i + 1) for i, a in enumerate(A)]

AA.sort()

if len(AA) % 2 == 0:
    b = int(len(AA) / 2 - 1)
else:
    b = int((len(AA) - 1) / 2)

sadness = 0
for i, a in enumerate(A):
    # sadness1 += abs(a - (i + b1 + 1))
    # sadness2 += abs(a - (i + b2 + 1))
    sadness += abs(a - (i + AA[b] + 1))

print(sadness)


Measured memory_bytes: 26608
#include <stdio.h>

int info[4][3][10];

int main( void )
{
	int i, j, k, x, tou, kai, heya, num;
	
	scanf("%d", &x);
	
	for(i = 0; i < x; i++){
		scanf("%d %d %d %d", &tou, &kai, &heya, &num);
		
		info[tou-1][kai-1][heya-1] += num;
	}
	
	for(i = 0; i < 4; i++){
		for(j = 0; j < 3; j++){
			for(k = 0; k < 10; k++){
				printf(" %d", info[i][j][k]);
			}
			printf("\n");
		}
		if(i < 3){
			printf("####################\n");
		}
	}

	return 0;
}

Measured memory_bytes: 612
i = input()

acc = 0
for j in range(len(i)//2):
  acc+=9*(10**(2*j))

if len(i)%2==0:
  print(acc)
else:

  addition = (int(i[0])-1)*10**(len(i)-1)+1
  if len(i)>1:
    addition += int(i[1:])
  print(acc+addition)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Main2 cc = new Main2();
        cc.yesNo();
    }
}

class Main2{
    public void yesNo(){
        Scanner scan = new Scanner(System.in);
        int[] abc = new int[3];
        for(int i=0; i < 3; i++){
            abc[i] = scan.nextInt();
        }
        if(abc[0] < abc[1] && abc[1] < abc[2]){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}



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

int N, C, s[100009], t[100009], c[100009], p[32][100009], I[100009];

int main() {
	cin >> N >> C;
	for (int i = 1; i <= N; i++) {
		cin >> s[i] >> t[i] >> c[i];
		for (int j = s[i]; j < t[i]; j++) p[c[i]][j] = 1;
	}
	for (int i = 1; i <= C; i++) {
		for (int j = 0; j <= 100000; j++) {
			if (p[i][j] == 1 || p[i][j + 1] == 1) I[j]++;
		}
	}
	int maxn = 0;
	for (int i = 0; i <= 100000; i++) maxn = max(maxn, I[i]);
	cout << maxn << endl;
	return 0;
}

Measured memory_bytes: 13568
L,x[1<<17];d[21][1<<17];i,k,l,r,m;
main(n){
	for(scanf("%d",&n);i<n;)scanf("%d",++i+x);
	for(scanf("%d%*d",&L);k<20;k++)for(i=0;i++<n;d[k+1][i]=l)
		for(l=d[k][d[k][i]],r=n+1;k<2&r-l>1;)x[m=l+r>>1]>x[i]+L?r=m:(l=m);
	for(;~scanf("%d%d",&l,&r);printf("%d\n",m))
		for(m=l<r||(l^=r^=l^=r),k=21;--k;)d[k][l]<r?m+=1<<k-1,l=d[k][l]:0;
}

Measured memory_bytes: 10880
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#define INF 1000000000
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<int,int,int>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
ll h,w,ans=0;
string s[22];
void bfs(int sx,int sy){
  ll field[22][22];
  ll vx[]={1,0,-1,0},vy[]={0,1,0,-1};
  fill(field[0],field[22],INF);
  priority_queue<TP,vector<TP>,greater<TP>> que;
  que.push(make_tuple(0,sx,sy));
  field[sx][sy] = 0;
  while(!que.empty()){
    auto tmp = que.top();
    que.pop();
    ll d = get<0>(tmp);
    ll x = get<1>(tmp);
    ll y = get<2>(tmp);
    d++;
    for(int i=0;i<4;i++){
      ll nx = x + vx[i];
      ll ny = y + vy[i];
      if(nx>=0&&ny>=0&&nx<h&&ny<w&&s[nx][ny]=='.'){
        if(field[nx][ny]>d){
          field[nx][ny] = d;
          que.push(make_tuple(d,nx,ny));
        }
      }
    }
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]!='#'){
        ans = max(ans,field[i][j]);
      }
    }
  }
}
signed main(){
  init_io();
  cin >> h >> w;
  for(int i=0;i<h;i++){
    cin >> s[i];
  }
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(s[i][j]!='#'){
        bfs(i,j);
      }
    }
  }
  cout << ans << endl;
}


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

int main() {
int n;
cin >>n;
vector<int> a(n);
int che =0;
int aa =0;
for(int i=0;i<n;i++){
    cin >> a.at(i);
    che =max(che,a.at(i));
    aa+=a.at(i);
}
aa-=che;
if(che<aa){
    cout <<"Yes"<<endl;
}
else{
    cout <<"No"<<endl;
}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B;
  string s;
  cin >> A >> s >> B;
  
  if (s == "+") {
    cout << A + B << endl;
  }
  else if (s == "-") {
    cout << A - B << endl;
  }
}

Measured memory_bytes: 256
// AOJ 0370: Age Difference
// 2017.11.14 bal4u@uu

#include <stdio.h>

int main()
{
	int y1, m1, d1, y2, m2, d2, x, f;

	scanf("%d%d%d%d%d%d", &y1, &m1, &d1, &y2, &m2, &d2);
	if (y1 > y2) {
		x = y1, y1 = y2, y2 = x;
		x = m1, m1 = m2, m2 = x;
		x = d1, d1 = d2, d2 = x;
	}
	f = 0;
	if (m1 < m2 || m1 == m2 && d1 < d2) f = 1;
	if (y1 == y2 && (m1 != m2 || d1 != d2)) f = 1;
	printf("%d\n", y2-y1+f);
	return 0;
}

Measured memory_bytes: 1796
#include <bits/stdc++.h>
#define REP(i, a, b) for (int i = a; i <= b; ++i)
#define PER(i, a, b) for (int i = a; i >= b; --i)
#define RVC(i, S) for (int i = 0; i < S.size(); ++i)
#define mp make_pair
#define pb push_back
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define fi first
#define se second
using namespace std;
 
typedef long long LL;
typedef pair<int, int> pii;
typedef vector<int> VI;

int n, ai[100005];
int main(){
	scanf("%d", &n);
	REP(i, 1, n) scanf("%d", &ai[i]);
	int ans = 0;
	REP(i, 1, n){
		if (ai[i] != i) continue;
		int j = i;
		while (j <= n && ai[j] == j) ++j;
		int t = j - i;
		ans += t / 2 + t % 2;
		i = j - 1;
	}
	printf("%d\n", ans);
	return 0;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  ll x = 100;
  ll t; cin >> t;
  int ans = 0;
  while(x < t){
    x = x * 1.01;
    ans++;    
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <ctype.h>

using namespace std;

#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)

int main()
{
    string W, T;
    int cnt, l;
    cin >> W;
    cnt = 0;
    l = W.size();
    REP(i,l) if (isupper(W[i])) W[i] = tolower(W[i]);
    while(cin >> T) {
        if (T == "END_OF_TEXT") break;
        REP(i,l) if (isupper(T[i])) T[i] = tolower(T[i]);
        if (W == T) ++cnt;
    }
    cout << cnt << endl;
    return 0;
}



Measured memory_bytes: 3192
a, b, c, d = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
while True:
    c = c - b
    if c <= 0:
        print("Yes")
        break
    a = a - d
    if a<=0:
        print("No")
        break

Measured memory_bytes: 9176
using System;

public class hello
{
    public static void Main()
    {
        while (true)
        {
            var n = int.Parse(Console.ReadLine().Trim());
            if (n == 0) break;
            var p = int.Parse(Console.ReadLine().Trim());
            var a = new int[p - 1, 2];
            readData(a, p - 1);
            var q = 1;
            while (q <= n)
            {
                var r = int.Parse(Console.ReadLine().Trim());
                var b = new int[r - 1, 2];
                readData(b, r - 1);
                if (check(a, b)) Console.WriteLine(q );
                q++;
            }
            Console.WriteLine("+++++");
        }
    }
    static bool  check ( int[,] a, int [,] b)
    {
        var aL = a.GetLength(0);
        if (aL != b.GetLength(0)) return false;
        var dif = b[0, 0] - a[0, 0];
        var cf1 = true;
        for (int i = 0; i < aL; i++)
        {
            var t = b[i, 0] - dif;
            if (t < 0) t += 4;
            if (t > 3) t -= 4;
            if (a[i, 0] != t | a[i, 1] != b[i, 1]) cf1 = false;
        }
        if (cf1) return true;
         dif = b[aL -1, 0] - a[0, 0];
        for (int i = 0; i < aL; i++)
        {
            var t = b[aL -1 -i, 0] - dif;
            if (t < 0) t += 4;
            if (t > 3) t -= 4;
            if (a[i, 0] != t | a[i, 1] != b[aL - 1 - i, 1]) return false;
        }
        return true;
    }
    static void readData(int[,] a, int n)
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var prex = int.Parse(line[0]);
        var prey = int.Parse(line[1]);
        for (int i = 0; i < n; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            var x = int.Parse(line[0]);
            var y = int.Parse(line[1]);
            if (x - prex > 0) { a[i, 0] = 0; a[i, 1] = x - prex; }
            else if (x - prex < 0) { a[i, 0] = 2; a[i, 1] = -x + prex; }
            else if (y - prey > 0) { a[i, 0] = 1; a[i, 1] = y - prey; }
            else { a[i, 0] = 3; a[i, 1] = -y + prey; }
            prex = x;
            prey = y;
        }
    }
}




Measured memory_bytes: 15916