akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector <int> > vvi;
const int EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 30);
const double PI = acos(-1);

//解説AC

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll H, W;
	cin >> H >> W;
	ll ans = 1e17;
	REP(i, 2) {
		//A,B,Cの3つの三角形に分割すると考える。
		FOR(ALower,1, H) {//Aが上を占めるとき
			ll A = ALower*W;
			//BCを左右で分ける
			int mid = W / 2;
			ll B = (H - ALower) * mid;
			ll C = H * W; C -= A;
			C -= B;
			ll now = max({ A,B,C }) - min({ A,B,C });
			if (ans > now) {
				ans = now;
			}
			//BCを上下で分ける。
			mid = (H - ALower) / 2;
			B = mid * W;
			C = H * W - A - B;
			now = max({ A,B,C }) - min({ A,B,C });
			if (ans > now) {
				ans = now;
			}
		}
		swap(H, W);
	}
	cout << ans << endl;
	PAU;
	return 0;
}


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

#define VARNAME(x) #x
#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using ld = long double;

constexpr ll MOD = 1000000007LL;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 10;

int main()
{
    ll N;
    cin >> N;
    int M = 0;
    ll num = 1;
    for (; 2 * num - 1 <= N; M++, num *= 2LL) {
    }
    ll rest = N - (num - 1);
    vector<int> ans(M);
    for (int i = 0; i < M; i++) {
        ans[i] = i + 1;
    }
    int cnt = M + 1;
    for (int i = M; i >= 0 and rest > 0; i--) {
        if (rest & (1LL << i)) {
            rest -= (1LL << i);
            ans.insert(ans.begin() + i, cnt);
            cnt++;
        }
    }
    const int size = ans.size();
    cout << 2 * size << endl;
    for (int i = 0; i < size; i++) {
        if (i != 0) {
            cout << " ";
        }
        cout << i + 1;
    }
    for (int i = 0; i < size; i++) {
        cout << " " << ans[i];
    }
    cout << endl;
    return 0;
}


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

int main(){
  int a, b;
  cin >> a >> b;
  int i;
  if(b <= 9) i = 10;
  else if(b == 100) i = 1000;
  else i = 100;
  a *= i;
  a += b;
  bool flag = false;
  i = 4;
  while(a >= i * i){
    if(a == i * i) flag = true;
    i++;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


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

int main() {
    int N, M, T;
    cin >> N >> M >> T;
    vector<int> v(T+1);
    for(int i=0; i<N; ++i) {
        int t;
        cin >> t;
        v[max(0, t-M)]++;
        v[min(T, t+M)]--;
    }
    for(int i=0; i<T; ++i) {
        v[i+1] += v[i];
    }
    int res = 0;
    for(int i=0; i<T; ++i) {
        if(v[i] == 0) {
            res++;
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
#define re return
#define pb push_back
#define po pop_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define ss second.second
#define sf second.first
#define ff first.first
#define fs first.second
#define si size
#define sqrt(x) sqrt(abs(x))
#define mp make_pair
#define pi 3.14159265359
#define er erase
#define in insert
#define em empty
#define ft front
#define fo(i,n) for(i = 0; i < n; i++)
#define ro(i,n) for(i = n - 1; i >= 0; i--)
#define fr(i,j,n) for(i = j; i < n; i++)
#define rf(i,j,n) for(i=n-1;i>=j;i--)
typedef std::vector<int> vi;
typedef std::vector<vi> vvi;
typedef std::pair<int,int> ii;
typedef std::vector<ii> vii;
typedef std::vector<std::string> vs;
typedef double dl;
typedef long double ld;
typedef long long ll;
typedef std::pair<ll, ll> pll;
typedef std::vector<ll> vll;
#define filename ""
using namespace std;

int main()
{
    /*
	freopen(filename".in","r",stdin);
	freopen(filename".out","w",stdout);
	*/
	/*
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
    */
    /*
    ios::sync_with_stdio(0);
    */
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    if (d%2)
    {
        cout<<b-a;
    }
    else
    {
        cout<<a-b;
    }
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
string s, t;

int solve() {
    for (int i = 0; i < n; i++) {
        if (s.substr(i) == t.substr(0, n-i)) return 2 * i + (n-i);
    }
    return 2 * n;
}


void input() {
    cin >> n >> s >> t;
}

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

    input();
    cout << solve() << endl;
}

Measured memory_bytes: 256
import Control.Monad
import Control.Applicative
import Data.List

data Dice = Dice{tp::Int, fr::Int, rt::Int, lt::Int, bk::Int, bm::Int} deriving (Show, Eq)

roll :: Dice -> Char -> Dice
roll (Dice tp fr rt lt bk bm) dir
  | dir == 'N' = Dice fr bm rt lt tp bk
  | dir == 'S' = Dice bk tp rt lt bm fr
  | dir == 'E' = Dice lt fr tp bm bk rt
  | dir == 'W' = Dice rt fr bm tp bk lt
  | otherwise = Dice tp fr rt lt bk bm

rolls :: Dice -> String -> Dice
rolls d s = foldl roll d s

initDice :: [Int] -> Dice
initDice (tp:fr:rt:lt:bk:bm:_) = Dice tp fr rt lt bk bm

setDice :: Dice -> Int -> Int -> [Dice]
setDice d t f = d2s
  where
    d1s = filter (\x -> tp x == t) $ scanl roll d "NENEN"
    d2s = (nub . concat) $ do
      d1 <- d1s
      return (filter (\x -> fr x == f) $ scanl rolls d1 ["NES","NES","NES"])

eql :: ([Int], [Int]) -> Bool
eql (xs, ys)
  | d1 `elem` d2s = True
  | otherwise = False
  where d1 = initDice xs
        d2s = setDice (initDice ys) (tp d1) (fr d1)

comb2 :: [a] -> [(a,a)]
comb2 [x,y] = [(x,y)]
comb2 (x:xs) = [(x,y) | y <- xs] ++ comb2 xs

solve :: [[Int]] -> String
solve xs
  | or zs = "No"
  | otherwise = "Yes"
  where
    ys = comb2 xs
    zs = map eql ys
    
main = do
  n <- readLn :: IO Int
  xs <- map (map read . words) <$> replicateM n getLine :: IO [[Int]]
  putStrLn $ solve xs

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

int main()
{
     ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll ans=a*c;
    ans=max(ans,a*d);
    ans=max(ans,b*c);
    ans=max(ans,b*d);
    cout<<ans;
    
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#include <iostream>
#include <functional>
#include <vector>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <math.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define rep1(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define per1(i,a,n) for (int i=a;i>n;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define endl "\n"
#define pi 3.14159265358979323846264338327950288419716939937510
#define IOS cin.sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll mod=1000000007;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll qpow(ll a,ll b){ll s=1;while(b>0){if(b%2==1){s=s*a;}a=a*a;b=b>>1;}return s;}
ll qpowmod(ll a, ll b, ll c){ll res, t;res=1;t=a%c;while(b){if(b & 1){res=res*t%c;}t=t*t%c;b>>=1;}return res;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline long long read(){long long k=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}return k*f;}
inline void write(long long x){if(x<0)x=-x,putchar('-');if(x>9)write(x/10);putchar(x%10+'0');}
// head
ll len,flag;
char s[105];
int main()
{
    //IOS;
    cin>>s;
    len=strlen(s);
    for(int i=0;i<=(len-1)/2-1;i++)
    {
        if(s[i]!=s[len-1-i])
        {
            flag=1;
            break;
        }
    }
    for(int i=0;i<=(len-1)/4;i++)
    {
        if(s[i]!=s[(len-1)/2-1-i])
        {
            flag=1;
            break;
        }
    }
    if(flag==0)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;
}
/*

*/


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

def main():
    R, C, N = map(int, input().split())
    xyxy = [list(map(int, input().split())) for i in range(N)]

    r = []

    for i in range(N):
        x1, y1, x2, y2 = xyxy[i]
        # どちらも周上にある場合は周上の座標に変換してから記録
        if ((x1 == 0 or x1 == R) or (y1 == 0 or y1 == C)) and ((x2 == 0 or x2 == R) or (y2 == 0 or y2 == C)):
            # １つ目
            if x1 == 0:
                r.append((y1, i))
            elif x1 == R:
                r.append((C - y1 + C + R, i))
            elif y1 == 0:
                r.append((R - x1 + C * 2 + R, i))
            else:
                r.append((x1 + C, i))
            # 2つ目
            if x2 == 0:
                r.append((y2, i))
            elif x2 == R:
                r.append((C - y2 + C + R, i))
            elif y2 == 0:
                r.append((R - x2 + C * 2 + R, i))
            else:
                r.append((x2 + C, i))
    
    r = sorted(r)
    # print(r)
    stack = []
    for i in range(len(r)):
        if len(stack) > 0:
            if stack[-1] == r[i][1]:
                stack.pop()
            else:
                stack.append(r[i][1])
        else:
            stack.append(r[i][1])
    
    if len(stack) > 0:
        print("NO")
    else:
        print("YES")
            



if __name__ == "__main__":
    main()

Measured memory_bytes: 56140
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define ite ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n,m,l;
  while(cin>>n>>m>>l,m||n||l){
    int out[1001][101]={0};
    rep(i,m){
      int a,b,c;
      cin>>a>>b>>c;
      out[a][b]=c;out[a][c]=b;
    }
    for(int i=1000;i>=0;i--){
      if(out[i][l])l=out[i][l];
    }
    cout<<l<<endl;
  }
}

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

public class Main {
    public static void main(String[] args) {
        try {
            // 標準入力
            InputStreamReader isr = new InputStreamReader(System.in);
            BufferedReader br = new BufferedReader(isr);
            String strArr[] = br.readLine().split(" ");
            String str1 = strArr[0];
            String str2 = strArr[1];
            String str3 = strArr[2];
            System.out.print(str1.charAt(0));
            System.out.print(str2.charAt(0));
            System.out.println(str3.charAt(0));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

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

struct node
{
int key;
struct node *left, *right;
};
  

struct node *newNode(int item)
{
struct node *temp =  (struct node *)malloc(sizeof(struct node));
temp->key = item;
temp->left = temp->right = NULL;
return temp;
}
  

void Preorder(struct node* root)
{
static int hit=0;

if (root == NULL)
  return;
 

  printf(" ");
printf("%d",root->key);
hit=1;
Preorder(root->left); 
 
   
Preorder(root->right);
} 

void inorder(struct node *root)
{
static int h=0;

if (root != NULL)
  {

inorder(root->left);

printf(" ");
printf("%d", root->key);
h=1;
inorder(root->right);
}
}
  

struct node* insert(struct node* node, int key)
{
    
    if (node == NULL) return newNode(key);
    
    
    if (key < node->key)
        node->left  = insert(node->left, key);
    else if (key > node->key)
        node->right = insert(node->right, key);
    
    
    return node;
}
  

int main()
{
int z,n,i;
char str[7];
   
struct node *root = NULL;
scanf("%d",&n);

for(i=0;i<n;i++){
scanf("%s",str);
if(strcmp(str,"insert")==0)
  scanf("%d",&z);
if(i==0)
  root = insert(root, z);
 else insert(root, z);

if(strcmp(str,"print")==0){
  
    
   
inorder(root);
printf("\n");
Preorder(root);
printf("\n");
}}
return 0;
}



Measured memory_bytes: 18288
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
import string
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    n = int(input())
    n -= 1

    sol = []

    while n != -1:
        sol.append(string.ascii_lowercase[n % 26])
        n //= 26
        n -= 1

    print(*sol[::-1], sep='')


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


Measured memory_bytes: 65764
import java.util.*;
 
public class Main {
  public static void main(final String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    
    
    if(A==B && B==C){
    System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

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

int A[3];

int main() {
    rep(i, 3) cin >> A[i];
    sort(A, A + 3); 

    int cost = 0;
    for (int i = 1; i <= 2; i++) {
       cost += A[i] - A[i - 1]; 
    }

    cout << cost << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(int argc,char *argv[]){

  int i,n,q,s[100000],t,min,max,mid,count = 0;

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

  scanf("%d",&q);
  while(q--){
    scanf("%d",&t);
    min = 0;
    max = n - 1;
    while(min <= max){
      mid = (min + max) / 2;
      if(t == s[mid]){
	count++;
	break;
      }
      else if(t < s[mid])max = mid - 1;
      else if(t > s[mid])min = mid + 1; 
   }
  }
  printf("%d\n",count);
  return 0;
}

Measured memory_bytes: 988
#include<iostream>
using namespace std;
int main()
{
	int A,B,C;
  cin>>A>>B>>C;
    if(A==B & B!=C)
      cout<<"Yes";
  else if(A==C & B!=C)
    cout<<"Yes";
  else if(B==C & A!=B)
    cout<<"Yes";
  else
    cout<<"No";
    	
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

// list up all factors
template <typename T>
set<T> factors(T a) {
    set<T> facs;
    for (T i = 1; i * i <= a; ++i) {
        if (a % i == 0) {
            facs.insert(i);
            facs.insert(a / i);
        }
    }
    return facs;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint n;
    cin >> n;
    auto facs  = factors(n - 1);
    auto facs2 = factors(n);
    // set<lint> facs;
    // for (int i = 1; i <= n; ++i) {
    //     facs.insert(i);
    // }
    facs.erase(1);
    facs2.erase(1);
    set<lint> ret;
    for (auto &f : facs) {
        lint t = n;
        while (f <= t) {
            if (t % f == 0)
                t /= f;
            else
                t -= (t / f) * f;
        }
        if (t == 1)
            ret.insert(f);
    }
    for (auto &f : facs2) {
        lint t = n;
        while (f <= t) {
            if (t % f == 0)
                t /= f;
            else
                t -= (t / f) * f;
        }
        if (t == 1)
            ret.insert(f);
    }
    if (n != 2)
        ret.insert(n - 1);
    cout << ret.size() << "\n";
    return 0;
}

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

#define ll long long
#define PB push_back
#define MP make_pair

#define REP(i, n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,h) for(int i=(int)(l);i<=(int)(h);++i)
#define FORD(i,h,l) for(int i=(int)(h);i>=(int)(l);--i)

//#define max(a,b) a>b?a:b
//#define min(a,b) a>b?b:a

ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

#define dump(x)  cerr << #x << " = " << (x) << endl
#define ALL(t) (t).begin(),(t).end()

using namespace std;

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

int sum() { return 0; }

template<typename T, typename... Args>
T sum(T a, Args... args) { return a + sum(args...); }




int n,k;
const int MX = 100005;
int v[MX];
int memo[MX]; //  initialise as -1
int min_Cost(int i){
	if(i >= n-1) return 0;

	if(memo[i] != -1){
		return memo[i];
	}
	int step1 , step2;
	memo[i] = INT_MAX;
	for (int j = 1; j <= k; ++j)
	{
	     if(i+j < n) step1 = abs(v[i] - v[i+j]) + min_Cost(i+j);
	     else step1 = INT_MAX;

	     memo[i] = min(memo[i] , step1);
	}
	return memo[i];
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	//int n;
	cin>>n>>k;
	//std::vector<int> v(n);
	//memset(memo , -1, sizeof(memo));
	REP(i,n) cin>>v[i];
	REP(i,n) memo[i] = -1;
	cout<<min_Cost(0);
	return 0;
}


Measured memory_bytes: 12196
a=input()
b=input()
a1=a[0]
a2=a[1]
a3=a[2]
b1=b[0]
b2=b[1]
b3=b[2]
if a1==b3 and a2==b2 and a3==b1:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3060
#include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#include <valarray>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <complex>
#include <list>
#include <time.h>
#include <stack>
#include <locale>
#include <clocale>
#include <ctype.h>
#include <wchar.h>

using namespace std;
typedef long long int LL;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)


int xcomp(vector<LL>& a, vector<LL>& b) {
	return a[0] < b[0];
}

#define XSORT(c) sort((c).begin(),(c).end(),xcomp)

#define ALL(x) (x).begin(),(x).end()
LL mod = 1000000007;

int main() {
	LL N;
	cin >> N;
	vector<LL> v(N);

	REP(i, N) {
		cin >> v[i];
	}
	SORT(v);

	LL fourmax = 0;
	LL twomax = 0;
	LL twomax2 = 0;

	REP(i, v.size()) {
		if (i + 3 < v.size()){
			if (v[i] == v[i + 1] && v[i] == v[i + 2] && v[i] == v[i + 3]) {
				fourmax = v[i];
			}
		}
		if (i + 1 < v.size()) {
			if (v[i] == v[i + 1]) {
				if (twomax != v[i]) {
					twomax2 = twomax;
					twomax = v[i];
				}
			}
		}
	}
	cout << max(fourmax*fourmax, twomax*twomax2) << endl;
}

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

using namespace std;

int main(void){
    int a,b,c;
    scanf("%d%d%d", &a, &b, &c);
    int ispoor= 0;
    if(a==b&&b!=c)ispoor= 1;
    if(b==c&&c!=a)ispoor= 1;
    if(c==a&&a!=b)ispoor= 1;
    if(ispoor) {
            puts("Yes");
    }else{
        puts("No");
    }
    return 0;

}


Measured memory_bytes: 3744
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<utility>
#include<set>
#include<map>
#include<stack>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define stop char nyaa;cin>>nyaa;

int n; ll a, b;
void solve() {
	vector<LP> v[5];
	rep(i, 5)v[i].push_back({ 0,0 });
	cin >> n >> a >> b;
	vector<LP> le, ri;
	rep(i, n) {
		int t; cin >> t; t--;
		ll x, y; cin >> x >> y;
		v[t].push_back({ x,y });
	}
	rep(i, v[0].size()) {
		rep(j, v[1].size()) {
			LP nex = { 0,0 };
			nex.first = v[0][i].first + v[1][j].first;
			nex.second = v[0][i].second + v[1][j].second;
			le.push_back(nex);
		}
	}
	rep(i, v[2].size()) {
		rep(j, v[3].size()) {
			rep(k, v[4].size()) {
				LP nex = { 0,0 };
				nex.first = v[2][i].first + v[3][j].first + v[4][k].first;
				nex.second = v[2][i].second + v[3][j].second + v[4][k].second;
				ri.push_back(nex);
			}
		}
	}
	sort(le.begin(), le.end());
	sort(ri.begin(), ri.end());
	ll x = le[0].first;
	multiset<ll> st;
	//[l,r)
	int l = (int)ri.size(), r = ri.size();
	rep(i, ri.size()) {
		ll sum = ri[i].first + le[0].first;
		if (sum >= a && sum <= b) {
			st.insert(ri[i].second);
		}
		if (ri[i].first >= a - le[0].first) {
			l = min(l, i);
		}
		if (ri[i].first > b - le[0].first) {
			r = min(r, i);
		}
	}
	{
		ll cl = a - le[0].second, cr = b - le[0].second;
		if (st.count(cl)) {
			cout << "Yes" << endl; return;
		}
		st.insert(cl);
		auto itr = st.find(cl);
		itr++;
		if (itr != st.end()) {
			ll z = *itr;
			if (z <= cr) {
				cout << "Yes" << endl; return;
			}
		}
		st.erase(st.find(cl));
	}
	rep1(i, (int)le.size()-1) {
		while (l > 0 && le[i].first + ri[l-1].first >= a) {
			l--;
			st.insert(ri[l].second);
		}
		while (r > 0 && le[i].first + ri[r-1].first > b) {
			r--;
			st.erase(st.find(ri[r].second));
		}
		ll cl = a - le[i].second, cr = b - le[i].second;
		if (st.count(cl)) {
			cout << "Yes" << endl; return;
		}
		st.insert(cl); 
		auto itr = st.find(cl);
		itr++;
		if (itr != st.end()) {
			ll z = *itr;
			if (z <= cr) {
				cout << "Yes" << endl; return;
			}
		}
		st.erase(st.find(cl));
	}
	cout << "No" << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(6);
	solve();
	//stop
		return 0;
}


Measured memory_bytes: 67420
#include <iostream>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <unordered_map>
#include <cassert>
#include <unordered_set>
#include <cmath>
#include <cstring>
#include <deque>
#include <math.h>
#include <stack>
#include <iomanip>
 
using namespace std;
 
#define ll long long
#define ld long double


int a[100100];


int gcd(int a, int b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
}


int main() {
	int n, k;
	scanf("%d %d", &n, &k);
	int g = a[1];
	int maxim = 0;
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &a[i]);
		g = gcd(g, a[i]);
		maxim = max(maxim, a[i]);
	}
	if (k % g == 0 && k <= maxim) {
		puts("POSSIBLE");
	} else {
		puts("IMPOSSIBLE");
	}
    return 0;
}










Measured memory_bytes: 760
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;


public class Main {

	final double EPS=1e-7;
	Scanner sc;
	
	class Pair{
		public int first;
		public double second;
		public Pair(int a,double b){
			first=a;
			second=b;
		}
		public String toString(){
			return first+" "+second;
		}
	}
	
	class PairComparator implements Comparator<Pair>{

		//第一要素で比較する⇒true
		private boolean first;
		PairComparator(boolean first){
			this.first=first;
		}

		@Override
		public int compare(Pair o1, Pair o2) {
			// TODO Auto-generated method stub
			if(first){
				return o1.first-o2.first;
			}
			else{
				double d1=o1.second,d2=o2.second;
				if(Math.abs(d1-d2)<EPS) return 0;
				else if(d1<d2) return -1;
				else return 1;
			}
		}
	}
	
	int ni(){
		return sc.nextInt();
	}
	double nd(){
		return sc.nextDouble();
	}

	void io(){
		sc=new Scanner(System.in);
		Pair[][] group;
		group=new Pair[3][8];
		
		for(int i=0;i<3;++i){
			for(int j=0;j<8;++j){
				group[i][j]=new Pair(ni(),nd());
			}
		}
		
		Pair[] loser=new Pair[18];
		int j=0;
		
		for(Pair[] g:group){
			Arrays.sort(g,new PairComparator(false));
			for(int i=0;i<2;++i){
				System.out.println(g[i]);
			}
			for(int i=2;i<8;++i)loser[j++]=g[i];
		}
		Arrays.sort(loser,new PairComparator(false));
		for(int i=0;i<2;++i)System.out.println(loser[i]);
		sc.close();
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Main().io();
	}

}

Measured memory_bytes: 18328
#include<bits/stdc++.h>
using namespace std;
int dp[100005][105],num[100005],k;
int main()
{
	int n;
	scanf("%d %d",&n,&k);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&num[i]);
	}
	num[0]=10000000;
	for(int i=2;i<=n;i++)
	{
		for(int j=1;j<=k;j++)
		{
			if(i-j<=0)dp[i][j]=1000000;
			else
			{
				int o=INT_MAX;
				for(int jj=1;jj<=k;jj++)
				{
					o=min(o,dp[i-j][jj]);
				}
				dp[i][j]=o+abs(num[i]-num[i-j]);	
			}
		}
	}
	int o=INT_MAX;
	for(int jj=1;jj<=k;jj++)
	{
		o=min(o,dp[n][jj]);
		//printf("%d\n",dp[n][jj]);
	}
	printf("%d",o);
}

Measured memory_bytes: 41600
x_1, y_1, x_2, y_2 = map(int, input().split())

x = x_2 - x_1
y = y_2 - y_1

x_3 = x_2 - y
y_3 = y_2 + x

x_4 = x_1 - y
y_4 = y_1 + x

print(x_3, y_3, x_4, y_4)

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

int a,b,c,k,dc;

int main(){
	cin>>a>>b>>c>>k;
	if(k<=a){
	cout<<k;
	return 0;
}
	if(k<=a+b){
	cout<<a;
	return 0;
}
	dc=k-a-b;
   cout<<a-dc;
}

Measured memory_bytes: 3604
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int ab = a * b;
		int cd = c * d;

		if(ab > cd) {
			System.out.println(ab);
		}else if (ab < cd) {
			System.out.println(cd);
		}else {
			System.out.println(ab);
		}
	}
}


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

int main(){
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	int sum = a[0] + a[1] + a[2];
	if(sum >=22) cout << "bust" << endl;
	else cout << "win" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
using namespace std;

int N, M;

void dfs(int curr, vector<vector<int>>& map, 
	vector<bool>& visited) {
	if (visited[curr]) return;
	visited[curr] = true;

	for (int i = 0; i < map[curr].size(); i++) {
		dfs(map[curr][i], map, visited);
	}
}

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

	vector<vector<int>> map(N + 1);
	vector<bool> visited(N + 1, false);

	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;

		map[A].push_back(B);
		map[B].push_back(A);
	}
	
	int cnt = 0;
	for (int i = 1; i <= N; i++) {
		if (!visited[i]) {
			dfs(i, map, visited);
			cnt++;
		}
	}
	cout << cnt-1 << endl;
}

Measured memory_bytes: 9140
#include<iostream>
#include<cstring>
using namespace std;
int main() {
	char a[15], b[15], c[15];
	int as, bs;
	cin >> a >> b;
	cin >> as >> bs;
	cin >> c;
	if (!strcmp(a, c)) {
		as--;
	}
	else {
		bs--;
	}
	cout << as << ' ' << bs;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int a,b,c,i,j,k,l,count;
	int y[c];
	
	scanf("%d %d %d\n",&a,&b,&c);
	
	for(i=1;i<=c;i++){
		if(c%i == 0){
			for(j=a;j<=b;j++){
				if(j == i) count++;
			}
		}
	}
	printf("%d\n",count);
	return 0;
}


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

int main(){
    string t; cin>>t;
    REP(i,t.size()){
        if(t.find("?")<t.size()) t.replace(t.find("?"),1,"D");
        else break;
    }
    cout << t << endl;
}

Measured memory_bytes: 3764
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}

	static class Task {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			String S = in.next();
			String ans = "No";
			for(int i = 0; i < S.length(); i++) {
				if(i % 2 == 0 && (S.charAt(i) == 'R' || S.charAt(i) == 'U' || S.charAt(i) == 'D')) {
					ans = "Yes";
				} else if(i % 2 != 0 && (S.charAt(i) == 'L' || S.charAt(i) == 'U' || S.charAt(i) == 'D')) {
					ans = "Yes";
				} else {
					ans = "No";
					break;
				}
			}
			System.out.println(ans);
			
		}
	}
	
	static boolean permutation_2(String s, String t){
        if(s.length() != t.length()){
            return false;
        }
        
        int[] letters = new int[256]; //文字コードの仮定;
        
        char[] s_array = s.toCharArray();  
        for(char c:s_array){
            letters[c]++;
        }
        
        for(int i=0;i<t.length();i++){
            int c = (int)t.charAt(i);
            if(--letters[c] < 0){
                return false;
            }
        }
        return true;
    }

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

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

		public char nextChar() {
			return next().charAt(0);
		}

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

		public double nextDouble() {
			return Double.parseDouble(next());
		}

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

	}
}


Measured memory_bytes: 23376
#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll d,g;
  cin>>d>>g;
  vll p(d),c(d);
  rep(i,d) cin>>p[i]>>c[i];
  ll ans=INF;
  for(int bit=0;bit<(1<<d);bit++){
    ll cu=0;
    ll k=0;
    ll o=0;
    for(int i=0;i<d;i++){
      if(bit&(1<<i)){
        cu+=p[i];
        k+=(i+1)*100*p[i]+c[i];
      }
      else{
        o=i;
      }
    }
    if(k>=g){
      ans=min(cu,ans);
    }
    else {
      ll j=(g-k+(o+1)*100-1)/((o+1)*100);
      if(j<p[o]){
      ans=min(ans,cu+j);
      }
    }
  }
  COUT(ans);
}


Measured memory_bytes: 256
# ABC162_B
n=int(input())
a=[]
# for i in range(1,10**6+1):
#     if i%3==0 and i%5==0:
#         a.append(i)
# ans=0
# for i in range(n):
#     ans+=a[i]
# print(ans)
for i in range(1,10**6+1):
    if i%15==0:
        a.append("z")
    elif i%3==0:
        a.append("z")
    elif i%5==0:
        a.append("z")
    else:
        a.append(i)
# print(a)
        
ans=0
for i in range(n):
    if a[i]!="z":
        ans+=a[i]
print(ans)

Measured memory_bytes: 33900
import math
a,b=input().split()
a=int(a)

if '.' not in b:
    print(a*int(b))
else:
    if b[-2] == '.':
        b = b.replace('.', '')
        b = int(b)
        print(a*b//10)
    else:
        b = b.replace('.', '')
        b = int(b)
        print(a*b//100)

Measured memory_bytes: 9140
s = input()
if s == "SAT":
  print("1")
elif s == "FRI":
  print("2")
elif s == "THU":
  print("3")
elif s == "WED":
  print("4")
elif s == "TUE":
  print("5")
elif s == "MON":
  print("6")
else:
  print("7")

Measured memory_bytes: 2940
from itertools import zip_longest, chain

s = input()

sign_amount = len(s)-1
table = str.maketrans("01", " +")

sum_num = 0
for i in range(2 ** sign_amount):
	bin_str = bin(i)[2:].zfill(sign_amount)
	signs = bin_str.translate(table)
	formula = "".join(chain(*zip_longest(s, signs, fillvalue=" "))).replace(" ", "")
	sum_num += eval(formula)

print(sum_num)

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

void swap(int &a, int &b){
	int tmp = a;
	a = b;
	b = tmp;
}

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

	int cnt = 0;
	for(int i=0; i<n; i++){
		for(int j=n-2; j>=i; j--){
			if(a[j]>a[j+1]){
				swap(a[j], a[j+1]);
				cnt++;
			}
		}
	}

	for(int i=0; i<n-1; i++){
		cout << a[i] << " ";
	}
	cout << a[n-1] << endl;
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 1160
//?????????????????????????????????????????????
using System;

namespace DefaultNamespace
{
	/// <summary>
	/// Description of Class1.
	/// </summary>
	public class Class1
	{
		public static void Main(String[] args)
		{				
			var listA = new listArray();
			listA.start();
			listA.finish();
		}
	
	}

	public class listArray
	{
		public int first = 0;
		public int last = 0;
		public int[] list = new int[1000000];
		
		public void start()
		{
			int n = int.Parse(Console.ReadLine());
			for (int i = 0; i < n; i++) {
				string com = Console.ReadLine();
				string[] command = com.Split();
				switch (command[0]) {
					case "insert":
						list[first] = int.Parse(command[1]);//first?????¨????????????first-1????????????????????\??£?????????
						first++;
						break;
					case"deleteFirst":
						//deleteFirst();
						first--;
						while (list[first - 1] == -1) {
							first--;
						}
					
						break;
					case"deleteLast":
						//deleteLast();
						
						last++;
						while (list[last] == -1) {
							last++;
						}
						
						break;
					case "delete":
						//delete(int.Parse(command[1]));
						for (int j = first - 1; j >= last; j--) {
							if (list[j] == int.Parse(command[1])) {
								list[j] = -1;//?????????????????????-1???????????????
								while (list[first - 1] == -1) {
									first--;
								}
								while (list[last] == -1) {
									last++;
								}
								break;
							}
						}
						
						
						break;				
				}
			}
		}
		/*
		public void insert(int val)
		{
			list[first]=val;//first?????¨????????????first-1????????????????????\??£?????????
			first++;
		}
		
		public void deleteFirst()
		{
			first--;
			while(list[first-1]==-1)
			{
				first--;
			}
		}
		
		public void deleteLast()//last???????????\??£????????????
		{
			last++;
			while(list[last]==-1)
			{
				last++;
			}
		}
		
		public void delete(int val)
		{
			for(int j=first-1;j>=last;j--)
			{
				if(list[j]==val)
				{
					list[j]=-1;//?????????????????????-1???????????????
					while(list[first-1]==-1)
					{
						first--;
					}
					while(list[last]==-1)
					{
						last++;
					}
					return;
				}
			}
			return;
		}
		*/
		public void finish()
		{
			for (int k = first - 1; k > last; k--) {
				if (list[k] != -1) {
					Console.Write(list[k] + " ");
				}				
			}			
			Console.WriteLine(list[last]);	
		}
	}
}

Measured memory_bytes: 16448
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

using namespace std;

class DDigitsParade {
public:

int f(char c){
    return c - '0';
}

void solve(std::istream& cin, std::ostream& cout) {
    string S;
    cin >> S;
    int n = S.size();
    vector<vector<int64_t>> DP(n + 1, vector<int64_t>(13));
    DP[0][0] = 1;
    int d = 1;
    int p = int(1e9) + 7;

    for (int i = 0; i < n; i++){
        for (int j = 0; j < 13; j++){
            DP[i][j] %= p;
            char s = S[n - i - 1];
            if (s == '?'){
                for (int k = 0; k < 10; k++)
                    DP[i + 1][(j + k * d) % 13] += DP[i][j];
            } else {
                int k = (j + f(s) * d) % 13;
                DP[i + 1][k] += DP[i][j];
            }
        }
        d = d * 10 % 13;
    }

    cout << DP[n][5] % p << endl;
}
};

int main() {
	DDigitsParade solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 13696
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    h,w = map(int, input().split())
    d = []
    for _ in range(h):
        d.append(list(map(int, input().split())))
    
    res = []
    for i in range(h):
        for j in range(w):
            if j == w-1 and i < h-1:
                if d[i][j]%2 == 1:
                    res.append([i+1, j+1, i+2, j+1])
                    d[i+1][j] += 1
                continue
            if d[i][j]%2 == 1 and j < w-1:
                res.append([i+1, j+1, i+1, j+2])
                d[i][j+1] += 1
    print(len(res))
    for i in res:
        print(*i)

if __name__ == '__main__':
    main()

Measured memory_bytes: 70236
using System;
class Program
{
    static void Main(string[] args)
    {
        var x = long.Parse(Console.ReadLine());
        var money = (long)100;
        for (int i = 0; i < 100000; i++)
        {
            money = Calc(money);
            if (money >= x)
            {
                Console.WriteLine(i + 1);
                break;
            }
            if (money > Math.Pow(10, 18))
            {
                break;
            }
        }
        // Console.WriteLine(money);
    }

    static long Calc(long input)
    {
        var a = Math.Floor(input * 0.01);
        return input + (long)a;
    }
}

Measured memory_bytes: 18132
n,q=map(int,input().split())
s=input()

len=len(s)
L=[0]*len
R=[0]*len
res=s.count("AC")

cnt=0
for i in range(len-1):
	if s[i]=="A" and s[i+1]=="C":
		cnt+=1
	L[i+1]=cnt

cnt=0
for i in range(len-1):
	if s[len-i-1]=="C" and s[len-i-2]=="A":
		cnt+=1
	R[len-i-2]=cnt

for _ in range(q):
	l,r=map(int,input().split())
	print(res-L[l-1]-R[r-1])

Measured memory_bytes: 8532
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <limits>
#include <map>
#include <regex>
#define REP(i,n) for(long (i)=0;(i)<(n);(i)++)
#define REPI(i,a,b) for(long (i)=(a);(i)<(b);(i)++)
#define INF numeric_limits<double>::infinity()
constexpr long MOD = 1e9 + 7;
using namespace std;
using P = pair<long, long>;
using VI = vector<long>;

int cnt[3];

int main() {
    string s;
    cin >> s;
    REP(i,s.size()) {
        cnt[s[i] - 'a']++;
    }
    
    sort(cnt, cnt+3);
    if (cnt[2] - cnt[0] <= 1) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 512
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <utility>
#include <functional>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <iomanip>
#include <numeric>
#include <complex>

using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const int INF = (1<<30);
const ll INFL = (1LL<<62);
const int MOD = 1000000007;
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<class T> ll mod_pow(ll a, ll n, T mod) { mod=(ll)mod; ll res=1, p=a%mod; while(n){ if(n&1) res=res*p%mod; p=p*p%mod; n>>=1; } return res; }

template<typename T>
struct edge {
    int from, to;
    T cost;
};

int main() {
    int N, M;
    cin >> N >> M;
    vector<edge<ll> > g(M);
    vector<ll> dist(N);
    fill(all(dist), INFL);
    rep(i, M){
        int a, b, c;
        cin >> a >> b >> c;
        a--, b--;
        c = (ll)(-c);
        g[i] = {a, b, c};
    }
    dist[0] = 0;
    rep(j, N-1){
        rep(i, M){
            edge<ll> e = g[i];
            if(dist[e.from] != INFL && dist[e.to] > dist[e.from] + e.cost){
                dist[e.to] = dist[e.from] + e.cost;
            }
        }
    }
    vector<bool> negative(N);
    fill(all(negative), false);
    ll ans = dist[N-1];
    rep(j, N){
        rep(i, M){
            edge<ll> e = g[i];
            if(dist[e.from] != INFL && dist[e.to] > dist[e.from] + e.cost){
                dist[e.to] = dist[e.from] + e.cost;
                negative[e.to] = true;
            }
            if(negative[e.from]){
                negative[e.to] = true;
            }
        }
    }
    if(negative[N-1]) cout << "inf" << endl;
    else cout << -ans << endl;
    return 0;
}

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

int main() {
    short r, g, b;
    cin >> r >> g >> b;

    short target = 100*r + 10*g + b;
    if (target >= 4 && target % 4 == 0) cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.text.*;
import java.math.*;
import static java.lang.Integer.*;
import static java.lang.Double.*;
import java.lang.Math.*;

public class Main {

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

	public void run() throws Exception {
		FastIO file = new FastIO();
		boolean[] b = new boolean[1000001];
		int n = file.nextInt();
		b[n] = true;
		for (int i = 2;; i++) {
			if (n % 2 == 0) n /= 2;
			else n = n * 3 + 1;
			if (b[n]) {
				System.out.println(i);
				break;
			}
			b[n] = true;
		}
	}

	public static class FastIO {
		BufferedReader br;
		StringTokenizer st;

		public FastIO() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

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

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	public static long pow(long n, long p, long mod) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n % mod;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2, mod);
			return (temp * temp) % mod;
		} else {
			long temp = pow(n, p / 2, mod);
			temp = (temp * temp) % mod;
			return (temp * n) % mod;

		}
	}

	public static long pow(long n, long p) {
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		if (p % 2 == 0) {
			long temp = pow(n, p / 2);
			return (temp * temp);
		} else {
			long temp = pow(n, p / 2);
			temp = (temp * temp);
			return (temp * n);

		}
	}

	public static long gcd(long x, long y) {
		if (x == 0)
			return y;
		else
			return gcd(y % x, x);
	}

	public static boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}
}


Measured memory_bytes: 22484