akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {

    int  a , b ,i , j ,s = 0;
    cin >> a >>b;
    vector<int> taste(a,0);
    vector<int>sub(a,0);
    for(i=0;i<a;i++){
        taste.at(i)=(b+i);
        sub.at(i)=b+i;
        if(taste.at(i)<0){
            taste.at(i)*=-1;
        }
       
        }
    
    for(i = 0;i<a;i++){
        s+=sub.at(i);

    }
        sort(taste.begin(),taste.end());
        for(j=0;j<a;j++){
            if(taste.at(0)==sub.at(j)||taste.at(0)==sub.at(j)*-1){
                break;
            }   
        }
            cout << s-sub.at(j) << endl;
          
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <fstream>
#include <sstream>
#include <math.h>
#include <map>
using namespace std;

int main()
{
	int K,ANS;
	cin >> K;
	if(K%2==0){cout << (K/2)*(K/2);}
	else{cout << (K/2)*((K/2)+1);}
	
}

Measured memory_bytes: 256
//abc032d
//n w
//v[0] w[0]~v[n-1] w[n-1]
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    long long W;
    cin>>N>>W;
    long long value[N],weight[N];
    for(int i=0;i<N;i++)
    cin>>weight[i]>>value[i];
    long long dp[N+1][W+1]={};
    /*
    この実装だと
    ↓↓↓↓
    ↓↓↓↓
    という流れでdpの表を埋めていることになる
    */
    for(int i=0;i<N;i++)
    {
        for(long long w=0;w<=W;w++){
            if(w<weight[i])
            {
                dp[i+1][w]=dp[i][w];
            }
            else
            {
                dp[i+1][w]=max(dp[i][w],dp[i][w-weight[i]]+value[i]);
            }
        }
    }
    cout<<dp[N][W]<<endl;
    return 0;
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define fr(i,a,b) for(int i=a;i<=b;i++)


const int N=2e5+5;


void solve()
{
	int n,k;
	cin>>n>>k;
	int p[n+5];
	fr(i,1,n)
		cin>>p[i];
	sort(p+1,p+1+n);
	int ans=0;
	for(int i=1;i<=k;i++)
		ans+=p[i];
		cout<<ans;	
}

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

	int t=1;
	//cin>>t;
	while(t--)
		solve();

}

Measured memory_bytes: 3660
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        int N = fs.nextInt();
        int[] arr = new int[N+1];

        for (int i = 0; i < N-1; ++i) {
            arr[fs.nextInt()]++;
        }

        for (int i = 1; i < N+1; ++i) {
            System.out.println(arr[i]);
        }
    }
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    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: 57296
#include<iostream>
#include<sstream>
#include<vector>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define fr(i,c) for(__typeof(c.begin()) i=c.begin();i!=c.end();i++)
#define pb push_back
#define mp make_pair
#define all(c) c.begin(),c.end()

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef long long ll;
const int inf=(int)1e9;
const double EPS=1e-9, INF=1e12;

int main(){
	int t; cin>>t;
	double e=0;
	while(t--){
		int n,m; cin>>n>>m;
		double te=0, rs=0;
		rep(i,m){
			int v; 
			double r; cin>>v>>r;
			te+=v*r;
			rs+=r;
		}
		te/=rs;
		e=max(e,te);
	}
	double he=0,hs=0;
	int p,q; cin>>p>>q;
	rep(i,q){
		int v; double r;
		cin>>v>>r;
		he+=v*r;
		hs+=r;
	}
	he/=hs;
	cout<<(he+0.0000001<e?"YES":"NO")<<endl;
	return 0;
	
}

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

class Program
{
    static void Main()
    {
        var N = int.Parse(ReadLine());
        var X = ReadLine().Split().Select(int.Parse).ToArray();
        var A = new int[N];
        Array.Copy(X, A, N);
        Array.Sort(A);
        for (int i = 0; i < N; i++)
        {
            if (X[i] < A[N / 2]) WriteLine(A[N / 2]);
            else WriteLine(A[N / 2 - 1]);
        }
    }
}

Measured memory_bytes: 38216
#pragma GCC optimize(2)
#include<bits/stdc++.h> 
using namespace std;
#define ll long long
#define endl "\n"
const int MAX=1e6+7;
const int mod=1e9+7;
string str[4]={"eraser","erase","dreamer","dream"};
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
	for(int i=0;i<4;i++)reverse(str[i].begin(),str[i].end());
	string s,t;cin>>s; reverse(s.begin(),s.end());
	 for (int i=0;i<s.size();){
        for (string&t:str){
        	if (s.substr(i,t.size())==t){
            	i+=t.size();
            	goto l1;
	        }
		}
		cout << "NO\n";
        return 0;
        l1:;
    }
    cout<<"YES";
   return 0;
} 

Measured memory_bytes: 3712
// https://atcoder.jp/contests/abc163/tasks/abc163_b
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, M;
    cin >> N >> M;
    int sum = 0;
    REP(i, M) {
        int t;
        cin >> t;
        sum += t;
    }
    cout << (N < sum ? -1 : N - sum) << endl;

    return 0;
}


Measured memory_bytes: 3604
#include<iostream>
using namespace std;
#include<map>
#include<unordered_map>
#include<vector>
#include<cmath>
#include<set>
#include<algorithm>
#define int long long int
#define mod 1000000007
int power(int a,int b)
{
	if(b==0)
	    return 1;
	else
	{
		int r=power(a,b/2);
		if(b%2==0)
		{
			return (r*r)%mod;
		}
		else
		{
			int x=(r*r)%mod;
			return (a*x)%mod;
		}
	}
}
int function2(string &str,int initial,int final,int memo[])
{
	if(initial>final)
	    return 1;
	if(memo[initial]!=-1)
	     return memo[initial];
	else
	{
		if(str[initial]=='0')
		{
			int x=function2(str,initial+1,final,memo);
			memo[initial]=x%mod;
			return memo[initial];
		}
		else
		{
			int answer=power(3,final-initial);
			answer+=2*function2(str,initial+1,final,memo);
			memo[initial]=answer%mod;
			return memo[initial];
		}
	}
}
int32_t main()
{
	string str;
	cin>>str;
	int n=str.size();
	int memo[n+1],j;
	for(j=0;j<=n;j++)
	{
		memo[j]=-1;
	}
	int answer=function2(str,0,n-1,memo);
	cout<<answer<<endl;
}


Measured memory_bytes: 10776
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] spade = new int[13];
    int[] heart = new int[13];
    int[] dia = new int[13];
    int[] clover = new int[13];
    for(int i = 0; i < n; i++) {
      String s = sc.next();
      int a = sc.nextInt();
      if(s.equals("S")) {
        spade[a - 1] = 1;
      } else if(s.equals("H")) {
        heart[a - 1] = 1;
      } else if(s.equals("D")) {
        dia[a - 1] = 1;
      } else {
        clover[a - 1] = 1;
      }
    }
    for(int i = 0; i < 13; i++) {
      if(spade[i] == 0) {
        System.out.println("S " + (i + 1));
      }
    }
    for(int i = 0; i < 13; i++) {
      if(heart[i] == 0) {
        System.out.println("H " + (i + 1));
      }
    }
    for(int i = 0; i < 13; i++) {
      if(clover[i] == 0) {
        System.out.println("C " + (i + 1));
      }
    }
    for(int i = 0; i < 13; i++) {
      if(dia[i] == 0) {
        System.out.println("D " + (i + 1));
      }
    }
  }
}



Measured memory_bytes: 26180
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))

A, B = load_list()

# a1 = int(A * 100 / 8)
# a2 = int((A+1) * 100 / 8)
# b1 = int(B * 100 / 10)
# b2 = int((B+1) * 100 / 10)

# for i in range(b1, b2+1):
#     if i >= a1 and i <= a2:
#         print(i)
#         exit()
# print(-1)

for i in range(B, B+20000):
    if int(i * 0.08) == A and int(i*0.1) == B:
        print(i)
        exit()
print(-1)

Measured memory_bytes: 3640
'''
Accepted    　:No
difficult   　: 
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''

def myAnswer(N:int,A:list,B:list) -> int:
   negative = []
   positive = []
   counter = 0
   total = 0
   for a,b in zip(A,B):
      if(a - b < 0):
         negative.append(a - b)
      else:
         positive.append(a - b)
   negative.sort()
   positive.sort(reverse=True)
   for d in negative + positive:
      if(d >= 0 and total >= 0):
         break
      else:
         total += d
         counter += 1
   
   return counter if(total >= 0) else -1

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   B = list(map(int,input().split()))
   print(myAnswer(N,A,B))

if __name__ == '__main__':
   main()

Measured memory_bytes: 19188
x, y = gets.strip.split.map(&:to_i)

def group(i)
    return :c if i == 2
    return :a if [1, 3, 5, 7, 8, 10, 12].include?(i)
    return :b
end

puts group(x) ==  group(y) ? 'Yes' : 'No'

Measured memory_bytes: 1788
a, b, h, m = map(int, input().split())
x =( 60*h+m)/2
y = m*6
z = abs(x-y)
import math
s = b*math.sin(math.radians(z))
t = b*math.cos(math.radians(z))
r = ((abs(a-t))**2 + (s**2))**(.5)
print(r)

Measured memory_bytes: 9492
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

ll modinv(ll x, ll m = mod) {
  ll b = m;
  ll u = 1;
  ll v = 0;
  ll tmp;
  while (b) {
    ll t = x / b;
    x -= t * b;
    tmp = x;
    x = b;
    b = tmp;
    u -= t * v;
    tmp = u;
    u = v;
    v = tmp;
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

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

  int n;
  cin >> n;
  vector<ll> x(n);
  for (auto &y: x) cin >> y;

  vector<ll> factorial(n+1);
  factorial[0] = 1;
  for (int i = 1; i <= n; i++) factorial[i] = (factorial[i-1] * i) % mod;

  vector<ll> mul(n-1);
  mul[0] = factorial[n-1];
  for (int i = 1; i < n-1; i++) {
    mul[i] = (mul[i-1] + (factorial[n-1] * modinv(i+1)) % mod) % mod;
  }

  ll total = 0;
  for (int i = 0; i < n-1; i++) {
    total = (total + ((x[i+1] - x[i]) * mul[i]) % mod) % mod;
  }

  cout << total << endl;

  return 0;
}


Measured memory_bytes: 2560
import java.util.Scanner;

public class Main {
	static long solve(long T1 , long T2 , long A1 , long A2 , long B1 , long B2){
		long LA = T1 * A1 + T2 * A2;
		long LB = T1 * B1 + T2 * B2;
		if(LA == LB){
			return -1;
		}
		if(A1 > B1 && A2 > B2){
			return 0;
		}
		if(B1 > A1 && B2 > A2){
			return 0;
		}
		if(A1 < B1 && A2 > B2){
			if(LA < LB){
				return 0;
			}
			long lead = LA - LB;
			long LA1 = T1 * A1;
			long LB1 = T1 * B1;		
			long k = (LB1 - LA1) / lead;
			if((LB1 - LA1) % lead == 0){
				return 2 * k;
			}else{
				return 2 * k + 1;
			}
//			System.out.println(LA+" "+LB+" "+(LA - LB)+" "+(LB1 - LA1) +" "+k);
//			return 2 * k + 1;
		}
		if(A1 > B1 && A2 < B2){
			if(LA > LB){
				return 0;
			}
			long lead = LB - LA;
			long LA1 = T1 * A1;
			long LB1 = T1 * B1;
			long k = (LA1 - LB1) / lead;
			if((LA1 - LB1) % lead == 0){
				return 2 * k;
			}else{
				return 2 * k + 1;
			}
		}
		return -1;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long T1 = sc.nextLong();
		long T2 = sc.nextLong();
		long A1 = sc.nextLong();
		long A2 = sc.nextLong();
		long B1 = sc.nextLong();
		long B2 = sc.nextLong();
		long ret = solve(T1 , T2 , A1 , A2 , B1, B2);
		if(ret < 0){
			System.out.println("infinity");
		}else{
			System.out.println(ret);
		}
	}
}


Measured memory_bytes: 23764
program problemB
  implicit none

real(8) ::   d, e
integer(8) :: n,m, yr, l, i, k, j,judge, small, kref, r, b, t, f
integer(8) :: BNUM, RNUM, NMAX, count,MMAX, sum
character(len=4) :: color
integer, allocatable :: A(:)


read(*,*) NMAX,MMAX

allocate(A(MMAX))
read(*,*) A
sum=0
do n=1,MMAX
  sum=sum+A(n)
end do
deallocate(A)

if (sum>NMAX) then
  write(*,*) -1
else
  write(*,*) NMAX-sum
end if


stop
end program


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

int main() {
  long long N,S,K;
  cin >>N>>K>>S;
for(int i=0;i<N;i++){
  if(i<K){
    if(i!=N-1){
    cout<<S<<" ";
    }
    else{
      cout<<S;
    }
    continue;
  }
  if(S!=1000000000){
    cout<<S+1;
    if(i!=N-1){
      cout<<" ";
    }
    continue;
  }
  else{
    cout<<S-1;
        if(i!=N-1){
          cout<<" ";
    }
    continue;
  }
  }
  

  cout << endl;
}


Measured memory_bytes: 1280
s = input()
t = input()

max_cnt = 0
for i in range(len(s)-len(t)+1):
    ss = s[i:i+len(t)]
    cnt = 0
    for j in range(len(t)):
        if t[j]==ss[j]:
            cnt += 1
    if max_cnt < cnt:
        max_cnt = cnt

print(len(t)-max_cnt)

Measured memory_bytes: 9116
import java.util.*;
import java.io.*;
import java.math.*;

class Main {
	final static long MOD = 1000000007;
	public static void main(String args[]) throws Exception {
		int n = nextInt();
		int m = nextInt();
		System.out.println(v(n)+v(m));
	}

	static int v(int n) {
		return Math.max(0, n*(n-1)/2);
	}

	static int nextInt()throws IOException{
		InputStream in = System.in;
		int ans=0;
		boolean flag=true;
		byte b=0;
		boolean neg=false;
		while ((b>47 && b<58) || flag){
			if(b==45)
				neg=true;
			if(b>=48 && b<58){
				ans=ans*10+(b-48);
				flag=false;
			}
			b=(byte)in.read();
		}
		if(neg)
			return -ans;
		return ans;
	}

	static long nextLong()throws IOException{
		InputStream in=System.in;
		long ans=0;
		boolean flag=true;
		byte b=0;
		while ((b>47 && b<58) || flag){
			if(b>=48 && b<58){
				ans=ans*10+(b-48);
				flag=false;
			}
			b=(byte)in.read();
		}
		return ans;
	}
	static String next()throws Exception{
		StringBuilder sb=new StringBuilder(1<<16);
		InputStream in=System.in;
		byte b=0;
		do{
			if(!isWhiteSpace(b))
				sb.append((char)b);
			b=(byte)in.read();
		}while(!isWhiteSpace(b) || sb.length()==0);
		return sb.toString();
	}
	static boolean isWhiteSpace(byte b){
		char ch=(char)b;
		return ch=='\0' || ch==' ' || ch=='\n';
	}
}

Measured memory_bytes: 23124
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
typedef long long LL;

int main() {
	int a, b, c;
	std::cin >> a >> b >> c;

	std::cout << a * b / 2 << std::endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin >>a>>b;
string num = to_string(a)+to_string(b);
int c = stoi(num);
int p = sqrt(c);
if(pow(p,2.0)==c){
cout<<"Yes"<<endl;
}else
cout<<"No"<<endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int H[200];
    for (int i = 0; i < n; i++)
    {
        cin >> H[i];
    }
    int ma = H[0];
    int cnt = 0;
    for (int i = 0; i < n; i++)
    {
        ma = max(ma, H[i]);
        if (ma <= H[i])
            cnt++;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

use std::cmp;

fn main() {
    let s = get!(String).chars().collect::<Vec<_>>();
    let len = s.len();
    let mut r = len;
    for i in 0..len-1 {
        if s[i] != s[i+1] {
            r = cmp::min(r, cmp::max(i+1, len-i-1));
        }
    }
    println!("{}", r);
}

Measured memory_bytes: 2756
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cerr << #x << ": " << x << endl
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(c <= a + b)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
int main(){
  int64_t N;
  cin>>N;
  int64_t k=0,l=5;
  if(N%2==1){cout<<0<<endl;}
  else{
  rep(i,26){
      k+=(N/l)/2;
      l*=5;}
    cout<<k<<endl;} 
}

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

int main() {
    int x,y,buf;
    cin>>x>>y;
    while(!(x==0&&y==0)){
        if (x>y) {
            buf=x;
            x=y;
            y=buf;
        }
        cout << x << " " << y << endl;
        cin>>x>>y;
    }
    return 0;
}


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

int main(void) {
    int N, M, L;
    long tmpSum;
    cin >> N >> M >> L;
    int matrix1[N][M], matrix2[M][L];

    for(int i=0; i < N; i++)
        for(int j=0; j < M; j++)
            cin >> matrix1[i][j];

    for(int i=0; i < M; i++)
        for(int j=0; j < L; j++)
            cin >> matrix2[i][j];

    for(int i=0; i < N; i++) {
        for(int j=0; j < L; j++) {
            tmpSum = 0;
            for(int k=0; k < M; k++)
                tmpSum += matrix1[i][k] * matrix2[k][j];
            cout << tmpSum << (j == L-1 ? "" : " ");
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 3160
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N = II()
    c = str(input())

    x = 1
    ans = 0
    y = 0

    for i in range(N):
        if y != 0:
            break
        if c[i] == "W":
            for j in range(x, N):
                ii = -j
                if c[ii] == "R" and j < N-i:
                    ans += 1
                    x = j+1
                    break
                if j>= N-i:
                    y += 1
                    break



    print(ans)

if __name__ == "__main__":
	main()

Measured memory_bytes: 68280
#include <stdio.h>
static int n, m, l, a[100][100], b[100][100];
static long c[100][100];
int main(void) {
    int i, j, k;
    scanf("%d%d%d", &n, &m, &l);
    for (i = 0; i < n; ++i)
        for (j = 0; j < m; ++j)
            scanf("%d", &a[i][j]);
    for (i = 0; i < m; ++i)
        for (j = 0; j < l; ++j)
            scanf("%d", &b[i][j]);
    for (i = 0; i < n; ++i)
        for (j = 0; j < l; ++j)
            for (k = 0; k < m; ++k)
                c[i][j] += a[i][k] * b[k][j];
    for (i = 0; i < n; ++i) {
        for (j = 0; j < l; ++j) {
            if (j) putchar(' ');
            printf("%ld", c[i][j]);
        }
        putchar('\n');
    }
    return 0;
}

Measured memory_bytes: 760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define speed ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define ub(a,x) upper_bound(a.begin(),a.end(),x)-a.begin()
#define lb(a,x) lower_bound(a.begin(),a.end(),x)-a.begin()
#define ALL(v)   v.begin(),v.end()
int main()
	{
		speed
		int n;
		cin >> n;
		vector<int> vec(n);
		for(auto &a : vec)cin >> a
		;
		int ans = 0;		
		for(int x =1; x<n-1; x++)
		{
			if(vec[x] > vec[x-1] && vec[x] < vec[x+1] || vec[x] < vec[x-1] && vec[x] > vec[x+1] )ans++;
		}
		cout <<  ans;
		
	}	


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

int main(){
    
    int n,m,l,el;
    cin >>n >>m >>l;
    int A[n][m];
    int B[m][l];
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cin >>el;
            A[i][j] =el;
        }
    }
     for(int i=0;i<m;i++){
        for(int j=0;j<l;j++){
            cin >>el;
            B[i][j] =el;
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<l;j++){
            if(j) cout << " ";
            long sum =0;
            for(int k=0;k<m;k++){
                sum += A[i][k]*B[k][j];
            }
            cout << sum;
        }
        cout << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3156
#include<bits/stdc++.h>
	using namespace std;
	const int MAX =1e6+233;

bool cmp(int A,int B){
	return A>B;
}


int main(){
	string s;
	cin>>s;
	if(s.size()%2){
		cout<<"No"<<endl;
		return 0;
	}
	for(int i=0; i<s.size(); i++) {
		if(s[i]=='h'&&s[i+1]=='i')i++;
		else{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;




	return 0;
}



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

int main(){
	long n;cin >> n;
  	vector<long> a(n);
  	for(int i=0;i<n;i++){
    	cin >> a[i];
    }
  	auto itr = a.begin();
  	long rest=0;
  	long i=1;
  	while(1){
      	itr=find(itr,a.end(),i);
    	if(itr==a.end() && i==1){
        	cout << -1;
          	return 0;
        }else if(itr==a.end()){
        	break;
        }
      	rest++;
      	i++;
      	itr++;
    }
  	cout << n-rest;
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(v) v.begin(), v.end()

using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const double PI = 2 * acos(0);
LL ans[200001];

LL pangkat(LL x, LL y, LL mo) {
	if (y == 0) return 1;
	LL tmp = pangkat(x, y / 2, mo) % mo;
	tmp = (tmp * tmp) % mo;
	if (y % 2) tmp *= x;
	tmp %= mo;
	return tmp; 
}

int main() {
	int N;
	string s;
	cin >> N >> s;
	int cnt = 0;
	LL mi = 0, ma = 0;
	for (int i = 0; i < N; i++) {
		cnt += (s[i] == '1');
	}
	for (int i = 0; i < N; i++) {
		if (s[N - i - 1] == '1') {
			//minus
			if (cnt > 1) {
				int tmp = cnt - 1;
				mi += pangkat(2, i, tmp);
				mi %= tmp; 
			}
			//plus
			int tmp = cnt + 1;
			ma += pangkat(2, i, tmp);
			ma %= tmp;
		}
	}
	if (cnt == 0) {
		for (int i = 0; i < N; i++) {
			ans[i] = 1;
		}
	} else if (cnt == 1) {
		for (int i = 0; i < N; i++) {
			if (s[i] == '0') {
				LL tmp = ma;
				tmp += pangkat(2, N - i - 1, cnt + 1);
				tmp %= (cnt + 1);
				int ans2 = 1;
				while (tmp > 0) {
					ans2++;
					int x = __builtin_popcount(tmp);
					tmp %= x;
				}
				ans[i] = ans2;
			}
		}
	} else {
		for (int i = 0; i < N; i++) {
			if (s[i] == '0') {
				LL tmp = ma;
				tmp += pangkat(2, N - i - 1, cnt + 1);
				tmp %= (cnt + 1);
				int ans2 = 1;
				while (tmp > 0) {
					ans2++;
					int x = __builtin_popcount(tmp);
					tmp %= x;
				}
				ans[i] = ans2;
			} else {
				LL tmp = mi;
				tmp -= pangkat(2, N - i - 1, cnt - 1);
				while (tmp < 0) tmp += (cnt - 1);
				int ans2 = 1;
				while (tmp > 0) {
					ans2++;
					int x = __builtin_popcount(tmp);
					tmp %= x;
				}
				ans[i] = ans2;
			}
		}
	}
	for (int i = 0; i < N; i++) {
		printf("%lld\n", ans[i]);
	}
}

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

int main() {
    int N;
    cin>>N;
    map<int, int>map;
    int tmp;
    for(int i=0;i<N;++i){
        cin>>tmp;
        tmp--;
        map[tmp] = i+1;
    }
    for(int i=0;i<N;++i){
        cout<<map[i]<<" ";
    }
    cout<<endl;
}


Measured memory_bytes: 5504
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define mfill(x,y) memset(x,y,sizeof(x))
#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...) 42
#endif
#define y0 y12345
#define y1 y54321
typedef unsigned long ul;
typedef long long ll;
//typedef pair<int, int> mpair;
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;}
using namespace std;
int n;
int t[100000];
int h[100000];
ul dp(int p){
	if(t[p]!=-1)return t[p];
	ul res = 0;
	if(p==n-1){res=0;}
	else if(p==n-2){res = abs(h[n-1]-h[n-2]);}
	else {res=min(dp(p+1)+abs(h[p]-h[p+1]), dp(p+2)+abs(h[p]-h[p+2]));}
	return t[p]=res;
}

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
   	
	cin>>n;
	//int h[n];
	rep(i, n){
		cin>>h[i];
		//t[i] = -1;
	}
	vector<int> tab(n-1);
	//tab[n-1] = 0;
	tab[n-2] = abs(h[n-1]-h[n-2]);
	for(int i = n-3;i>=0;i--){
		tab[i] = min(tab[i+1]+abs(h[i]-h[i+1]), tab[i+2]+abs(h[i]-h[i+2]));
	}
	//rep(i, n)cerr<<tab[i]<<endl;
	cout << tab[0] << endl;

	return 0;
}


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

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;

#define MOD 1000000007
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define ot(x) cout<<(x)
#define ote(x) cout<<(x)<<endl

#define MAX 100000

vi A(MAX);

// int chidori(int N){
// 	 = 0;
// 	int n = N;
// 	while(n--){
// 		 a = (a<<1) + (n%2!=N%2);
// 	}
// 	return a;
// }

int main(){
	string S; cin>>S;
	int N = S.size();
	int a = 0;
	int b = 0;
	rp(i,N){
		bool s = S[i]-'0';
		bool odd = i%2;
		if(odd^s) ++a;
		if((!odd)^s) ++b;
	}
	 ote(min(a,b));
}


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

#define llong long long 
#define len(x) ((int)x.size())
#define rep(i,n) for (int i = -1; ++ i < n; )
#define rep1(i,n) for (int i = 0; i ++ < n; )
#define rand __rand
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());  // or mt19937_64
template<class T = int> T rand(T range = numeric_limits<T>::max()) { return (T)(rng() % range); }

#define CONCAT_(x, y) x##y/*{{{*/
#define CONCAT(x, y) CONCAT_(x, y)
#define SPEC(name) CONCAT(name, __LINE__)
#ifdef LOCAL_DEBUG   
int __db_level = 0;
#define clog cerr << string(__db_level * 2, ' ')
struct debug_block {
    string msg;
    debug_block(const string& s): msg(s) { clog << "{ " << msg << endl; ++__db_level; }
    ~debug_block() { --__db_level; clog << "} " << msg << endl; }
};
#define DB(args...) stringstream SPEC(ss); SPEC(ss)<< args; debug_block SPEC(dbbl)(SPEC(ss).str())
#else
#define clog if (0) cerr
#define DB(...)
#endif
#define db(val) "[" #val " = " << val << "]; "
template<class U, class V> ostream& operator<<(ostream& out, const pair<U, V>& p) {
    return out << "(" << p.first << ", " << p.second << ")";
}
template<size_t i, class T> ostream& print_tuple_utils(ostream& out, const T& tup) {
    if constexpr(i == tuple_size<T>::value) return out << ")";
    else return print_tuple_utils<i + 1, T>(out << (i ? ", " : "(") << get<i>(tup), tup);
}
template<class ...U>
ostream& operator<<(ostream& out, const tuple<U...>& tup) { return print_tuple_utils<0, tuple<U...>>(out, tup); }
template<class, typename = void> struct has_const_iterator : false_type {};
template<class T> struct has_const_iterator<T, void_t<typename T::const_iterator>> : true_type {};
template<class T>
typename enable_if<has_const_iterator<T>::value && !is_same<T, string>::value, ostream&>::type
operator<<(ostream& out, const T& container) { 
    auto beg = container.begin(), end = container.end();
    out << "(" << container.size() << ") {";
    if (beg != end) out << *(beg++);
    while (beg != end) out << ", " << *(beg++);
    return out << "}";
}
#define ptrtype(x) typename iterator_traits<x>::value_type
template<class u> vector<ptrtype(u)> $v(u a, u b) { return vector<ptrtype(u)>(a, b); }/*}}}*/
// ACTUAL SOLUTION BELOW ////////////////////////////////////////////////////////////


int main(void) {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    llong a, b, c, d; cin >> a >> b >> c >> d;
    cout << max({a * c, a * d, b * c, b * d});

    return 0;
}

// Remember:
// - Multitest? REFRESHING the data!!!
// - Constrains for each set of data may differs. Should NOT USE the same max constant (maxn)
//   for all of them.
// vim: foldmethod=marker



Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <deque>
using namespace std;

#define INF 1e18
#define int long long
#define rep(i, n) for(int i = 0; i < n; i++)

signed main() {
    int n, l; cin >> n >> l;

    int ans = 0;
    int min_l = INF;
    for(int i = 0; i < n; i++) {
        ans += l + i;
        min_l = min(min_l, abs(l + i));
    }

    cout << (l < 0 ? ans + min_l : ans - min_l) << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<map>
#include<numeric>
#include<stack>
#include<queue>
#include<functional>
#include<cassert>
#include<set>
#define rep(a,b) for(int a=0;a<b;++a)
#define REP(a,b,c,d) for(int a=b;a<c;a+=d)
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl
#define mod 1000000007
using namespace std;
using ll = long long;
using p_i = pair<int, int>;
int main() {
	int N, A, B;	cin >> N >> A >> B;
	string S; cin >> S;
	int a = 0, b = 0, sanka = 0, a_i = -1, b_i = -1;
	rep(i, S.size()) {
		if (S[i] == 'a'&&a + b < A + B) {
			a_i = i;
			++a;
		}
		else if (S[i] == 'b'&&a + b < A + B && b < B) {
			b_i = i;
			++b;
		}
	}
	rep(i, S.size()) {
		if (S[i] == 'a'&&a_i >= i)yes;
		else if (S[i] == 'b'&&b_i >= i)yes;
		else no;
	}
	cin >> N;
}

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

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if (d <= a || b <= c) {
        cout << 0 << endl;
    }

    else if (a <= d && d <= b && c <= a) {
        cout << d - a << endl;
    }

    else if (a <= c && d <= b) {
        cout << d - c << endl;
    }

    else if (a <= c && c <= b && b <= d) {
        cout << b - c << endl;
    }

    else if (c <= a && a <= b && b <= d) {
        cout << b - a << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define In_The_Name_Of_Allah_The_Merciful ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define Alhamdulillah return 0;
#define all(v) v.begin(),v.end()
#define debug(n) cerr << "[" << #n << " = " << n << "]" << endl 

void Suhaib_Sawalha (){

    int n;
    cin >> n;
    int a , ans = 0;
    for (int i = 0 ; i < n ; ++i){
        cin >> a;
        if (a&1 && i&1^1)
            ans++;
    }
    cout << ans;

}

int main(){
                                In_The_Name_Of_Allah_The_Merciful   /* بسم الله الرحمن الرحيم  */
#ifndef ONLINE_JUDGE
    freopen("SuhaibSawalha1.txt","r",stdin);
#endif
//int _;for(cin>>_;_;--_,cout<<'\n')
        Suhaib_Sawalha();
                                         Alhamdulillah                    /* الحمد لله */
}

Measured memory_bytes: 3604
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>

#define INF_LL 9000000000000000000
#define INF 2000000000

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)

using namespace std;

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

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

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

int main(void){
	int N;
	int num[100];
	ll dp[21][100];
	cin >> N;
	REP(i, N){
		cin >> num[i];
	}
	REP(i, 21){
		fill(dp[i], dp[i]+100, 0);
	}
	dp[num[0]][0] = 1;
	REP(i, N-1){
		REP(j, 21){
			int val = j+num[i+1];
			if(val <= 20){
				dp[j][i+1] += dp[val][i];
			}
			val = j-num[i+1];
			if(val >= 0){
				dp[j][i+1] += dp[val][i];
			}
		}
	}
	cout << dp[num[N-1]][N-2] << endl;
}

Measured memory_bytes: 3112
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto N = RD;
	auto M = RD;
	auto b = new long[](N);
	foreach (i; 0..M)
	{
		auto a = RD-1;
		b[a] = 1;
	}

	auto dp = new long[](N+1);
	dp[0] = 1;
	if (b[0] == 0)
		dp[1] = 1;
	foreach (i; 1..N)
	{
		if (b[i] == 1) continue;
		moda(dp[i+1], dp[i]);
		moda(dp[i+1], dp[i-1]);
	}
	debug writeln(dp);

	writeln(dp[N]);
	stdout.flush();
	debug readln();
}

Measured memory_bytes: 4860
from fractions import gcd
# from math import gcd

def divisor(n):
    div = set()
    for i in range(1, n // 2 + 2):
        d, m = n // i, n % i
        if m == 0:
            div.add(i)
            div.add(d)
        if d < i:
            break
    return sorted(list(div))


a, b = map(int, input().split())
divs = divisor(gcd(a, b))
collect = []
for d in divs:
    if d == 1 or d == 2:
        collect.append(d)
    else:
        for ci in collect[::-1]:
            if ci != collect[0] and d % ci == 0:
                break
        else:
            collect.append(d)
print(len(collect))


Measured memory_bytes: 5856
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s,t;
ll int n,i,j;
cin>>n;
cin>>s;
cin>>t;
for(i=0;i<n;i++)
{
    cout<<s[i]<<t[i];
}
cout<<endl;
return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include<cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>
#include<list>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include <vector>

#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REPR(i,n)   FORR(i,n,0)

using namespace std;

int euclid(int a, int b){
	int q = b%a;
	if (q != 0){
		return euclid(q, a);
	}
	else{
		return a;
	}

}

int main(){
	int N, D, X, y;
	vector<int> x;
	scanf("%d %d", &N, &X);
	REP(i, N){
		cin >> y;
		x.push_back(abs(X-y));
	}

	D = x[0];
	REP(i, N){
		D = euclid(min(D, x[i]), max(D, x[i]));
	}

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

	return 0;
}

Measured memory_bytes: 892
#include<iostream>
using namespace std;
int main()
{
int a[5],k=0;
for(int i=0;i<5;i++)
	cin>>a[i];

for(int i=0;i<5;i++)
	for(int j=i+1;j<5;j++)
	{
		int r1=a[i]%10,r2=a[j]%10;
		if(r1==0)
			r1=10;
		if(r2==0)
			r2=10;
		if(r1<r2)
		{
		int temp=a[i];
		a[i]=a[j];
		a[j]=temp;
		}
	}
for(int i=0;i<4;i++)
{	if(a[i]%10!=0)
		k+=a[i]+10-a[i]%10;
	else k+=a[i];
}
cout<<k+a[4];

return 0;
}


Measured memory_bytes: 256
import math
def A():
    a = input()
    b = input()
    ans = 0
    for i in range(3):
        if a[i] == b[i]:
            ans += 1
    print(ans)

def B():
    temp = [int(i) for i in input().split()]
    a = int(temp[0])
    b = int(temp[1])
    ans = 1
    t = a
    while (t<b):
        ans += 1
        t += a
    print(ans)

def C():
    n = int(input())
    nums = [int(i) for i in input().split()]
    start_index = 0
    end_index = 1
    max_len = 0
    le = 0
    while (end_index < len(nums)):
        if nums[end_index] <= nums[end_index-1]:
            le += 1
        else:
            max_len = max(le, max_len)
            start_index = end_index
            le = 0
        end_index += 1
    max_len = max(le, max_len)
    print(max_len)

C()

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

using namespace std;

void solve()
{
	string S;
	cin >> S;
	for (int i = 0; i < S.size() - 1; ++i)
	{
		if (S[i] == 'A' && S[i + 1] == 'C')
		{
			cout << "Yes" << endl;
			return;
		}
	}
	cout << "No" << endl;
}

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

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

const int MAXN = 1001;
int N;
char G[MAXN][MAXN];
int dp[MAXN][MAXN];

int main() {
  while(cin >> N && N) {
    for(int i = 0; i < N; ++i) {
      for(int j = 0; j < N; ++j) {
        cin >> G[i][j];
      }
    }
    int ans = 0;
    fill(dp[0], dp[MAXN], 0);
    for(int i = 0; i < N; ++i) {
      for(int j = 0; j < N; ++j) {
        if(i == 0 || j == 0) dp[i][j] = (G[i][j] == '.');
        else {
          if(G[i][j] == '.') {
            dp[i][j] = min(min(dp[i-1][j], dp[i][j-1]), dp[i-1][j-1]) + 1;
          } else {
            dp[i][j] = 0;
          }
        }
        ans = max(ans, dp[i][j]);
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 6052
#include <stdio.h>      
int main() {
  
  int N; 
  int K;
  char S[52];
  
  scanf("%d %d", &N, &K);getchar();
  scanf("%s", &S);getchar();
  
  int M = K-1;
  S[M] += 32;
  printf("%s\n", S);


  return 0;
}


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

int main(void) {
	int channel_num,start_time,end_time;
	int* cm_channels;
	int cm_num;
	int cm_start,cm_end;
	int i,j;
	int now_result,max_result;
	while(1) {
		scanf("%d%d%d",&channel_num,&start_time,&end_time);
		if(channel_num==0 && start_time==0 && end_time==0)break;
		end_time-=start_time;
		if(end_time<0){puts("0");continue;}
		cm_channels=calloc(end_time+1,sizeof(int));
		if(cm_channels==NULL)return 1;//error
		for(i=0;i<channel_num;i++) {
			scanf("%d",&cm_num);
			for(j=0;j<cm_num;j++) {
				scanf("%d%d",&cm_start,&cm_end);
				cm_start-=start_time;
				cm_end-=start_time;
				if(cm_start<0)cm_start=0;
				if(cm_start>end_time)cm_start=end_time;
				if(cm_end<0)cm_end=0;
				if(cm_end>end_time)cm_end=end_time;
				cm_channels[cm_start]++;
				cm_channels[cm_end]--;
			}
		}
		for(i=1;i<=end_time;i++)cm_channels[i]+=cm_channels[i-1];
		max_result=0;
		now_result=0;
		for(i=0;i<end_time;i++) {
			if((i+start_time)%100>=60) {
				i+=100-(i+start_time)%100;
			}
			if(i>=end_time)break;
			if(cm_channels[i]<channel_num)now_result++;
			else {
				if(max_result<now_result)max_result=now_result;
				now_result=0;
			}
		}
		if(max_result<now_result)max_result=now_result;
		printf("%d\n",max_result);
		free(cm_channels);
	}
	return 0;
}

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

using namespace std;

string s, ans;

void key(string::iterator a)
{
    if ('0' == *a)
    {
        ans.push_back('0');
    }else if('1' == *a)
    {
        ans.push_back('1');
    }else if('B' == *a)
    {
        if (ans.size() != 0)
        {
            ans.pop_back();
        }
        
    }
    
}

int main(int argc, char const *argv[])
{
    cin >> s;
    for (string::iterator itr = s.begin(); itr != s.end(); itr++)
    {
        key(itr);
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll A, B, M;
  cin >> A >> B >> M;
  vl a(A), b(B);
  ll ans = llINF;
  ll ma = llINF;
  ll mb = llINF;
  REP(i, A) {
    cin >> a[i];
    ma = min(ma, a[i]);
  }
  REP(i, B) {
    cin >> b[i];
    mb = min(mb, b[i]);
  }
  ans = ma + mb;
  REP(i, M) {
    ll x, y, c;
    cin >> x >> y >> c;
    ans = min(ans, a[x - 1] + b[y - 1] - c);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
namespace mine
{
    typedef long long ll;
    #define pr pair<int,int>
    #define FR first
    #define SE second
    #define MP make_pair
    #define PB push_back
    #define vc vector
    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())
    #define bin(x) (1ll<<(x))
    #define GG(x) if(x) puts("error")
    ll qread()
    {
        ll ans=0,f=1;char c=getchar();
        while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
        while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
        return ans*f;
    }
    void write(ll num)
    {
        if(num<0) putchar('-'),num=-num;
        if(num>=10) write(num/10);
        putchar('0'+num%10);
    }
    void write1(ll num){write(num);putchar(' ');}
    void write2(ll num){write(num);putchar('\n');}
    template<typename T> void chmax(T &x,const T y) {x=(x>y?x:y);}
    template<typename T> void chmin(T &x,const T y) {x=(x<y?x:y);}
    ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

    const int INF=0x3f3f3f3f;
    const int MOD=993244853;
    inline int mm(const int x){return x>=MOD?x-MOD:x;}
    template<typename T> inline void add(T &x,const T y){x=mm(x+y);}
    inline ll qpower(ll x,ll e)
    {
        ll ans=1;GG(e<0);
        while(e){if(e&1)ans=ans*x%MOD;x=x*x%MOD;e>>=1;}
        return ans;
    }
    ll invm(ll x){return qpower(x,MOD-2);}
    const int N=1e5+10;

    int fl[N],fr[N];
    void main()
    {
        int n=qread(),k=qread(),q=qread();
        fl[1]=k;
        for(int i=1;i<=q;i++)
        {
            int a=qread();
            fr[a-1]--;fl[a+1]--;
        }
        for(int i=1;i<=n;i++) fl[i]+=fl[i-1];
        for(int i=n;i>=1;i--) fr[i]+=fr[i+1];
        for(int i=1;i<=n;i++) if(fl[i]+fr[i]<=0) puts("No"); else puts("Yes");
    }//(ans+MOD)%MOD
};
int main()
{
    srand(time(0));
    mine::main();
}


Measured memory_bytes: 1408