akhauriyash/Code-Regression huggingface dataset:
# coding: utf-8
# Your code here!

class Bustime:
    h = 0
    mm = 0
    t = 0
    def __init__(self, h, mm):
        self.h = h
        self.mm = mm
        self.t = h * 60 + mm
    def __str__(self):
        if self.mm < 10:
            return str(self.h) + ":0" + str(self.mm)
        else:
            return str(self.h) + ":" + str(self.mm)
    def __lt__(self, other):
        return self.t < other.t


line1 = [int(i) for i in input().split()]
line2 = [int(i) for i in input().split()]

times = []

for i in range(line1[0]):
    times.append(Bustime(line1[2*i + 1], line1[2*i + 2]))

for i in range(line2[0]):
    times.append(Bustime(line2[2*i + 1], line2[2*i + 2]))

times.sort()
prev = ""
flag = True
for i in range(len(times)):
    if prev != str(times[i]):
        if flag:
            print(times[i],end="")
            flag = False
        else:
            print(" " + str(times[i]),end="")
            
    prev = str(times[i])

print("")
        
        
        


Measured memory_bytes: 5644
#include <iostream>
#include <string>
#include <vector>
#include <map>
#define MAX_N 100
#define MAX_M 100
#define MAX_K 100

using namespace std;

typedef struct _Recipe{
	string NewItemName;
	int SourceItemNumber;
	vector<string> SourceItemName;
}Recipe;

typedef struct _Item{
	string ItemName;
	int Price;
}Item;


int main(void){
	int n, m, min_cost[MAX_N];
	string require;
	Item itm[MAX_N];
	Recipe rcp[MAX_M];
	map<string,int> ItemName_To_Index;
	while(1){
		cin >> n;
		if(n == 0){
			break;
		}
		for(int i = 0;i < n;i++){
			cin >> itm[i].ItemName >> itm[i].Price;
			min_cost[i] = itm[i].Price;
			ItemName_To_Index.insert(map<string,int>::value_type(itm[i].ItemName,i));
			//cout << "価格 " << itm[i].Price << endl;
		}
		cin >> m;
		for(int i = 0;i < m;i++){
			cin >> rcp[i].NewItemName >> rcp[i].SourceItemNumber;

			for(int j = 0;j < rcp[i].SourceItemNumber;j++){
				string tmp;
				cin >> tmp;
				rcp[i].SourceItemName.push_back(tmp);
			}

		}
		cin >> require;



		for(int i = 0;i < m;i++){
			for(int j = 0;j < m;j++){
				int sum = 0;
				for(int k = 0;k < rcp[j].SourceItemNumber;k++){
					sum += min_cost[ItemName_To_Index[rcp[j].SourceItemName[k]]];
				}
				min_cost[ItemName_To_Index[rcp[j].NewItemName]] = min(sum,min_cost[ItemName_To_Index[rcp[j].NewItemName]]);
			}
		}

		cout << min_cost[ItemName_To_Index[require]] << endl;
		for(int i = 0;i < m;i++){
			rcp[i].SourceItemName.clear();
		}
		ItemName_To_Index.clear();
		/*for(int i = 0;i < n;i++){
			cout << itm[i].ItemName << " 最安値 " << min_cost[i] << endl;
		}*/
	}

	return 0;
}

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

/**
 * vector<int>ar(3);
 * for(auto&e:ar){
 *     scanf("%d",&e);
 * }
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 ***/

int main(){
    double pai=3.141592653589;
    int n,b,f,r,v;
    int room[4][3][10];
    scanf("%d",&n);
    for(int i=0;i<4;i++){
        for(int j=0;j<3;j++){
            for(int k=0;k<10;k++){
                room[i][j][k]=0;
            }
        }
    }
    for(int i=0;i<n;i++){
        scanf("%d %d %d %d",&b,&f,&r,&v);
        room[b-1][f-1][r-1]+=v;
    }
    for(int i=0;i<4;i++){
        for(int j=0;j<3;j++){
            for(int k=0;k<10;k++){
                printf(" %d",room[i][j][k]);
            }
            if(j!=2 || (j==2 && i==3)){
                printf("\n");
            }else if(i!=3){
                printf("\n####################\n");
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1184
#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 pb push_back
#define mp make_pair
#define fill(x, y) memset(x, y, sizeof(x))
#define even(x) x % 2 == 0
#define odd(x) x % 2 != 0
#define all(x) x.begin(), x.end()
#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());

// these functions return the position of result of Binary Search.
#define LB(s, t, x) (int) (lower_bound(s, t, x) - s)
#define UB(s, t, x) (int) (upper_bound(s, t, x) - s)

ll qp(ll a, ll b, int mo) { ll ans = 1; do { if (b & 1) ans = 1ll * ans * a % mo; a = 1ll * a * a % mo; } while (b >>= 1); return ans; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll temp = gcd(a, b); return temp ? (a / temp * b) : 0; }
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dx8[] = { 1, -1, 0, 0, 1, 1, -1, -1 }, dy8[] = { 0, 0, -1, 1, -1, 1, -1, 1 };

template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts>
auto make_v(size_t a, size_t b, Ts... ts) { return vector<decltype(make_v<T>(b, ts...))>(a, make_v<T>(b, ts...)); }
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); }
// auto dp = make_v<int>(4, h, w);
// fill_v(dp, 0);

const ll INF_LL = (1ll << 60);
const int INF_INT = (int)1e9;
const ll MOD_CONST = (ll)(1e9 + 7);

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 (b < a) { a = b; return 1; } return 0; }


inline tuple<ll, ll> rotate45(tuple<ll, ll> point) { ll x = get<0>(point), y = get<1>(point); return tuple<ll, ll>(x + y, x - y); }
inline bool rangeCheck2D(int nx, int ny, int Width, int Height) { return nx >= 0 and nx < Width and ny >= 0 and ny < Height; }
void out_sequence(vector<ll> &out) { REP(i, (int)out.size()) { cout << out[i]; if (i == (int)out.size() - 1) cout << endl; else cout << " "; } }

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

	ll N, K; cin >> N;
	REP(i, N / 4 + 1) {
		ll sum = i * 4;
		ll rest = N - sum;
		if (rest % 7 == 0) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

	return 0;
}

//*/

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

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int N, d; cin >> N;
	vector <int> f(N); 
	vector <vector<int>> P(N, vector<int>(11));
	for (int i = 0; i < N; ++i){
		int number = 0;
		for (int j = 0; j < 10; ++j){
			cin >> d;
			if (d == 1) number += (1 << j);
		}
		f[i] = number;
	}
	for (int i = 0; i < N; ++i){
		for (int j = 0; j < 11; ++j) cin >> P[i][j];
	}
	int ans = -1e9-9;
	for (int i = 1; i < (1 << 10); ++i){
		int number = 0;
		for (int j = 0; j < N; ++j){
			number += P[j][__builtin_popcount(f[j] & i)];	
		}
		ans = max(ans, number);	
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 3676
package main

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

const size = 1000000
var reader = bufio.NewReaderSize(os.Stdin,size)
func NextLine() string {
  var line,buffer []byte
  var isPrefix bool = true
  var err error
  for ;isPrefix; {
    line,isPrefix,err = reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer,line...)
  }
  return string(buffer)
}
func NextInt() int {
  var n int
  n,_ = strconv.Atoi(NextLine())
  return n
}
func NextInt64s() (int64,int64) {
  var a,b int64
  var s []string = strings.Split(NextLine()," ")
  a,_ = strconv.ParseInt(s[0],10,64)
  b,_ = strconv.ParseInt(s[1],10,64)
  return a,b
}

func main() {
  var n int
  var a,b []int64
  var m int64
  n = NextInt()
  a = make([]int64,n)
  b = make([]int64,n)
  for i:=0;i<n;i++ {
    a[i],b[i] = NextInt64s()
  }
  m = 0
  for i:=n-1;i>=0;i-- {
    a[i] += m
    if a[i]%b[i] == 0 { continue }
    m += b[i]-a[i]%b[i]
  }
  fmt.Println(m)
}

Measured memory_bytes: 6528
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <functional>
#include <numeric>
#include <math.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(void) {
	int X;
	cin >> X;
	if (X >= 30) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll N=2e5+5;
const ll MOD=1e9+7;
const ld pi=3.14159265359;
const ll INF=(1LL<<60);
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define setp setprecision
#define lwb lower_bound
#define SZ(a) (ll)a.size()



int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	ll n;
	cin>>n;
	cout<<(n+1)/2<<"\n";
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static readonly long Mod = 1000000000 + 7;

        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var S = ReadLine();
            if (S[0] != 'A')
            {
                WriteLine("WA");
                return;
            }
            if (1 != S.Substring(2, S.Length - 3).Count(c => c == 'C'))
            {
                WriteLine("WA");
                return;
            }
            if (2 != S.Count(c => c < 'a'))
            {
                WriteLine("WA");
                return;
            }
            WriteLine("AC");
            //Out.Flush();
        }
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
vector<int> lad[27];
int n, dp[maxn];
int f(int pos){
	if(pos > n) return 1;
	if(dp[pos] != -1) return dp[pos];
	int ans = INT_MAX;
	for(char i = 'a'; i <= 'z'; ++i){
		auto next = upper_bound(lad[i - 'a'].begin(), lad[i - 'a'].end(), pos);
		if(next == lad[i - 'a'].end()) ans = 1;
		else ans = min(ans, 1 + f(*next));
	}
	return dp[pos] = ans;
}
void rec(int pos){
	if(pos > n) return;
	int ans = f(pos), siguiente;
	char imprimir = 'z' + 2;
	for(char i = 'a'; i <= 'z'; ++i){
		auto next = upper_bound(lad[i - 'a'].begin(), lad[i - 'a'].end(), pos);
		if(next == lad[i - 'a'].end())
			imprimir = min(imprimir, i);
		else if(1 + f(*next) == ans){ 
			if(i < imprimir)
				imprimir = i, siguiente = *next;
		}
	}
	cout << imprimir;
	if(ans != 1) rec(siguiente);
}

int main(){
	string s;
	cin >> s;
	n = s.size();
	for(int i = 0; i < s.size(); ++i)
		lad[s[i] - 'a'].push_back(i + 1);
	memset(dp,-1,sizeof(dp));
	rec(0);
	return 0;
}

Measured memory_bytes: 2948
# ITP1_3_C
a =[]
while True:
    x, y = (int(x) for x in input().split())
    if x == 0 and y ==0:
        break
    z = [x, y]
    z.sort()
    z = [z]
    a = a + z
for i in range(len(a)):
    print(str(a[i][0]) + ' ' + str(a[i][1]))


Measured memory_bytes: 6040
#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
typedef pair< P , P > L;
typedef pair< P , P > S;
typedef vector<P> vecP;
 
double eps = 1e-8;
 
bool eq(double a,double b){
  return -eps < a-b && a-b < eps;  
}
 
double cross(P a,P b){
  return imag( b*conj(a) );
}
 
double dot(P a,P b){
  return real( b*conj(a) );
}
 
bool isParallel(L a,L b){
  a.first -= a.second;
  b.first -= b.second;
  return eq(cross( a.first,b.first ),0);
}
 
P getCrossLL(L l0,L l1){
  P a=l0.first, b=l0.second;
  P c=l1.first, d=l1.second;
  a-=d;b-=d;c-=d;
  return d+a+(b-a)*imag(a/c)/imag(a/c-b/c);
}
 
int N;
P t[50];
L lines[1250];
P u[1250*1250];
 
int main(){
  while(1){
    scanf("%d",&N);
    if(N==0)break;
    for(int i=0;i<N;i++){
      int x,y;
      scanf("%d %d",&x,&y);
      t[i]=P(x,y);
    }
     
    int cc=0;    
    for(int i=0;i<N;i++)
      for(int j=0;j<i;j++)
        lines[cc++]=L(t[i],t[j]);
 
    int uc=0;
    for(int i=0;i<cc;i++)
      for(int j=0;j<i;j++)
        if( !isParallel(lines[i],lines[j]) )
          u[uc++]=getCrossLL(lines[i],lines[j]);
 
    int ans=0;
    for(int i=0;i<uc;i++){
      bool flg=true;
      P cen=u[i];
      for(int j=0;j<N;j++){
        P a=t[j];
        P b=t[ (j+1==N?0:j+1) ];
         
        if( cross(a-cen,b-cen) < -eps ){
          flg=false;
          break;
        }
         
      }
       
      if(flg){
        ans=1;
        break;
      }
    }
 
    printf("%d\n",ans);
  }
   
  return 0;
}

Measured memory_bytes: 27656
#include <cstdio>
#include <utility>
#include <stack>
using namespace std;

#define gcu getchar_unlocked
#define ii inline int in
#define is inline bool scan
ii(int c) {
	int n = 0;
	bool minus = false; if (c == '-') minus = true, c = gcu();
	do {n = 10 * n + (c - '0'), c = gcu();} while (c >= '0');
	//return n; }
	return minus ? -n : n; }
ii() {return in(gcu());}
is(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
is(char &c){c=gcu();gcu();return c!=EOF;}
//is(string &s){int c;
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#undef ii
#define pcu putchar_unlocked
template <typename T>
void out(T n) {
	static char buf[20];
	char *p = buf;
	if(n < 0) pcu('-'), n *= -1;
	if (!n) *p++ = '0';
	else while (n) *p++ = n % 10 + '0', n /= 10;
	while (p != buf) pcu(*--p); }
void out(const char *s){while(*s)pcu(*s++);}
void out(char c){pcu(c);}
//void out(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail>
void out(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T>
//void out(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef svo

int main() {
	int t = 0, n = 4;
	while (n--)
		t += in();
	out(t / 60, '\n', t % 60, '\n');
}


Measured memory_bytes: 2624
object Main {
    import scala.annotation.tailrec

    def main(args: Array[String]) = {
        val sc = new java.util.Scanner(System.in)
        val dots = Array("#", ".")

        drawPlaid(sc, dots)
    }

    def drawPlaid(scanner: java.util.Scanner, dotset: Array[String]): Unit = {
        val h, w = scanner.nextInt

        if( h != 0 && w != 0 ) {
            for( i <- 0 until h ) {
                for( j <- 0 until w ) print(dotset((i+j)%2))
                print("\n")
            }
            print("\n")

            drawPlaid(scanner, dotset)
        }

    }

}



Measured memory_bytes: 54296
### SNIPPET
  # n = gets.split.map(&:to_i)
  # array = n.times.map { gets.split.map(&:to_i) }
  # [].all?(&:even?)
  # a = [*1..m].repeated_combination(n).to_a
  # [1,2,3,4,5].select { |num| num.even? }  # => [2, 4]
  # ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
  # 切り捨て: .floor(2).to_f ,切り上げ： .ceil(2).to_f,四捨五入: round(2)
  # 3.upto(6) do |i|, 6.downto(3) do |i|
  # 公約数125.gcd(100)、公倍数125.lcm(100)
  # PI = Math::PI
  # 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
  # def chmax(a, b) a > b ? a : b end
  # INF = Float::INFINITY
  # def chmin(a, b) a < b ? a : b end

h1,m1,h2,m2,k = gets.split.map(&:to_i)
if m2 - m1 < 0
  min = 60 - m1 + m2
  hour = (h2-1 - h1)*60
else
  min = m2 - m1
  hour = (h2 - h1)*60
end
time = hour + min

yo = time - k

if yo < 0
  puts 0
else
  puts yo
end

Measured memory_bytes: 14368
import static java.util.Arrays.deepToString;
import static java.util.Arrays.fill;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	Scanner sc = new Scanner(System.in);
	public void run() {
		for (;sc.hasNext();) {
			int n = sc.nextInt();
			if (n == 0) break;
			long sum = 0;
			for (int i = 0; i < n; i++) sum += sc.nextInt();
			System.out.println(sum / n);
		}
	}
}

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

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)
#define deb(x)     cout << #x << " = "<<x<<endl

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()
#define all(x) beg(x), en(x)

int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 200005;


ll gcd(ll  a , ll b) {
	return (b == 0) ? a : gcd(b, a % b);
}
ll binpow(ll a, ll b) {
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a;
		a = a * a;
		b >>= 1;
	}
	return res;
}
ll powmod(ll a, ll b, ll m) {
	a %= m;
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}
ll modinv(ll n, ll p)
{
	return powmod(n, MOD - 2, MOD);
}
void max_self(ll &a, ll b) {
	a = max(a, b);
}


int main(int argc, char const *argv[])
{
	// two magical lines to speed up IO
	cin.tie(0);
	ios_base::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	int H , W;
	cin >> H >> W;
	char a[H][W];
	F0R(i, H) {
		F0R(j, W) {
			cin >> a[i][j];
		}
	}
	vector <vi> dp(H, vi(W, 0));
	dp[0][0] = 1;
	F0R(i, H) {
		F0R(j, W) {
			if ( i + j > 0 && a[i][j] == '.') {
				dp[i][j] = (i > 0 ? dp[i - 1][j] : 0 ) + (j > 0 ? dp[i][j - 1] : 0);
				dp[i][j] = dp[i][j] % MOD;
			}
		}
	}
	cout << dp[H - 1][W - 1] << endl;





}





Measured memory_bytes: 8196
#include<iostream>
using namespace std;
int freq[105];
int main(){
  int N,K;
  cin>>N>>K;
  for(int i=0; i<K; i++){
    int d;
    cin>>d;
    for(int j=0; j<d; j++){
      int tmp;
      cin>>tmp;
      freq[tmp]++;
    }
  }
  int cnt=0;
  for(int i=1; i<=N; i++) if(freq[i]==0) cnt++;
  cout<<cnt<<endl;
  return 0;
}


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


using namespace std;

#define fastio() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define ll long long
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()


void go(){
	int n;cin>>n;
	vector<string> v{"AC","WA","TLE","RE"};
	unordered_map<string,int> cnt;
	while(n--) {
		string s;cin>>s;
		cnt[s]++;
	}
	for(string a : v) {
		cout << a << " x " << cnt[a] << "\n";
	}
}
int main(){
   
   fastio();
   cin.tie(0);
   cout.tie(0);

   go();

   return 0;
}




Measured memory_bytes: 3648
def answer(matrix):
    h = len(matrix)
    w = len(matrix[0])
    P, IM = ("Possible", "Impossible")
    cp = [0, 0] # current position
    rightBottom = [len(matrix)-1, len(matrix[0])-1]
    while(True):
        matrix[cp[0]][cp[1]] = '.'
        # Up
        if cp[0] > 0 and matrix[cp[0]-1][cp[1]] == '#': return IM
        # Left
        if cp[1] > 0 and matrix[cp[0]][cp[1]-1] == '#': return IM
        # Bottom
        if cp[0]+1 < h and matrix[cp[0]+1][cp[1]] == '#':
            if cp[1]+1 < w and matrix[cp[0]][cp[1]+1] == '#':
                return IM
            cp[0] = cp[0]+1
            continue
        # Right
        if cp[1]+1 < w and matrix[cp[0]][cp[1]+1] == '#':
            cp[1] = cp[1]+1
            continue
        if cp[0] == rightBottom[0] and cp[1] == rightBottom[1]:
            return P
    return P

h, w = map(int, input().split())
matrix = []
for _ in range(h):
    row = [c for c in input()]
    matrix.append(row)
print(answer(matrix))

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

using namespace std;
struct CinInit
{
    CinInit()
    {
        cin.tie(0);
        ios::sync_with_stdio(0);
        cout << fixed << setprecision(20);
    };
} CinInit;

int main()
{
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    for (int i = 0; i < n; i++)
    {
        int c;
        cin >> c;
        v[i] -= c;
    }

    sort(v.begin(), v.end(), greater<int>());

    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        if (v[i] <= 0)
            break;
        else
            ans += v[i];
    }

    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
int main(){
	int goat[3];
	std::cin >> goat[0] >> goat[1] >> goat[2];
	std::sort(goat, goat + 3);
	std::cout << goat[0] << " " << goat[1] << " " << goat[2] << "\n";
}

Measured memory_bytes: 1180
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int N, Q;

// Lazy Segment Tree (?????¶?????????????????°???????????¨)
// ?????????????????§??? (0-indexed, ?????? add, ?????? sum)
// Verified: AOJ DSL_2_E: Range Add Query (RAQ)

// ????????????????????? (?????????????????????????????§?????? 2 ??????)
constexpr ll SIZE = 1LL << 17;

template <typename T>
struct LazySegtree {
    T node[2*SIZE], lazy[2*SIZE];

    // ?????????
    LazySegtree() {}
    LazySegtree(vector<T> v) {
        for(size_t i=0; i<v.size(); ++i) {
            node[SIZE-1+i] = v[i];
        }
        for(int i=SIZE-2; i>=0; i--) {
            node[i] = node[2*i+1] + node[2*i+2];
        }
    }

    // ?????¶??????
    void lazyUpdate(int a, int b, int k) {
        int rng = b - a;
        node[k] += lazy[k] * rng;
        if(rng > 1) {
            lazy[2*k+1] += lazy[k];
            lazy[2*k+2] += lazy[k];
        }
        lazy[k] = 0;
    }

    // ?????? [a, b) ??? x ????¶????
    void add(int a, int b, T x, int l=0, int r=SIZE, int k=0) {
        lazyUpdate(l, r, k);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] += x;
            lazyUpdate(l, r, k);
        }
        else {
            int mid = (l + r) / 2;
            add(a, b, x, l, mid, 2*k+1);
            add(a, b, x, mid, r, 2*k+2);
            node[k] = node[2*k+1] + node[2*k+2];
        }
    }

    // ?????? [a, b) ?????????
    int sum(int a, int b, int l=0, int r=SIZE, int k=0) {
        lazyUpdate(l, r, k);
        if(b <= l || r <= a) return 0;
        if(a <= l && r <= b) return node[k];
        int mid = (l + r) / 2;
        T vl = sum(a, b, l, mid, 2*k+1);
        T vr = sum(a, b, mid, r, 2*k+2);
        return vl + vr;
    }
};

LazySegtree<int> seg;

int main() {
    cin >> N >> Q;
    for(int i=0; i<Q; i++) {
        int query; cin >> query;
        if(query == 0) {
            int s, t; ll x; cin >> s >> t >> x;
            seg.add(s-1, t, x);
        }
        else {
            int x; cin >> x;
            cout << seg.sum(x-1, x) << endl;
        }
    }
    return 0;
}

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

int main()
{
  int n;
  int p[200000];
  int ans = 0;
  int min = 200001;

  cin >> n;
  rep(i, n) {
    cin >> p[i];
    if (p[i] <= min) {
      min = p[i];
      ans++;
    }
  } 
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024
// Ninjo ~ khaledalam.net@gmail.com
#include <bits/stdc++.h>
using namespace std;
#define sz(A)      (int)(A).size()
#define all(B)     (B).begin(),(B).end()
#define ios        ios_base::sync_with_stdio(0);
#define file       freopen("input.txt", "r", stdin)

int main() {
//	file;
	string s;
	cin >> s;
	bool f = 0;
	for (int i = 0; i < sz(s); ++i) {
		if (s[i] == 'C') {
			f = 1;
		} else if (s[i] == 'F') {
			if (f == 1) {
				puts("Yes");
				return 0;
			}
		}
	}
	puts("No");
}



Measured memory_bytes: 384
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

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;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//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) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

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

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    LL n;
    cin>>n;
    VL p(n);
    REP(i,n)cin>>p[i];
    vector<PLL> index_p(n);
    REP(i,n){
        index_p[i] = MP(p[i], i);
    }
    SORT(index_p);
    reverse(ALL(index_p));

    multiset<LL> s;
    s.insert(-1);
    s.insert(-1);
    s.insert(n);
    s.insert(n);

    LL ans = 0;
    REP(i,n){
        LL index = index_p[i].second;
        auto upper = s.upper_bound(index);
        LL l1 = *prev(upper, 2);
        LL l2 = *prev(upper, 1);
        LL r1 = *(upper);
        LL r2 = *next(upper, 1);
        LL c = (l2 - l1) * (r1 - index) + (index - l2) * (r2 - r1);
        ans += c * p[index];
        s.insert(index);
    }
    PUTS(ans);
}

Measured memory_bytes: 7296
#include <stdio.h>

int main()
{
    int N,j;
    int i,isprime=0;
    scanf("%d",&N);
    float t=0;
    for(i=1;i<=9;i++){
        if(N%i==0)
            for(j=1;j<=9;j++)
            {
                t=(float)N/(float)j;
                if((t==1.0)||(t==2.0)||(t==3.0)||(t==4.0)||(t==5.0)||(t==6.0)||(t==7.0)||(t==8.0)||(t==9.0))
                {isprime=1; break;}
            
            }
            break;
        
    }
    if(isprime==1) printf("Yes");
    else printf("No");
    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

//Final Examination!
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			int max = 0;
			int min = 500;
			while(n--!=0){
				int s = 0;
				for(int i=0;i<5;i++)s+=sc.nextInt();
				max = Math.max(max, s);
				min = Math.min(min, s);
			}
			System.out.println(max+" "+min);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

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

int main() {
  //宣言
  int A, B;
  int ans = 0;
  int K1, K2;
  
  
  //入力
  cin >> A >> B;
  
  //処理
  ans = B/100 - A/100 +1;
  K1 = A/100*100 + A/1000%10*10 +A/10000;
  K2 = B/100*100 + B/1000%10*10 +B/10000;
  
  if(K1<A)ans--;
  if(K2>B)ans--;
  
  
  //出力
  cout << ans << endl;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
#include<set>
#include<stdio.h>
#include <bitset>
#include<string.h>
#define ii int64_t
#define PI 3.14
#define lli long long int
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
int main()
{
    fio;
    string s,t,ans;
    int64_t i,j,x,y;
    int dp[3004][3004];
    memset(dp, 0, sizeof(dp));
    cin>>s>>t;
    
    
    for(i=1;i<=s.length();i++)
        for(j=1;j<=t.length();j++)
        {
            if(s[i-1]==t[j-1])
                dp[i][j] = dp[i-1][j-1]+1;
            else
                dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
        }
    

    
    i=s.length();j=t.length();
    while(true)
    {

        if(i>0 && j>0&&s[i-1]==t[j-1])
            {ans +=s [i-1];i--;j--;}
        else if(i>0 && dp[i][j] == dp[i-1][j]) i--;
        else if(j>0 && dp[i][j] == dp[i][j-1]) j--;
        else break;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans;   
}

Measured memory_bytes: 35584
#define rep(i,n) for (int i=0;i<(n);i++)
#include <iostream>
#include <algorithm>
#include <string>
#include <string>
#include <cmath>
using namespace std;

	int main() {
		string a;
		cin >> a;
		rep(i, 4)
			cout << a[i];
		cout << " ";
		rep(i, 8)
			cout << a[i + 4];
		cout << endl;




	}



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

using namespace std;

long N;
string S;

bool check(int a, int b, int c){
    int ary[3] = {a, b, c};
    int i=0;
    for(int l=0; l<N; ++l){
        // cout<<S[i]<<" "<<ary[i]<<endl;
        if(S[l]=='0' + ary[i]){
            i++;
            if(i==3){
                return true;
            }
        }
    }
    return false;
}

int main(){
    cin>>N>>S;
    long ans = 0;
    for(int i=0; i<10; ++i){
        for(int j=0; j<10; ++j){
            for(int k=0; k<10; ++k){
                if(check(i, j, k)){
                    ans++;
                }
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}









Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
//using namespace atcoder;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
typedef vector<vector<int> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;

// auto mod int
// depends on Template

const int mod = 1000000007;
//const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

mint dp[2010][2010];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //input
    ll s;
    cin >> s;
    dp[0][0]=1;
    for(int i=1;i<=2000;i++){
        for(int j=0;j<=s+1;j++){
            dp[i][j]+=dp[i][j-1];
            if(j-3<0)continue;
            dp[i][j]+=dp[i-1][j-3];
        }
    }
    mint ans = 0;
    for(int i=1;i<=2000;i++){
        ans += dp[i][s];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 35196
#include <bits/stdc++.h>
#define int long long
#define p pair<int, int>
#define endl '\n'
const int INF = 1000000001;
const long double E = 0.00000001;

using namespace std;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n, m, k;
    cin >> n >> m >> k;
    vector<vector<char>> a(n, vector<char>(m));
    for (int q = 0; q < n; q++){
        for (int q1 = 0; q1 < m; q1++){
            cin >> a[q][q1];
        }
    }
    int ans = 0;
    for (int q = 0; q < (1 << n); q++){
        for (int q1 = 0; q1 < (1 << m); q1++){
            vector<vector<char>> s = a;
            for (int q2 = 0; q2 < n; q2++){
                if ((q >> q2) & 1){
                    for (int q3 = 0; q3 < m; q3++){
                        s[q2][q3] = '$';
                    }
                }
            }
            for (int q2 = 0; q2 < m; q2++){
                if ((q1 >> q2) & 1){
                    for (int q3 = 0; q3 < n; q3++){
                        s[q3][q2] = '$';
                    }
                }
            }
            int quan = 0;
            for (int q2 = 0; q2 < n; q2++){
                for (int q3 = 0; q3 < m; q3++){
                    quan += (s[q2][q3] == '#');
                }
            }
            ans += (quan == k);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &x){
	x = 0; int f = 1; char ch = getchar();
	while (!isdigit(ch)) {if (ch == '-') f = -1; ch = getchar();}
	while (isdigit(ch)) {x = x * 10 + ch - '0'; ch = getchar();}
	x *= f;
}
inline void write(int x){if (x > 9) write(x/10); putchar(x%10+'0'); }
string S;
int main(){
	cin >> S;
	int n = S.size(); while (n--) putchar('x'); putchar('\n');
    return 0;
}

Measured memory_bytes: 256
import math

S = int(input())

mod = 10 ** 9 + 7

max_length = S // 3  # because each of items must be greater than or equal to 3

ans = 0
for length in range(1, max_length + 1):
    # Subtracting 3 from each of items reduces S by 3 * length.
    # Now each of items are greater than or equal to 0.
    s = S - 3 * length

    # Consider a combination with repetition given:
    #  - "|" x (length - 1)
    #  - "o" x s
    # For example, if length = 2 and s = 3,
    #  | o o o  := {0, 3}
    #  o | o o  := {1, 2}
    #  o o | o  := {2, 1}
    #  o o o |  := {3, 0}
    # -> The answer is 4.
    c = math.factorial(s + length - 1) // (math.factorial(s) * math.factorial(length - 1))
    ans = (ans + c) % mod

print(ans)


Measured memory_bytes: 79396
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

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

signed main()
{
    int N; cin>>N;
    int ans=1;
    REP(i,N){
        int a; cin>>a;
        ans=lcm(ans,a);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long int;
int main (){
    int n;cin>>n;
    vector<ll>A(n);
    for(int i=0;i<n;i++)cin>>A[i];
    ll ret=0,sum=0;
    for(int i=0;i<n;i++){
            sum+=A[i];
            if(!A[i]){
                ret+=sum/2;
                sum=0;
            }
    }
    ret+=sum/2;
    cout<<ret<<endl;
    return 0;
}




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

int main() {
  long N, ABCDE[5], min = 1000000000000000, time; //A-0, B-1, C-2, D-3, E-4
  cin >> N >> ABCDE[0] >> ABCDE[1] >> ABCDE[2] >> ABCDE[3] >> ABCDE[4];
  for(int i = 0; i < 5; i++) {
    if(min > ABCDE[i]) {
      min = ABCDE[i];
    }
  }
  if(N % min == 0) time = N / min + 4;
  else time = N / min + 5;
  
  cout << time;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
 
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("-ffloat-store")
 
#define int  long long
#define rep(i,begin,end) for(__typeof(end)i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
#define F first
#define S second
#define sz(x) ((int)x.size())
#define pb push_back
#define pf push_front
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define what_is(x) cerr << #x << " is " << x <<"\n";
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.rbegin(), v.rend())
#define PI 3.14159265358979323846
#define vout(a) for(auto x:a) cout<<x<<" ";
#define INF 1000000000000000 //1e16
 
// #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
 
 
// using namespace __gnu_pbds;
using namespace std;
 
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
using vii = vector<pii>;
using mi  = multiset<int>;
using mii = multiset<pii>;
 
int lcm(int a,int b) {return (a*(b/__gcd(a,b)));}



void solve()
{
    int n,m,t,i,k,r,l,s,u,v,w,j,pos,sum=0,flag=0,count=0;
    string S,T,U; 
    int d;
    cin>>S>>T;
    n=sz(S);
    m=sz(T);
    int ans=INF;
    rep(i,0,n-m+1)
    {
        U=S.substr(i,m);
        // cout<<U<<"\n";
        count=0;
        rep(j,0,m)
        {
            count+=(U[j]!=T[j]);
        }
        ans=min(ans,count);
    }
    cout<<ans;
}


signed main()
{
    #ifndef ONLINE_JUDGE 
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve();
        if(t)cout<<"\n";
    }
    return 0;
}

Measured memory_bytes: 3660
#include<stdio.h>
#define N 100005
#define s 100

typedef struct{
 char name[s];
  int time;
}Q;

Q A[N+1];
int h, t;

void ENQ(Q J){ 
  if( N==t ) t = 0;
  A[t] = J;
  t++;
}
Q DEQ(void){
  if( h==N ) h = 0;
  return A[h++];
}

int main()
{
  int n, q, i, T=0;
  Q u;
  scanf("%d %d", &n, &q);
  
  for( i=0 ; i<n ; i++ ){
    scanf("%s %d", u.name, &u.time);
    ENQ(u);
  }
  while(n!=0){
    u = DEQ();
    if( u.time>q ){
      u.time = u.time - q; 
      T += q;
      ENQ(u);
    } 
    else{
      T += u.time;
      printf("%s %d\n", u.name, T);
      n--;
    }
  }
  return 0;
}

Measured memory_bytes: 10756
#include<stdio.h>
#include<string.h>
int main(void)
{
	char al[53]={"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"};
	char s[10001];
	int n,i,j;
	scanf("%d %s", &n, s);
	for(i=0; i<strlen(s); i++)
	{
		for(j=0; j<26; j++)
		{
			if(s[i]==al[j])
			printf("%c", al[j+n]);
		}
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 128
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.math.BigInteger; 
 public class Main
{
     static Scanner sc=new Scanner(System.in);
    static PrintWriter out=new PrintWriter(System.out);
    static void pn(Object o)
     {
    out.println(o);
    out.flush();
    
    }
    static void p(Object o)
    {
    out.print(o);
    out.flush();
    }
    static void pni(Object o)
    {
    out.println(o);System.out.flush();
    }
        static int I() throws IOException
    { 
    return sc.nextInt();
    }
    static long L()throws IOException
    {
    return sc.nextLong();
    }
    static double D()throws IOException
    {
    return sc.nextDouble();
    }
    static String S()throws IOException
    {
    return sc.next();
        }
        static void process() throws IOException
     {
         int n=I();
         long a[]=new long[n];long c=0;
         for(int i=0;i<n;i++)
         {
             a[i]=L();
            }
         for(int i=1;i<n;i++)
         {
            if(a[i]<a[i-1])
            {
                c=c+a[i-1]-a[i];
                a[i]=a[i-1];
            }
            
            }
         pn(c);
        }
         public static void main(String[] args) throws IOException
  {
   try
{
        process();
 }
catch(Exception e)
{
return;
}
}
             
         
       }
   

Measured memory_bytes: 63232
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
 cin>>s;
int count=0;
  if(s[0] =='o'){
  count++;
  }
    if(s[1] =='o'){
  count++;
  }
    if(s[2] =='o'){
  count++;
  }

  cout<<700+100*count;
  
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n;i>0;i--)
#define rep1(i,s,n) for(int i=s;i<n;i++)
#define max0(a,b,c) max(max(a,b),c)
#define min0(a,b,c) min(min(a,b),c) 
using namespace std;
using Graph = vector<vector<int>>;
typedef long long lint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldouble;
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<pair<int,int>> pvec;
typedef vector<pair<ll,ll>> plvec;
typedef vector<string> svec;

int main(){
    ull a,b,x;
    cin>>a>>b>>x;
    if(a%x!=0) cout<<b/x-a/x;
    else cout<<b/x-a/x+1;
}

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

int main(){
  int n,ans=3e5,l,r;
  string s;
  cin>>n>>s;
  vector<int> a(n+2);
  a[0] = 0;
  int count=0;
  for(int i=0; i<n; i++) {
    if(s[i]=='W') count++;
    a[i+1]=count;
  }
  a[n+1]=a[n];
  for(int i=1; i<=n; i++) {
    l = a[i-1];
    r = n - i - (a[n] - a[i]);
    ans = min(ans, l+r);
  }
  cout<<ans;
}

Measured memory_bytes: 1796
package main

import (
	"fmt"
)

var m map[int]int

func main() {
	var h int
	fmt.Scan(&h)
	m = make(map[int]int)
	m[1] = 1
	fmt.Println(calc(h))
}

func calc(n int) int {
	if a, ok := m[n]; ok {
		return a
	}
	m[n] = calc(n/2) + calc(n/2) + 1
	return m[n]
}


Measured memory_bytes: 512
N = input()
N = int(N)
s = [[ i for i in input().split()] for i in range(N)]
for i in range(N):
    s[i][1] = int(s[i][1])
    s[i].append(i + 1)
sorteds = sorted(s, key=lambda x:x[1],reverse = True)
sorteds.sort(key=lambda x:x[0])


for k in sorteds:
  print(k[2])

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
 
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for (int i=a; i<b; i++)
// #define endl "\n"
const int mod = 1000000007;

ll power(ll x, ll y) 
{ 
    ll res = 1;     // Initialize result 
   
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = res*x; 
        res%=mod;
        // n must be even now 
        y = y>>1; // y = y/2 
        x = x*x;
        x%=mod;  // Change x to x^2 
    } 
    return res%mod; 
}

int main() {
    ios_base::sync_with_stdio(false);    //Fast I/O
    cin.tie(NULL);
 
    // freopen("input.txt", "r", stdin);    // Read and write from a file
    // freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    vector<int> arr(n,0);
    rep(i,0,n)
        cin >> arr[i];

    if(n<2){
        cout << 0 << endl;
        return 0;
    }
    vector<int> dp(n,INT_MAX);
    dp[0]=0;    
 
    for(int i=0; i<n; i++){
        if(i+1<n)
            dp[i+1] = min(dp[i+1], dp[i]+abs(arr[i+1]-arr[i]));
        if(i+2<n)
            dp[i+2] = min(dp[i+2], dp[i]+abs(arr[i+2]-arr[i]));
    }

    cout << dp[n-1] << endl;
 
    return 0;
}

Measured memory_bytes: 1024
/*
Stay away from
               ,----..                                                             ,---.-,
  ,----..     /   /   \                   ,---,     ,---,                 ,---,   '   ,'  '.
 /   /   \   /   .     :         ,---. ,`--.' |   .'  .' `\            ,`--.' |  /   /      \
|   :     : .   /   ;.  \       /__./| |   :  : ,---.'     \          /    /  : .   ;  ,/.  :
.   |  ;. /.   ;   /  ` ;  ,---.;  ; | :   |  ' |   |  .`\  |        :    |.' ' '   |  | :  ;
.   ; /--` ;   |  ; \ ; | /___/ \  | | |   :  | :   : |  '  |        `----':  | '   |  ./   :
;   | ;    |   :  | ; | ' \   ;  \ ' | '   '  ; |   ' '  ;  :           '   ' ; |   :       ,
|   : |    .   |  ' ' ' :  \   \  \: | |   |  | '   | ;  .  |  ---      |   | |  \   \      |
.   | '___ '   ;  \; /  |   ;   \  ' . '   :  ; |   | :  |  '           '   : ;   `---`---  ;
'   ; : .'| \   \  ',  /     \   \   ' |   |  ' '   : | /  ;            |   | '      |   |  |
'   | '/  :  ;   :    /       \   `  ; '   :  | |   | '` ,/             '   : |      '   :  ;
|   :    /    \   \ .'         :   \ | ;   |.'  ;   :  .'               ;   |.'      |   |  '
 \   \ .'      `---`            '---"  '---'    |   ,.'                 '---'        ;   |.'
  `---`                                         '---'                                '---'

to save your life.
*/
#define   ll                long long
#define   pb                push_back
#define   ff                first
#define   ss                second
#define   srt(v)            sort(v.begin(),v.end())
#define   inf               2000000000000000
#define   mxn               3000
#define   pi                acos(-1)
#define   MOD               1000000007
#define   db(x)             printf("### VALUE: (%lld) ###\n",(ll)x)
#include  <bits/stdc++.h>
using namespace std;

ll n;
double arr[mxn];
double dp[mxn][mxn];
ll visit[mxn][mxn];

double solve(ll i,ll cnt)
{
    if(i > n){
        if(n - cnt < cnt) return 1.0;
        else return 0.0;
    }
    if(visit[i][cnt]) return dp[i][cnt];
    double ret1 = 0,ret2 = 0;
    ret1 = arr[i] * solve(i+1,cnt+1);
    ret2 = (1 - arr[i]) * solve(i+1,cnt);
    visit[i][cnt] = true;
    return dp[i][cnt] = ret1+ret2;
}

int main()
{
    cin >> n;
    for(ll i = 1;i <= n;i++){
        double x; cin >> arr[i];
    }
    printf("%.15lf\n",solve(1,0));
}
/*
".....but the truth is that you can increase it slightly."
Day 16.

*/


Measured memory_bytes: 139392
#include<iostream>
#include<vector>
#include<string>
#include<stdlib.h>
#include<algorithm>
#include<math.h>
#include<queue>
#include <forward_list>
using namespace std;

int main() {
	int N, X;

	cin >> N >> X;

	vector<int> L(N);

	for (int i = 0; i < N; i++) {
		cin >> L[i];
	}

	int count = 0;
	int D = 0;
	while (true) {
		D = D + L[count];
		if (D > X)
			break;
		else
			count++;

		if (count == N)
			break;
	}

	cout << count+1 << endl;

}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    string s;

    cin >> s;

    string Ans = "Yes";

    if(s.at(0) == s.at(1) && s.at(1) == s.at(2)) Ans = "No";

    cout << Ans << endl;

} 


Measured memory_bytes: 256
//自称高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
    int ans = 0;
	vector <int> c(3);
	cin >> c[0] >> c[1] >> c[2];
	sort(c.begin(), c.end());

    cout << c[2]-c[1] + c[1] - c[0] << endl;
}

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

using namespace std;

int main()
{
    string s; cin >> s;

    for (int i = 0; i < 3; i++) {
        if (s[i] == s[i+1]) {
            cout << "Bad" << endl;
            return 0;
        }
    }

    cout << "Good" << endl;

    return 0;
}


Measured memory_bytes: 256