akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  N = readInts()[0]
  A = readInts()
  T = [(A[i], i+1) for i in range(N)]
  T.sort()

  print(" ".join(map(lambda t: str(t[1]), T)))

if __name__ == "__main__":
  main()


Measured memory_bytes: 24104
/* AtCoder Beginner Contest abc137
 * Problem B
 * Au: SJoshua
 */
#include <cstdio>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main(void) {
	int k, x;
	cin >> k >> x;
	for (int i = x - k + 1; i <= x + k - 1; i++) {
		cout << i << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

/*
<url:>
問題文============================================================

=================================================================

解説=============================================================

================================================================
*/

struct edge{
    ll u;
    ll v;
    ll cost;
    
    ll l;
    ll r;
    edge(){}
    edge(ll u,ll v,ll cost,ll l,ll r):u(u),v(v),cost(cost),l(l),r(r){}
};

ll N,M;
vector<ll> L,R,D;
vector<vector<edge>> G;
vector<ll> loc;
vector<ll> check;

bool dfs(ll n,bool from){
    if(check[n] == 1) return true;
    check[n] = 1;
    if(from){
        loc[n] = 0;
    }
    for(auto e:G[n]){
 //       cout << e.u << " " << e.v << " " << e.cost << " " << e.l << " " << e.r << endl;
        if(loc[e.l] == INF){
            loc[e.l] = loc[e.r] - e.cost;
            if(!dfs(e.l,false)) return false;
            
            continue;
        }
        
        if(loc[e.r] == INF){
            loc[e.r] = loc[e.l] + e.cost;
            if(!dfs(e.r,false)) return false;
            
            continue;
        }
        
        if(loc[e.r] - loc[e.l] != e.cost) return false;
    }
    return true;
}
int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    cin >> N >> M;
    L.resize(M);R.resize(M);D.resize(M);
    loc.resize(N,INF); check.resize(N);
    for(int i = 0; i < M;i++){
        cin >> L[i] >> R[i] >> D[i];
        L[i]--; R[i]--;
    }
    
    G.resize(N);
    for(int i = 0; i < M;i++){
        G[L[i]].push_back(edge(L[i],R[i],D[i],L[i],R[i]));
        G[R[i]].push_back(edge(R[i],L[i],D[i],L[i],R[i]));
    }
    
    for(int i = 0; i < N;i++){
        if(!dfs(i,true)){
            cout << "No" << endl;
            return 0;
        }
    }
    
 //   cout << loc[6] << " " << loc[7] << " " << loc[8] << endl;
    cout << "Yes" << endl;
    return 0;
}



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

int main(){
  string N;
  cin >> N;
  if (N[0] == N[1] && N[1] == N[2]){
    cout << "Yes" << endl;
  } else if (N[1] == N[2] && N[2] == N[3]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

}


Measured memory_bytes: 256
import std.stdio;
import std.ascii;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.random;
import std.regex;
import std.typecons;

class TreeMap(K, V) {
    alias RedBlackTree!(Tuple!(K, V), "a[0] < b[0]", false) T;
    T rbtree;
    this() {
        rbtree = new T;
    }
    V opIndex(K key) {
        return rbtree.equalRange(tuple(key, V.init)).front[1];
    }
    V opIndexAssign(V value, K key) {
        rbtree.insert(tuple(key, value));
        return value;
    }
}

struct P {
    int id, score;
}

void main() {
    //auto map = redBlackTree!("a[0] < b[0]", false, Tuple!(int, int));
    auto map = new TreeMap!(int, int);
    string s;
    P[] ps;
    while (true) {
        s = readln.chomp;
        if (s == "0,0") break;
        auto t = s.split(",").map!(to!int);
        int id = t[0],
            score = t[1];
        ps ~= P(id, score);
    }
    ps.sort!"a.score > b.score";
    int prev_score = ps[0].score;
    int cur_rank = 1;
    for (int i = 0; i < ps.length; i++) {
        if (prev_score == ps[i].score) {
            map[ ps[i].id ] = cur_rank;
        } else {
            cur_rank++;
            map[ ps[i].id ] = cur_rank;
            prev_score = ps[i].score;
        }
    }
    while (true) {
        s = readln.chomp;
        if (stdin.eof) break;
        int x = s.to!int;
        writeln(map[x]);
    }
}

Measured memory_bytes: 1172
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
 
int main(){
    int n;
    cin >> n;
    vec<int> a(n);
    rep(i, n) cin >> a[i];
    vector<size_t> indices(a.size());
    iota(indices.begin(), indices.end(), 0);

    sort(indices.begin(), indices.end(), [&a](size_t i1, size_t i2) {
        return a[i1] < a[i2];
    });

    for (auto v : indices)
        cout << v+1 << " ";
    cout << endl;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;

const int MOD = 1e9 + 7;
const int INF = 1001001001;

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

    int x = g*10 + b;
    if(x % 4 == 0){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}

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

using namespace std;

int main() {
	int n;

	while(true) {
		cin >> n;

		if(!n) {
			break;
		}

		vector< int > k(n);
		string str;
		string st = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
		vector< string > ans;

		for(int i = 0; i < n; i++) {
			cin >> k[i];
		}
		cin >> str;

		int count = 0;

		for(int i = 0; i < str.size(); i++) {
			for(int j = 0; j < st.size(); j++) {
				if(str[i] == st[j]) {
					cout << st[(j - k[count] + 52) % 52];
					break;
				}
			}
			count++;
			if(count == k.size()) {
				count = 0;
			}
		}
		cout << endl;
	}
}

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

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

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

    for(int i = 0; i < m; i++){
        cin >> a >> b >> c;
        d[a][b] = c;
    }

    for(int k = 0; k < n; k++){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < n; j++){
                if(d[i][k] == 0 || d[k][j] == 0)    continue;
                d[i][j] = max(d[i][j], d[i][k]+d[k][j]);
            }
        }
    }

    cout << d[0][n-1] << endl;

    return 0;
}


Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,W;
  cin >> H >> W;
  vector<string> S(H);
  vector<string> T(H+2);
  for (int i = 0; i < H; i++){
    cin >> S.at(i);//まずSに世界を入力
  }
  
  //T.at[0]:0をW+2個
  T.at(0) = "";
  for (int i = 0; i < W + 2; i++){
    T.at(0) = T.at(0) + "0";
  }
  
  //T.at[1]~T.at[H]:0+(世界)+0
  for (int i = 1; i <= H; i++){
    T.at(i) = "0" + S.at(i - 1) + "0";
  }
  
  //T.at[H+1]:0をW+2個
  T.at(H+1) = "";
  for (int i = 0; i < W + 2; i++){
    T.at(H+1) = T.at(H+1) + "0";
  }
  
  //これで世界Sを0で囲ったTができた
  
  //Tで爆弾があれば、その周りに1を足していく
  vector<string> U(H);
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      if (T.at(i).at(j) == '#'){
        for (int k = i - 1; k <= i + 1; k++){
          for (int l = j - 1; l <= j + 1; l++){
            if (T.at(k).at(l) == '.'){
              T.at(k).at(l) = '0' + 1;
            }
            else if (T.at(k).at(l) == '#'){
              continue;
            }
            else {
              T.at(k).at(l) += 1;
            }
          }
        }
      }
    }
  }
  
  //TからSを切り取る
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      if (T.at(i).at(j) == '.'){
        T.at(i).at(j) = '0';
      }
      cout << T.at(i).at(j);
    }
    cout << "" <<endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n,x=0,t=0;
	cin>>n;
string s;
s.length()==n;
cin>>s;
		for(int i=0;i<n;i++)
		{
			if(s[i]==73)
			x++;
			if(s[i]==68)
			x--;
			t=max(x,t);
		}
		cout<<t;
}

Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<math.h>
#include <cstdio>
#include<iomanip>
#include <stdio.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,m,n) for(int i=m;i<(int)(n);i++)
const int inf = 10e9 + 7;
using namespace std;

signed main() {
	double a, b;
	cin >> a >> b;
	cout << fixed << setprecision(10) <<a/b<< endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  	public static void main(String[] args){
      //入力値の取得
      Scanner sc = new Scanner(System.in);
      long n = sc.nextLong();
      long a = sc.nextLong();
      long b = sc.nextLong();
      sc.close();

      if (a==0 && b==0) {
    	  System.out.println(0);
    	  return;
      }

      long answer = n/(a+b)*a;
      if (n%(a+b) <a) {
    	  answer+=n%(a+b);
      } else {
    	  answer+=a;
      }
      System.out.println(answer);
  	}
}

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

int main(){
  long long x;
  cin >> x;
  
  long long b = 100;
  int y = 0;
  
  while(true){
    b = b/100 + b;
    y++;
    if(b>=x){
      cout << y << endl;
      break;
    }
  }
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;


int main() {
    long long k;
    cin >> k;

    long long ans = 0;
    for (int a = 1; a <= k; a++) {
        for (int b = 1; b <= k; b++) {
            for (int c = 1; c <= k; c++) {
                ans += gcd(a, gcd(b, c));
            }
        }
    }

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


Measured memory_bytes: 3596
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, S: "List[str]"):
    c = collections.Counter(S).most_common()
    return "\n".join(sorted([i[0] for i in c if i[1] == c[0][1]]))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(f'{solve(N, S)}')


if __name__ == '__main__':
    main()


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

int main() {
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i, n) cin >> p[i];

    int ans = 0;
    for (int i = 1; i < n - 1; i++) {
        int mi = min(p[i - 1], min(p[i], p[i + 1]));
        int ma = max(p[i - 1], max(p[i], p[i + 1]));

        if (p[i] != mi && p[i] != ma) ans++;
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define L long long
using namespace std;
int n,m,q,f[310][310],g[310][310],h[310][310],x[310][310],y[310][310],c[310][310];
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int i,j,k;
	scanf("%d%d%d",&n,&m,&q);
	//n++;
	for(i=0;i<=n;i++)
	  for(c[i][0]=1,j=1;j<=i;j++)
	    c[i][j]=(c[i-1][j]+c[i-1][j-1])%q;
	f[0][m+1]=1;
	x[0][m+1]=1;
	for(i=0;i<=n;i++)
	  {
       for(j=1;j<=m;j++)
         for(k=0;k<i;k++)
           f[i][j]=(f[i][j]+((L)g[k][j]*x[i-1-k][j]+(L)y[k][j+1]*f[i-1-k][j])%q*c[i-1][k])%q;
       for(j=m;j>=1;j--)
         g[i][j]=(g[i][j+1]+f[i][j+1])%q;
       //for(j=1;j<=n;j++)
         //h[i][j]=(h[i][j-1]+f[i][j])%q;
       for(j=m;j>=1;j--)
         x[i][j]=(x[i][j+1]+f[i][j])%q;
       for(j=m;j>=1;j--)
         y[i][j]=(y[i][j+1]+g[i][j])%q;
       //for(j=1;j<=m;j++)
         //cout<<i<<" "<<j<<"   "<<f[i][j]<<" "<<g[i][j]<<" "<<h[i][j]<<" "<<x[i][j]<<" "<<y[i][j]<<"!!\n";
      }
	/*for(i=m;i>=0;i--)
	  {
       f[i][1]=1;
	   for(j=2;j<=n;j++)
	     for(k=1;k<j;k++)
	       f[i][j]=(f[i][j]+(L)g[i+1][k]*f[i][j-k]%q*c[j][k])%q;
	   for(j=1;j<=n;j++)
	     g[i][j]=(g[i+1][j]+f[i][j])%q;
      }
      cout<<f[0][1]<<" "<<f[0][2]<<" "<<g[1][1]<<" "<<g[1][2]<<" ";*/
    printf("%d\n",x[n][1]);
	return 0;
}


Measured memory_bytes: 2048
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

# アルファベットと数字の対応
alp_to_num = {chr(i+97): i for i in range(26)}
ALP_to_num = {chr(i+97).upper(): i for i in range(26)}
num_to_alp = {i: chr(i+97) for i in range(26)}
num_to_ALP = {i: chr(i+97).upper() for i in range(26)}


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


def main():
    N = NI()
    ans = []

    def dfs(s, i, max_num):
        if i == N:
            ans.append(s)
            return

        for n in range(max_num+2):
            dfs(s + num_to_alp[n], i+1, max(max_num, n))

    dfs("a", 1, 0)
    ans.sort()
    for a in ans:
        print(a)


if __name__ == "__main__":
    main()

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

#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

#define INF 1e9


int main(){ 
  int N;
  cin >> N;
  vector<int> A(N);
  REP(i, N){
    cin >> A[i];
  }
  int cnt = 0, pre = -1, hoge = 1;
  int i = 0;
  REP(i, N){
    if(hoge == -1){
      if(pre > A[i]){
        hoge = 1;
      }
      else if(pre < A[i]){
        hoge = 0;
      }
    }
    else if(hoge == 1){
      if(pre < A[i]){
        cnt++;
        hoge = -1;
      }
    }
    else{
      if(pre > A[i]){
        cnt++;
        hoge = -1;
      }
    }
    pre = A[i];
  }
  cout << cnt << endl;
  return 0;
}



Measured memory_bytes: 640
/*{{{*/
//#define HOME
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;

#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define F first
#define S second

template<class T> void _R(T &_x) { cin >> _x; }
void _R(int &_x) { scanf("%d", &_x); }
void _R(int64_t &_x) { scanf("%" SCNd64, &_x); }
void _R(double &_x) { scanf("%lf", &_x); }
void _R(char &_x) { scanf(" %c", &_x); }
void _R(char *_x) { scanf("%s", _x); }
template<class T, class U> void _R(pair<T, U> &_x) {_R(_x.F); _R(_x.S);}
void R() {}
template<class T, class... U> void R(T &_head, U &... _tail) { _R(_head); R(_tail...); }

template<class T> void _W(const T &_x) { cout << _x; }
void _W(const int &_x) { printf("%d", _x); }
void _W(const int64_t &_x) { printf("%" PRId64, _x); }
void _W(const double &_x) { printf("%.16f", _x); }
void _W(const char &_x) { putchar(_x); }
void _W(const char *_x) { printf("%s", _x); }
template<class T, class U> void _W(const pair<T, U> &_x) {_W(_x.F); putchar(' '); _W(_x.S);}
template<class T> void _W(const vector<T> &_x) { for (auto i = _x.begin(); i != _x.end(); _W(*i++)) if (i != _x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &_head, const U &... _tail) { _W(_head); putchar(sizeof...(_tail) ? ' ' : '\n'); W(_tail...); }
template<class T, class... U> void DB(const T &_head, const U &... _tail) {
#ifdef HOME
    W('#', _head, _tail...);
#endif
}

#define SZ(x) (int)((x).size())
#define ALL(x) (x).begin(), (x).end()
#define RAN(x,n) (x).begin(), (x).begin()+(n)
#define UNIQUE(x) {sort(ALL(x)); (x).erase(unique(ALL(x)), (x).end());}

#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
//#define ITER(i,t) for (auto i = t.begin(); i != t.end(); ++i)
#define IT3(i,st,ed) for (auto i = st; i != ed; ++i)
#define IT2(i,range) IT3(i,range)

#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define MS(X, v) memset((X), (v), sizeof((X)))

template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

typedef int64_t ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

inline int LG (const unsigned int &_x) { return 31-__builtin_clz(_x); }  // floor: LG(x), ceil: LG(x-1)+1
/*}}}*/

string s, s2;
int n;

int main(){
    R(n, s);
    FOR(i, s.length()){
        char c = s[i] + n;
        if(c > 'Z') c -= 26;
        s2 += c;
    }
    W(s2);
    return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

/*
func nextLine() string {
    sc.Scan()
    return sc.Text()
}
*/

func nextInt() int {
    sc.Scan()
    i, e := strconv.Atoi(sc.Text())
    if e != nil {
        panic(e)
    }
    return i
}


func main() {
    sc.Split(bufio.ScanWords)
    n:=nextInt()
    var al []int
    var bl []int
    var cl []int
    var i,score,add_score int
    add_score = 0
    score = 0
//    n := nextInt()

    for i=0; i < n; i++{
	    al=append(al,nextInt())
    }

    for i=0; i < n; i++{
	    bl=append(bl,nextInt())
    }

    for i=0; i < n-1; i++{
	    cl=append(cl,nextInt())
    }

    for i=0; i < n; i++{
	    score+=bl[al[i]-1]
    }

    for i=1; i < n; i++{
	    if (al[i] == al[i-1]+1){
		    add_score+=cl[al[i-1]-1]
	    }
    }

    fmt.Println(score+add_score)
}


Measured memory_bytes: 640
# 桁DP

n = gets.chomp.split("").map(&:to_i)
k = gets.to_i
length = n.length
# dp[上から i 桁まで][smaller][0 でない数字を使った回数]の出現回数
dp = (length + 1).times.map { 2.times.map { Array.new([length + 1, k + 1].max, 0) } }
# 初期化
# dp[0 桁目まで][桁は不自由][0 でない数字 を 0 回使った]の出現回数は 1
dp[0][0][0] = 1

# 桁数分ループする（i は遷移元の桁）
length.times do |i|
  dp_current = dp[i]
  # 最適化のため、事前に 1 行分だけ浅いコピーをする
  # dp_next と dp[i + 1] の object_id は同じ
  dp_next = dp[i + 1]
  # smaller == 1 の場合、以下の桁は自由
  2.times do |smaller|
    # 1 を使った回数ごとに確認する
    length.times do |count|
      # smaller が既に 1 の場合は 10 回ループ、0 の場合は(その桁の数字 + 1）回ループ
      limit = smaller == 1 ? 9 : n[i]
      (limit + 1).times do |d|
        # smaller == 0 且つ d == limit（上限）の時のみ、0 のまま遷移する
        next_smaller = smaller == 0 && d == limit ? 0 : 1
        # d == 0 でない場合は回数を足す
        addition = d == 0 ? 0 : 1
        # 次の桁に遷移する
        dp_next[next_smaller][count + addition] += dp_current[smaller][count]
      end
    end
  end
end

ans = 0
# 桁が自由、不自由ともに、(0 以外を k 回使った出現回数)を ans に足す
2.times do |i|
  ans += dp[length][i][k]
end
puts ans


Measured memory_bytes: 2684
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 0;
    for(int i = 1; i < s.size() - 1; i++){
        string t = s.substr(0, i);
        if(t.size() % 2) continue;
        bool f = true;
        for(int j = 0; j < t.size() / 2; j++){
            if(t[j] != t[t.size() / 2 + j]) f = false;
        }
        if(f) ans = i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define double long double
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=1e9+7;
int main(){
    ll n,K;cin>>n>>K;
    vector<vector<vector<ll> > >dp(n,vector<vector<ll> >(n,vector<ll>(65)));
    rep(i,n)rep(j,n){
        ll a;cin>>a;
        if(a)dp[i][j][0]=1;
    }
    REP(l,1,65){
        rep(i,n){
            rep(j,n){
                rep(k,n){
                    dp[i][j][l]+=dp[i][k][l-1]%inf*dp[k][j][l-1]%inf;
                    dp[i][j][l]%=inf;
                }
            }
        }
    }
    vector<vector<ll> >path(n,vector<ll>(65));
    rep(i,n)path[i][0]=1;
    rep(k,64){
        if((1LL<<k)&K){
            rep(i,n){
                rep(j,n){
                    path[i][k+1]+=path[j][k]%inf*dp[j][i][k]%inf;
                    path[i][k+1]%=inf;
                }
            }
        }else{
            rep(i,n){
                path[i][k+1]=path[i][k];
            }
        }
    }
    ll ans=0;
    rep(i,n){
        ans+=path[i][64];
        ans%=inf;
    }
    rep(i,3){
        rep(j,n){
            rep(k,n){
                //cout<<i<<' '<<j<<' '<<k<<' '<<dp[j][k][i]<<endl;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1664
import itertools
n, m, x = map(int, input().split())
c = []
ans = []
for _ in range(n):
    l = list(map(int, input().split()))
    c.append(l)

for i in range(1, n+1):
    for vl in itertools.combinations(c, i):
        a = [0] * m
        p = 0
        for v in vl:
            p += v[0]
            for j in range(m):
                a[j] += v[1+j]
        flag = True
        for k in range(m):
            if a[k] < x:
                flag = False
        if flag:
            ans.append(p)
if len(ans) == 0:
    print(-1)
else:
    print(min(ans))

Measured memory_bytes: 9260
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    a,b=map(int, input().split())
    s=input()
    for c in s[:a]:
        if c.isdecimal():continue
        print("No")
        exit()
    if s[a]!="-":
        print("No")
        exit()
    for c in s[a+1:]:
        if c.isdecimal():continue
        print("No")
        exit()
    print("Yes")


main()

Measured memory_bytes: 3188
#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if (a < b && b < c){
    printf("%d %d %d\n",a,b,c);
  }else if(a > b && b > c){
    printf("%d %d %d\n",c,b,a);
  }else if(a < b && b > c){
    printf("%d %d %d\n",a,c,b);
  }else if(a < b && a > c){
    printf("%d %d %d\n",c,a,b);
  }else if(b < a && a < c){
    printf("%d %d %dn",b,a,c);
  }else if(b < a && a > c){
    printf("%d %d %d\n",b,c,a);
  }return 0;
}
	  



Measured memory_bytes: 2108
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>

using namespace std;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long INF = 1LL<<60;

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

void strInit(char str[]);//str[]を0で初期化
void extIntStr(char str[],int data[]);//str[]から数値(int)を抽出しdata[]に順次格納
void incsort(int data[],int len);//data[]を昇順ソート
void decsort(int data[],int len);//data[]を降順ソート
void printIntArray(int data[],int len);//data[]をprint
int* inputArray(int n);//文字列を受け取り数値を抽出、n個の数値(int)を格納した配列のポインタをreturn
int* cpyArray(int data[],int len);//配列(int)を複製した配列のポインタをreturn

//don't forget free(data);

int main(){
    int N,K;
    scanf("%d %d ",&N,&K);
    int *data = inputArray(N);
    int ans=0;
    for(int i=0;i<N;i++){
        if(K<=data[i])ans++;
    }
    cout << ans << endl;
}

//temp##############################################

void strInit(char str[]){
    int len=strlen(str);
    for(int i=0;i<len;i++){
        str[i]=0;
    }
}

void extIntStr(char str[],int data[]){
    int length=strlen(str);
    str[length-1]=' ';
    char buff[12];
    int j,index;
    index=j=0;
    for(int i=0;i<length;i++){
        if(str[i]!=' '){
            buff[j++]=str[i];
        }else{
            data[index++]=atoi(buff);
            strInit(buff);
            j=0;
        }
    }
}

void incsort(int data[],int len){
    for(int i=0;i<len-1;i++){
        for(int j=i+1;j<len;j++){
            if(data[i]>data[j]){
                int tmp=data[i];
                data[i]=data[j];
                data[j]=tmp;
            }
        }
    }
}

void decsort(int data[],int len){
    for(int i=0;i<len-1;i++){
        for(int j=i+1;j<len;j++){
            if(data[i]<data[j]){
                int tmp=data[i];
                data[i]=data[j];
                data[j]=tmp;
            }
        }
    }
}

void printIntArray(int data[],int len){
    for(int i=0;i<len;i++){
        printf("%d\n",data[i]);
    }
}

int* inputArray(int n){
    int *data;
    data=(int*)malloc(sizeof(int)*n);
    char *get;
    get=(char*)malloc(sizeof(char)*11*n+1);
    fgets(get,11*n+1,stdin);
    extIntStr(get,data);
    free(get);
    return data;
}

int* cpyArray(int data[],int len){
    int *cp;
    cp=(int*)malloc(sizeof(int)*len);
    for(int i=0;i<len;i++){
        cp[i]=data[i];
    }
    return cp;
}

//temp##############################################


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

int main(){
    int M;
    double N;
    cin >> N;
    M = N;
    double ans;
    if(M%2 == 1)
        ans =  (M/2 + 1)/N;
    else
        ans = 0.5;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
const int mod = 1e9 + 7;

ll mpow(ll x, ll n) {
  ll res = 1;
  while (n) {
    if (n & 1) res = res * x % mod;
    x = x * x % mod;
    n /= 2;
  }
  return res;
}

ll inv(ll x) {
  return mpow(x, mod - 2);
}

vl fac(2e5, 1);
vl invfac(fac.size(), 1);

ll bin(int k, int n) {
  if (k < 0 || k > n) return 0;
  return fac[n] * invfac[n-k] % mod;
}

int main() {
  std::ios::sync_with_stdio(false); std::cin.tie(0);
  for (int i = 2; i < (int)fac.size(); ++i) {
    fac[i] = fac[i-1] * i % mod;
    invfac[i] = inv(fac[i]);
  }
  int n, x;
  cin >> n >> x;
  vi a(n), cnt(2e5);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    cnt[a[i]] = 1;
  }
  sort(a.begin(), a.end());
  for (int i = 1; i < (int)cnt.size(); ++i) {
    cnt[i] += cnt[i-1];
  }
  int big = 0;
  while (!a.empty() && a.back() > x) {
    ++big;
    a.pop_back();
  }
  vl d(x + 1);
  for (int i = 1; i <= x; ++i) {
    int it = cnt[i];//upper_bound(a.begin(), a.end(), i) - a.begin();
    if (it == 0) d[i] = i;
    for (int j = it - 1; j >= 0; --j) {
      d[i] = (d[i] + d[i % a[j]] * bin(it - 1 - cnt[i % a[j]], it - 1)) % mod;
    }
  }
  cout << d[x] * bin(big, n) % mod << endl;
  return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main() {
  double pi = 3.141592;
  int r;
  cin >> r;
  cout << 2*r*pi << endl;
  return 0;
}

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


#define ll long long
#define ull unsigned ll
#define vi vector <int>
#define ii pair <int, int>
#define vii vector <ii>
#define vll vector <ll>
#define vull vector <ull>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define INF (int)1e9
#define EPS 1e-9
#define pb emplace_back
#define PI acos(-1.0)
#define DEBUG 0

int main ()

{
    fast;
    
   int n, flag = 1;
   cin >> n;
   
   
    vi num;
    
    for (int y=0; y<n; y++)
    {
        int x;
        cin >> x;
        if (flag == 0)
        continue;
        if (x%2 == 0)
    {
        if (x%3!=0 && x%5!=0)
        {
            flag = 0;
        }
    }
        num.pb(x);
    }
    
    if (flag) cout << "APPROVED" << endl;
    else cout << "DENIED" << endl;

    return 0;
}

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

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << "Line " << __LINE__ << ": " <<  #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;

template<typename T> using V = vector<T>;
template<typename T> using P = pair<T, T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template <class T> void UNIQUE(vector<T> &x) {sort(ALL(x));x.erase(unique(ALL(x)), x.end());}
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; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<"\n";}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<"\n";};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

int main(){

    ll K;
    cin >> K;
    string S = "";
    REP(i, K) S += "ACL";
    cout << S << endl;

    return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n,m,i;
    cin>>n>>m;
    ll ara[n+5];
    bool ara1[n+5];
    for(i=1;i<=n;i++)
    {
        cin>>ara[i];
        ara1[i]=false;
    }
    long ans=0;
    int a,b;
    for(i=1;i<=m;i++)
    {
        cin>>a>>b;
        if(ara[a]<ara[b])
            ara1[a]=true;
        else if(ara[b]<ara[a])
            ara1[b]=true;
        else
        {
            ara1[a]=true;
            ara1[b]=true;
        }
    }
    for(i=1;i<=n;i++)
    {
        if(ara1[i]==false)
            ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 4524
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    string S, T;
    cin >> S >> T;

    vector<int> cnt_S(26, 0);
    vector<int> cnt_T(26, 0);
    for(int i = 0; i < S.size(); i++){
        cnt_S[S[i]-'a']++;
        cnt_T[T[i]-'a']++;
    }

    sort(cnt_S.begin(), cnt_S.end());
    sort(cnt_T.begin(), cnt_T.end());

    if(cnt_S == cnt_T){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


    return 0;
}

Measured memory_bytes: 776
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		long k = sc.nextLong();
		int[] a = new int[n];
		Integer[] f = new Integer[n];
		for(int i = 0; i < n; i++){
		    a[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++){
		    f[i] = sc.nextInt();
		}
		Arrays.sort(a);
		Arrays.sort(f, Comparator.reverseOrder());
		
		// 計算
		long result = 0;
		long l = -1;
		long r = 1001001001001L;
		while(l+1 < r){
		    long c = (l + r)/2;
		    long sum = 0;
		    for(int i = 0; i < n; i++){
		        sum += max(a[i] - c/f[i], 0);
		    }
		    if(sum <= k){
		        r = c;
		    }else{
		        l = c;
		    }
		}
		result = r;
		
		// 出力
		System.out.println(result);
		
	}
}

Measured memory_bytes: 106456
import java.io.IOException;
import java.util.Scanner;
 
public class Main {
  /**
   * Main method.
   */
  public static void main(String[] args) throws IOException {
    Scanner s = new Scanner(System.in);
    
    final int A = s.nextInt();
    final int B = s.nextInt();
    final int C = s.nextInt();
    final int D = s.nextInt();
    
    int train = Math.min(A, B);
    int bas = Math.min(C, D);
    
    System.out.println(train + bas);
 
  }
}

Measured memory_bytes: 21844
import sys
input = sys.stdin.readline
import functools

def multiplication2(n,a):
    #acc = functools.reduce(lambda x,y:x*y, a)
    acc = 1
    a_sorted = sorted(a)
    if a_sorted[0] == 0:
        return 0
    
    for s in a_sorted:

        acc = acc*s
        if 10**18 < acc:
            acc = -1
            break
    return acc

if __name__ == "__main__":
    n = int(input())
    a = list(map(int,input().split()))
    print(multiplication2(n,a))


Measured memory_bytes: 23192
#include <cstdio>

#define MOD 1000000007
#define ll long long

int main() {
    int n;
    scanf("%d", &n);
    ll rez = 1;
    for (int i = 1; i <= n; i ++) {
        rez = rez * i % MOD;
    }
    printf("%lld", rez);
    return 0;
}


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

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define int ll

const ll MOD = 1000000007;
const ll INF_LL = (ll)1000000007 * 1000000007;
const int INF_INT = (int)1000000007;
const double PI = 3.14159265358979323846;

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define irep(itr, st) for (auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for (auto itr = (st).rbegin(); itr != (st).rend(); ++itr)

#define m0(x) memset((x), 0, sizeof((x)))
#define m1(x) memset((x), -1, sizeof((x)))

// xにはvectorなどのコンテナ
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define RALL(x) (x).rbegin(), (x).rend()  // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())     // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))  //最大値を求める
#define MIN(x) *min_element(ALL(x))  //最小値を求める
#define all(x) (x).begin(), (x).end()

//略記
#define pb emplace_back  // vectorヘの挿入
#define mp make_pair     // pairのコンストラクタ
#define F first          // pairの一つ目の要素
#define S second         // pairの二つ目の要素

#define BITCOUNT __builtin_popcount
#define BITCOUNT_LL(x) __builtin_popcountll(x)

#define perm(c)             \
  sort(all(c));             \
  for (bool c##p = 1; c##p; \
       c##p = next_permutation(all(c)))  //順列 123 132 213 231 312 321

#define BIT(n) (1LL << (n))

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ": " << (A) << std::endl;
#else
#define PRINT(A)
#endif

//入力高速化
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

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

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

signed main() {
  int H, W;
  cin >> H >> W;
  vector<string> S(H);
  rep(i, H) { cin >> S[i]; }
  vector<vector<int>> dp(H, vector<int>(W, INF_INT));
  dp[0][0] = 0;
  rep(i, H) {
    rep(j, W) {
      if (i != 0) {
        dp[i][j] =
            min(dp[i][j], dp[i - 1][j] + ((S[i - 1][j] != S[i][j]) ? 1 : 0));
      }
      if (j != 0) {
        dp[i][j] =
            min(dp[i][j], dp[i][j - 1] + ((S[i][j - 1] != S[i][j]) ? 1 : 0));
      }
      PRINT(dp[i][j])
    }
  }
  int ans = dp[H - 1][W - 1];
  if (S[0][0] == '#') {
    ans++;
  }
  if (S[H - 1][W - 1] == '#') {
    ans++;
  }
  cout << ans / 2 << endl;
}

Measured memory_bytes: 384
import sys
sys.setrecursionlimit(1000000) #再帰回数を増やさないとREになる


N, M, K = map(int, input().split())
friend = [[] for _ in range(N)]
block = [[] for _ in range(N)]
for _ in range(M):
  a, b = map(int, input().split())
  friend[a-1].append(b-1)
  friend[b-1].append(a-1)
for _ in range(K):
  c, d = map(int, input().split())
  block[c-1].append(d-1)
  block[d-1].append(c-1)


friendnetwork = []
sgn = [0 for _ in range(N)] #groupnumを書いていく
groupnum = 0

def makenetwork(n, groupnum):
  for item in friend[n]:
    if sgn[item] > 0:
      continue
    else:
      sgn[item] = groupnum
      makenetwork(item, groupnum)

for k in range(N):
  if sgn[k] == 0:
    groupnum += 1
    sgn[k] = groupnum
    makenetwork(k, groupnum)


friends = [[] for _ in range(groupnum)]
for k in range(N):
  friends[sgn[k]-1].append(k)

ans = []
for k in range(N):
  num = len(friends[sgn[k]-1])-1  - len(friend[k])
  for item in block[k]:
    if sgn[item] == sgn[k]:
      num -= 1
  ans.append(num)

for j in range(len(ans)):
  print(ans[j])

Measured memory_bytes: 64584
#include <iostream>
#include <vector>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N; cin >> N;
    vector<int> T(N);
    int sum = 0;
    for(int i = 0; i < N; ++i){
        cin >> T[i];
        sum += T[i];
    }
    int M; cin >> M;
    vector<int> ans(M);
    for(int i = 0; i < M; ++i){
        int p,x;
        cin >> p >> x;
        p--;
        ans[i] = sum - T[p] + x;
    }
    for(int i = 0; i < M; ++i) cout << ans[i] << endl;
    return 0;
}

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

const double PI = 3.14159265358979323846;
int main(){
  // 標準入力高速化のおまじない
  // scanfとの同期を切る。以降紛らわしいのでscanf使用不可。
  ios::sync_with_stdio(false);
  // // cin前の自動flashをやめる
  cin.tie(nullptr);

  string S,T;
  cin >> S >> T;

  string result;
  if(S.size()+1 == T.size() && T.erase(S.size()) == S){
    result = "Yes";

  }
  else{
    result = "No";
  }
  cout << result << endl;

  return 0;
}

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

int main() {
 string S;
 cin >> S;
 if (S == "SUN")
 {
     cout << 7 << endl;
 }
 if (S == "MON")
 {
     cout << 6 << endl;
 }
 if (S == "TUE")
 {
     cout << 5 << endl;
 }
 if (S == "WED")
 {
     cout << 4 << endl;
 }
 if (S == "THU")
 {
     cout << 3 << endl;
 }
 if (S == "FRI")
 {
     cout << 2 << endl;
 }
  if (S == "SAT")
 {
     cout << 1 << endl;
 }
}

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

int main(){
  int A,B,C;
  cin >> A >> B >> C;
  if((A==B && A!=C)||(B==C && B!=A)||(C==A && C!=B)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


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

using namespace std;

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

    int n;
    vector<int> a;
    while(cin >> n && n){
        a.resize(n);
        for(auto&& i : a){
            cin >> i;
        }
        sort(rbegin(a), rend(a));
        double avg = accumulate(begin(a), end(a), 0.0) / n;
        for(int i = 0; i < n; i++){
            if(avg >= a[i]){
                cout << n - i << "\n";
                break;
            }
        }
    }
}


Measured memory_bytes: 3168
import java.util.Scanner;

/**
 * @author yoshizaki
 *
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        int pattern = scanner.nextInt();
        int ac = scanner.nextInt();
        String result = "";
        if (pattern == ac) {
            result = "Yes";
        } else {
            result = "No";
        }
        System.out.println(result);
    }
}


Measured memory_bytes: 23892
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>
#include <limits>
using namespace std;


int main(){
    int x;
    cin >> x;
    if(x < 1200) cout << "ABC" << endl;
    else cout << "ARC" << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const double EPS = 1e-10;
inline bool equals(double a, double b) { return fabs(a - b) < EPS; }

class Point {
public:
	double x, y;
	Point(int x, int y) :x(x), y(y) {}
	Point() {}
	Point operator +(Point &p) { return Point(x + p.x, y + p.y); };
	Point operator -(Point &p) { return Point(x - p.x, y - p.y); }
	Point operator *(double k) { return Point(x*k, y*k); }
};
using Vector = Point;
inline double norm(Vector a) {
	return a.x*a.x + a.y*a.y;
}
double absv(Vector a) {
	return sqrt(norm(a));
}
inline double dot(Vector a, Vector b) {
	return a.x*b.x + a.y*b.y;
}
inline double cross(Vector a, Vector b) {
	return a.x*b.y - a.y*b.x;
}
struct Segment {
	Point p1, p2;
};
using Line = Segment;
class Circle {
public:
	Point c;
	double r;
	Circle(Point c = Point(), double r = 0.0) :c(c), r(r) {}
};
using Polygon = vector<Point>;
int main() {
	int q, x[4], y[4];
	Point P[4];
	cin >> q;
	for (int i = 0; i < q; i++) {
		for (int j = 0; j < 4; j++) {
			cin >> x[j] >> y[j];
			P[j] = Point(x[j], y[j]);
		}
		Vector a = P[0] - P[1];
		Vector b = P[2] - P[3];
		if (equals(dot(a, b), 0.0)) {
			cout << 1 << endl;
		}
		else if (equals(cross(a, b), 0.0)) {
			cout << 2 << endl;
		}
		else {
			cout << 0 << endl;
		}
	}
}

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

int main()
{
  i64 h, n;
  cin >> h >> n;
  vector<i64> a(n);
  for (i64 i = 0; i < n; i++)
    cin >> a[i];
  i64 sum = 0;
  for (i64 i = 0; i < n; i++)
    sum += a[i];
  if (sum < h)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<cassert>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const int mod = 1000000007;
const int inf = 1ll << 61;
typedef pair<int, int> P;
typedef pair<int, P>PP;
int a[304];
int rwa[304];
int dp[6][304][304];//dp[今の区間][その区間のスタート][現在]
int n, y,S; 
int qsum(int l, int r) {//[0,n) [l,r]
	if (l <= r)return rwa[r + 1] - rwa[l];
	else return rwa[n] - rwa[r] + rwa[l + 1];
}

int memo(int i, int j, int k) {
	if (i > 4)return 0;
	if (dp[i][j][k] >= 0)return dp[i][j][k];
	if (i == 4) {
		if (qsum(j, k) >= S)return 1;
		else return 0;
	}
	int ans = 0;
	for(int l=j+1;l<=k;l++) {
		if (qsum(j, l - 1) >= S) {
			ans += memo(i + 1, l, k);
		}
	}
	return dp[i][j][k] = ans;
}
void init() {
	rep(i, 6)rep(j, 304)rep(k, 304)dp[i][j][k] = -1;
}
signed main() {
	cin >> n >> y;
	rep(i, n) {
		cin >> a[i];
		S += a[i];
	}
	rep(i, n)rwa[i + 1] += rwa[i];
	S = S / 5 - y;
	int ans = 0;
	rep(i, n) {
		init();
		rep(j, n)rwa[j + 1] = a[j];
		rep(j, n)rwa[j + 1] += rwa[j];
		ans += memo(0, 0, n - 1);
		a[n] = a[0];
		rep(j, n)a[j] = a[j + 1];

	}
	cout << ans /5<< endl;
}


Measured memory_bytes: 7448
inp = input()
s = [int(inp[0]), int(inp[1]), int(inp[2]), int(inp[3])]

#print(s)
f2 = s[0]*10+s[1]
l2 = s[2]*10+s[3]

flag1 = False
flag2 = False
if 1 <= f2 and f2 <= 12:
    flag2 = True
if 1 <= l2 and l2 <= 12:
    flag1 = True

if flag1 and flag2:
    print('AMBIGUOUS')
elif flag1:
    print('YYMM')
elif flag2:
    print('MMYY')
else:
    print('NA')


Measured memory_bytes: 3064
n,m,Q=map(int,input().split())
M=[[0]*n for _ in range(n)]
for i in range(m):
    l,r=map(int,input().split())
    M[r-1][l-1]+=1

for q in range(n):
    for p in reversed(range(1,n)):
        M[q][p-1]+=M[q][p]
for p in range(n):
    for q in range(n-1):
        M[q+1][p]+=M[q][p]        

for i in range(Q):
    p,q=map(int,input().split())
    print(M[q-1][p-1])

Measured memory_bytes: 9332
#include<iostream>
#include<string>
#include<algorithm>    
#include<cmath>
#include<map>
#include<vector>
#include<math.h>
#include<stdio.h>
#define int long long
using namespace std;
int test[123456];
signed main() {
    int n, a, b = 0; string s, t; cin>>s>>t;
    cout << t << s << endl;
}

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

using namespace std;
using ll = long long;

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

#define CIN(T, x) T x; cin >> x;
#define CINS(T, x, N) vector<T> x(N); for(int i = 0; i < (N); i++) { cin >> x[i]; }
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << " "; } cout << "\n";
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << "\n";


int main() {

    CIN(int, N);
    CIN(int, K);
    CINS(ll, x, N);

    ll ans = 1e9;

    for (int i = 0; i <= N - K; i++) {
        ll xl = x[i], xr = x[i+K-1];
        ll temp;
        if (xl < 0 && xr > 0) {
            temp = min(-2 * xl + xr, -xl + 2 * xr);
        } else {
            temp = max( abs(xl), abs(xr) );
        }
        ans = min(ans, temp);
    }

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

Measured memory_bytes: 1024
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

#define EPS (1e-7)

int main() {
  ll K;
  cin >> K;
  ll even = K / 2;
  ll odd = even + ((K % 2 == 1) ? 1 : 0);
  cout << even * odd << endl;
  return 0;
}


Measured memory_bytes: 256
def search(l:list, t:int) -> bool:
    l.append(t)
    i=0
    while l[i] != t:
        i+=1

    if len(l) == i+1:
        return False
    l.pop()
    return True

n=int(input())
s=list(map(int, input().split()))
q=int(input())
t=list(map(int, input().split()))

ans=0
for _t in t:
        if search(s, _t):
            ans+=1

print(ans)


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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//main code

int main(int argc, char const* argv[])
{
	int n;
	cin >> n;
	VL a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	LL ans = 0;
	for (int i = 0; i < n-1; i++) {
		if (a[i] > 1) {
			LL tmp = a[i]/2;
			a[i] -= tmp*2;
			ans += tmp;
			if (a[i] == 1 and a[i+1] > 0) {
				a[i+1]--;
				ans++;
			}
		}
	}
	ans += a[n-1]/2;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repr(i, a, b) for (ll i =a; i < b; i++)
#define all(a) a.begin(), a.end()
#define w(tc) ll tc;cin>>tc;while(tc--)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define PI 3.14159265359
static const int INF = 1e9 + 7;
using namespace std;

int main()
{
  int n;
  cin >> n;
  ll i = 2;
  ll ans = 0 ;
  for ( i = 1; i < 1000000; i++)
  {
    ans = (int)(ans*10+7) % n;
    if (ans == 0)
{      cout<<i<<endl;
       return 0;}
    
  }
  cout<<-1<<endl;
}



Measured memory_bytes: 3632