akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define pi (acos(-1))
#define ull  unsigned long long
#define ld long double
///freopen("input.txt","r",stdin);
///freopen("output.txt","w",stdout);
#define M 100000
ll LCM(ll a, ll b)
{
    ll g = __gcd(a,b);
    return (a*b)/g ;
}
string numtostr(ll n)
{
    ostringstream str1 ;
    str1 << n ;
    return str1.str();
}
ll strtonum(string s)
{
    ll x ;
    stringstream str1(s);
    str1 >> x ;
    return x ;
}
int h1,m1,h2,m2,a;
int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>h1>>m1>>h2>>m2>>a;
    cout<<h2*60+m2-(h1*60+m1)-a<<'\n';
    return 0;
}


Measured memory_bytes: 3640
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include <iomanip>
using namespace std;

int main(){
	int n,a,b,ans=0;
	cin>>n>>a>>b;
	for(int i=0;i<=n;i++){
		if(i%10+(i/10)%10+(i/100)%10+(i/1000)%10+(i/10000)%10>=a&&i%10+(i/10)%10+(i/100)%10+(i/1000)%10+(i/10000)%10<=b){
			ans+=i;
		}
	}
	cout<<ans<<endl;
	
	return 0;
	
}

Measured memory_bytes: 256
#include<iostream>

#include<cmath>
#include<string>
#include <algorithm> 

#include <boost/format.hpp>

using namespace std;

# define p(s) cout << s << endl;
# define printStr(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) cout << (j ? "Yes" : "No") << endl;

string lpad(string l,int s,int n){
    string temp = to_string(n);
    string res = "";
    int loop = s - temp.size();
    while(loop--) res+=l;

    return res+temp;
}

int main()
{
    int res=0;
    string str;
    cin >> str ;

    for(int i=0 ; i < 4; i++) {
        string t = str.substr(i,1);
        if(t=="+") res++;
        if(t=="-") res--;
    }

    p(res)
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }

typedef long long ll;

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

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 int INF = 1e9;
const ll INFLL = 1e18;
const ll MOD = 1e9+7;

const double PI = acos(-1.0);

class modint {
  public:
    using ll = long long;
    ll num;
    static const ll MOD = 1e9+7;
    static vector<modint> factorial;
    modint(): num(0) {};
    modint(ll _n): num((_n + MOD) % MOD) {}
    modint(const modint &r): num(r.num) {}
    operator ll() const { return (num+MOD)%MOD; }
    friend istream& operator>>(istream& is, modint &r){
        ll num_;
        is >> num_;
        r = num_;
        return is;
    }
    modint operator+(const modint &r) const { return modint(num + r.num); }
    modint operator-(const modint &r) const { return modint(num - r.num); }
    modint operator*(const modint &r) const { return modint(num * r.num); }
    template<typename T>
    modint operator^(const T &r) const {
        if(r == 0) return 1;
        return (((*this)*(*this)) ^ (r/2)) * modint(r&1 ? num : 1);
    }
    modint operator/(const modint &r) const { return num * (r^(MOD-2)); }
    modint operator+=(const modint &r) { return *this = *this + r; }
    modint operator-=(const modint &r) { return *this = *this - r; }
    modint operator*=(const modint &r) { return *this = *this * r; }
    modint operator/=(const modint &r) { return *this = *this / r; }
    template<typename T>
    modint operator^=(const T &r) { return *this = *this ^ r; }
    static modint fact(int n){
        if((int)factorial.size() <= n) factorial.resize(n+1);
        if(factorial[n]) return factorial[n];
        if(n == 0) return 1;
        return factorial[n] = modint(n) * fact(n-1);
    }
    static modint C(ll n,ll r){
        return n >= r ? fact(n)/(fact(n-r)*fact(r)) : modint(0);
    }
};
vector<modint> modint::factorial;
#define fact(n) modint::fact(n)
#define C(n,r) modint::C(n,r)
#define H(a,b) C(a+b, a)

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    ll x,y;
    cin>>x>>y;
    ll z = min(x,y);
    modint ans = 0;
    if((x + y)%3 == 0){
        ll n = (x + y)/3;
        ll l = z-n;
        if(l >=0){
            cerr<<n<<"C"<<l<<endl;
            modint a = C(n,l);
            ans = a;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 28116
H, W = map(int, input().split())

base_word = [input() for _ in range(H)]

ans = ['#' * (W+2)]

for index, word in enumerate(base_word):
    ans.append("#{0}#".format(word))

ans.append('#' * (W+2))

for i in range(H+2):
    print(ans[i])

Measured memory_bytes: 3060
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

vector<int> g[3 * 100000];

int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    g[3 * u].push_back(3 * v + 1);
    g[3 * u + 1].push_back(3 * v + 2);
    g[3 * u + 2].push_back(3 * v);
  }
  int s, t;
  cin >> s >> t;
  s--, t--;
  queue<int> que;
  vector<int> dp(3 * n, -1);
  que.push(3 * s);
  dp[3 * s] = 0;
  while (!que.empty()) {
    int v = que.front();
    que.pop();
    for (auto u : g[v]) {
      if (dp[u] == -1) {
        dp[u] = dp[v] + 1;
        que.push(u);
      }
    }
  }
  cout << (dp[3 * t] == -1 ? -1 : dp[3 * t] / 3) << endl;
  return 0;
}

Measured memory_bytes: 17792
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    m1, d1 = list(map(int, readline().split()))
    m2, d2 = list(map(int, readline().split()))
    print(1 if m1 != m2 and m1 < m2 else 0)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 38384
import sys
readline = sys.stdin.readline
class Tree:
    def __init__(self):
        self.id = 0
        self.p = -1
        self.depth = -1
        self.type = "leaf"
        self.len_c = 0
        self.c = []
    def __str__(self):
        return f"node {self.id}: parent = {self.p}, depth = {self.depth}, {self.type}, {self.c}"
n = int(input())
li = [Tree() for _ in range(n)]
for _ in range(n):
    id, k, *c = map(int, readline().split())
    if k == 0:
        c = []
    else:
        li[id].type = "internal node"
    li[id].id = id
    li[id].c = c
    for j in c:
        li[j].p = id
root = 0
while True:
    a = li[root].p
    if a == -1:
        li[root].type = "root"
        li[root].depth = 0
        break
    root = a
dp = [(root, 0)]
while dp:
    id, d = dp.pop()
    for i in li[id].c:
        li[i].depth = d + 1
        dp.append((i, d + 1))
for i in range(n):
    print(li[i])



Measured memory_bytes: 47640
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"

using namespace std;
const long long MOD = (long long)1e9 + 7;

int a, b, h, m;
double PI = 3.14159265358;

int main()
{
	//ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	scanf("%d%d%d%d", &a, &b, &h, &m);
	int x = 360 * h / 12;
	int y = 360 * m / 60;
	double xx = y * 1.0 / 12 + x;
	double z = abs(xx - y);
	if (z > 180) z = 360 - z;
	double an = z * PI / 180;
	int tmp = a * a + b * b;
	double kk = cos(an);
	double ans = tmp - 2 * a * b * kk;
	ans = sqrt(ans);
	printf("%.15lf\n", ans);
	//system("pause");
	return 0;
}

Measured memory_bytes: 4228
#include<stdio.h>

int main() {

	int a, b;
	char op;

	while (1) {
		scanf("%d %c %d", &a, &op, &b);
		if (op == '?')break;


		if (op == '+') {
			printf("%d\n", a + b);
		}
		else if (op == '-') {
			printf("%d\n", a - b);
		}
		else if (op == '*') {
			printf("%d\n", a * b);
		}
		else {
			printf("%d\n", a / b);
		}
		
	}
	return 0;
}


Measured memory_bytes: 2088
program test 
implicit none
  integer,allocatable::p(:),q(:)
  integer :: n,i,ans,a,b,k,l,h,s
  read*,n
  allocate(p(n))
  allocate(q(n))
  read(*,*)(p(i),i=1,N)
  read(*,*)(q(i),i=1,N)
  s=1
  k=0
  l=0
  s=1
  do i=1,n
    a=0
    b=0
    	do h=1,n-i+1
        	if(p(h)<p(n-i+1))then
            	a=a+1
            else 
            	a=a
            end if
            if(q(h)<q(n-i+1))then
            	b=b+1
            else 
            	b=b
            end if
        end do
	k=(p(n-i+1)-a-1)*s+k
    l=(q(n-i+1)-b-1)*s+l
    s=s*i
  end do
  ans=abs(k-l)
  print*,ans
end program test

Measured memory_bytes: 768
import math

a = int(input())
flag = False
result = 1e13
for i in range(2, int(math.sqrt(a)) + 1):
    if a % i == 0:
        flag = True
        result = min(result, i + int(a / i) - 2)
if not flag:
    print(a - 1)
else:
    print(result)

Measured memory_bytes: 3188
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int d = scan.nextInt();
		long g = scan.nextLong();
		long min = 1<<29;
		int[] p = new int[d];
		int[] c = new int[d];
		for (int i = 0; i < d; i++) {
			p[i] = scan.nextInt();
			c[i] = scan.nextInt();
		}
		for (int bit = 0; bit < (1 << d) ; bit++) {
			long sum = 0;
			int count = 0;
			for (int i = 0; i < d; i++) {
				if ((bit & (1<< i)) != 0) {
					sum += c[i ]+ (p[i]*100*(i+1));
					count += p[i];
				}
			}
				if (sum>=g) min = Math.min(min, count);
				else {
					for (int j = d-1; j >= 0; j--) {
						if ((bit & (1<< j)) != 0) continue;
						for (int k = 0; k < p[j]; k++) {
							if (sum>=g) break;
							sum += (j+1)*100;
							count++;
						}
					}
					min = Math.min(min, count);
				}
			}
		System.out.println(min);
	}
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
int main()
{
    //int t;cin>>t;while(t--)
    {
        ll b,c,d,i,j,k,l,m,n,cnt=0,sum=0;
        cin>>n>>k;
        int arr[n];
        for(i=0;i<n;i++)
            cin>>arr[i];
        sort(arr,arr+n);
        for(i=0;i<k;i++)
            sum+=arr[i];
        cout<<sum<<endl;



    }
}


Measured memory_bytes: 3636
import sys
s=list(raw_input())
t=list(raw_input())
s.sort()
t.sort()
t.reverse()
N=len(s)
M=len(t)


for i in s:
	for j in t:
		if j==i:
			pass
		elif j>i:
			print "Yes"
			sys.exit()
		else:
			print "No"
			sys.exit()
else:
	if M>N:
		print "Yes"
	else:
		print "No"				

Measured memory_bytes: 2568
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
int K;

double f(ll x){
	int s = 0;
	ll y = x;
	while(y>0){
		s += y%10;
		y /= 10;
	}
	return (double)x/s;
}

int main(){
	cin >> K;

	cout << 1 << endl;
	ll x = 2;
	for(int i=1; i<K; i++){
		ll z, y;
		z = y = x;
		double fmin = f(z);
		for(ll d=1; d<=x; d*=10){
			y = y + (9-(y/d)%10)*d;
			double fy = f(y);
			if(fy < fmin){
				z = y;
				fmin = fy;
			}
			//cout << y << "(" << fy << ")" << endl;
		}
		cout << z << endl;
		x = z+1;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int a, b;
  cin >> a >> b;
  if((a+b)%2 == 0)
  cout << (a+b)/2 << endl;
  if((a+b)%2 == 1)
    cout << (a+b)/2+1 <<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

typedef long long ll;

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

#define debug(x) cout << #x << "=" << x << endl;

#define MOD (int)1e+9+7

using namespace std;

//B. Training Camp

//トレーニング数 1≦ N ≦10^5 が与えられる
// i 回目のトレーニングでパワーが i 倍される
//パワーの初期値は 1

//最終的なパワーを10^9+7で割ったあまりを求める

long long fact(long long  N){

    if(N == 0) return 1;
    long long res = N * fact(N-1);
    res %= MOD;
    return res;
}

int main(void){

  int N;
  cin >> N;

  cout << fact(N) << endl;
    
  return 0;
}


Measured memory_bytes: 1792
process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {

var line = chunk.split(' ');
var W = Number(line[0]);
var H = Number(line[1]);
var x = Number(line[2]);
var y = Number(line[3]);
var r = Number(line[4]);

if(W >= x+r && H >= y+r && 0 <= x-r && 0 <= y-r){
console.log("Yes");
}else{
console.log("No");
}
    
});

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


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)

#define mt              make_tuple
#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////

int main()
{
    FASTIO;


    set<char>s1,s2;


    string s , t;


    cin >> s >> t;

    int len1 = s.length();

    int len2 = t.length();

    for(int i=0; i<len1; i++)
    {
        if(s[i]!=t[i])
        {
            cout << "No" << endl;
            return 0;
        }
    }

    if(len2=len1+1)
    {
        cout << "Yes" << endl;
        return 0;
    }
    else
    {
        cout << "No" << endl;
    }







    return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;

signed main() {
	string s, t;
	cin >> s >> t;
	
	string u;
	for (int i = 0; i < t.length() - 1; i++) u += t[i];
	if (s == u) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3628
package main
import "fmt"
func main() {
  var h,w int
  var s string
  fmt.Scan(&h,&w)
  for i:=0;i<h;i++ {
    for j:=0;j<w;j++ {
      fmt.Scan(&s)
      if s == "snuke" { fmt.Printf("%c%d\n",j+65,i+1);return }
    }
  }
}

Measured memory_bytes: 512
length = gets.to_i
slimes = gets

if length == 0
  puts 0
  exit
end

last_slime = slimes[0]
count = 0
(0..length).each do |i|
  if last_slime != slimes[i]
  	count += 1
    last_slime = slimes[i]
  end
end

puts count

Measured memory_bytes: 14284
#include <stdio.h>

int main(){
  long long a, b, x;
  
  scanf("%lld", &a);
  scanf("%lld", &b);
  
  x = a * b;
  
  if(a < b){
    long long temp = a;
    a = b;
    b = temp;
  }
  
  long long r = a % b;
  while(r != 0){
    a = b;
    b = r;
    r = a % b;
  }
  
  printf("%lld\n", x / b);
  return 0;
}

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

#define froop1(a,n) for(int i = a;i < n;i++)
#define froop2(a,n) for(int i = a;i > n;i--)

#define ll long long

#define pq(name,type) priority_queue<type> name
#define vec(name,type,length,value) vector<type> name(length,value)
#define vec2(name,type,length,width,value) vector<vector<type>> name(length,vector<type>(width,value));

int main(){
	string s;
  cin >> s;
  int a = s.length();
  froop1(0,a - 1){
    if(s[i] != s[i + 1]){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
return 0;
}

Measured memory_bytes: 3516
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, a, b) for(int i = a; i < b; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define debug(x) cerr <<__LINE__<< ": " <<#x<< " = " << x << endl
#define debug_vec(v) cerr<<__LINE__<<": "<<#v<<" = ";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
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 int INF = (1<<30) - 1;
const ll LINF = (1LL<<60) - 1;

void solve() {
    string s;
    cin >> s;
    rep(i,(int)s.size()) cout << "x";
    cout << endl;
}

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


Measured memory_bytes: 3620
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define ROOP(i, N) for(int i=0; i<N; i++)
#define RVROOP(i, N) for(int i=N; i>=0; i--)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
  ll N, A, B; cin>>N>>A>>B;
  ll ans;
  if((B-A)%2==0){
    ans=min((B-A)/2, (A+B-2)/2);
    ans=min(ans, (2*N-A-B)/2);
  }
  else{
    ans=min((A+B-1)/2, (2*N-A-B+1)/2);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, K = LI()
    baisu = set()
    khalf = set()
    cnt = 0
    gusu = (K % 2 == 0)
    for x in range(1, N+1):
        if gusu and x % K == K // 2:
            khalf.add(x)
            continue
        if x % K != 0:
            continue
        baisu.add(x)
    cnt += len(baisu) ** 3
    cnt += len(khalf) ** 3
    print(cnt)


main()



Measured memory_bytes: 23540
import heapq

t = int(input())
for i in range(t):
    n = int(input())
    a1 = []
    a2 = []
    ans = 0
    for j in range(n):
        k, l, r = map(int, input().split())
        if l > r:
            a1.append([l - r, k])
            ans += l
        elif l < r:
            a2.append([r - l, n - k])
            ans += r
        else:
            ans += l
    a1.sort(key = lambda x: x[1])
    a2.sort(key = lambda x: x[1])
    num = 1
    num2 = 0
    num3 = 0
    queue = []
    heapq.heapify(queue)
    while num <= n:
        if num2 == len(a1):
            break
        else:
            while a1[num2][1] == num:
                heapq.heappush(queue, a1[num2])
                num2 += 1
                num3 += 1
                if num2 == len(a1):
                    break
            while num3 > num:
                temp = heapq.heappop(queue)
                ans -= temp[0]
                num3 -= 1
            else:
                num += 1
    num = 0
    num2 = 0
    num3 = 0
    queue = []
    heapq.heapify(queue)
    while num <= n:
        if num2 == len(a2):
            break
        else:
            while a2[num2][1] == num:
                heapq.heappush(queue, a2[num2])
                num2 += 1
                num3 += 1
                if num2 == len(a2):
                    break
            while num3 > num:
                temp = heapq.heappop(queue)
                ans -= temp[0]
                num3 -= 1
            else:
                num += 1
    print(ans)

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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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; }

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

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

  string s, t;
  cin >> s >> t;

  bool ok = true;
  rep(i, s.length()){
    if(s[i] != t[i]){
      ok = false;
    }
  }

  if(ok){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  

  return 0;
}


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

using namespace std;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int x;
    cin >> x;
    cout << 360/gcd(x,360);
    return 0;
}

Measured memory_bytes: 3656
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]


def dfs(cur, a, b, c):
    if cur == N:
        return abs(A - a) + abs(B - b) + abs(C - c) - 30 if min(a, b, c) > 0 else 10 ** 9
    no_add = dfs(cur + 1, a, b, c)
    add_a = dfs(cur + 1, a + l[cur], b, c) + 10
    add_b = dfs(cur + 1, a, b + l[cur], c) + 10
    add_c = dfs(cur + 1, a, b, c + l[cur]) + 10

    return min(no_add, add_a, add_b, add_c)


print(dfs(0, 0, 0, 0))


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

int n;
struct node
{
	int val, cnt;
}nodes[5];
bool solve()
{
	int a;
	int cnt = 0;
	memset(nodes, 0, sizeof(nodes));
	int t;
	cin >> t;
	for (int i = 1; i < n; ++i)
	{
		cin >> a;
		t = t ^ a;
	}
	return t == 0;
}

int main()
{

		cin >> n;
		if (n == 3)
		{
			int a, b, c;
			cin >> a >> b >> c;
			if (a^b^c)cout << "No";
			else cout << "Yes";
		}
		else
		{
			if (solve())cout << "Yes";
			else cout << "No";
		}


//	system("pause");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

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

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

int main() {
  vector<int> s(3);
  rep(i, 3) cin >> s[i];

  map<int, int> m;
  rep(i, 3) {
    m[s[i]]++;
  }

  if (m[5] == 2 && m[7] == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long LL;
double PI=acos(-1);


int main()
{
    int a,b;
    while(cin>>a>>b){
        cout<<(a+b)%24<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
function main(input) {                                                                                                                                                                                 
    console.log(input.split('1').length - 1);                                                                                                                                                          
}                                                                                                                                                                                                      
                                                                                                                                                                                                       
main(require('fs').readFileSync('/dev/stdin', 'utf8')) 

Measured memory_bytes: 7372
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <typeinfo>
using namespace std;


// define list


namespace  math{
    const double PI = 3.14;
    const int INF = 1000000007;
    int GCM(int a,int b); //最大公約数
    int LCM(int a,int b); //最小公倍数
    int Pemu(int n,int r); //順列
    int Comb(int n,int m); //組み合わせ
    int Digit(int N); //桁和
    
    int GCM(int a,int b){
        if(a<b){
            swap(a,b);
        }
        int r = a%b;
        while (r!=0)
        {
            a=b;
            b=r;
            r=a%b;
        }
        return b;
    }

    int LCM(int a,int b){
        return a*(b/GCM(a,b));
    }

    int Pemu(int n,int r){
        int ans = n;
        for(int i=1;i<r;i++){
            ans*=(ans-i);
        }
        return ans;
    }

    int Comb(int n,int m){
        int a=n,b=m;
        for(int i=1;i<m;i++){
            a *= (a-i);
        }
        for(int i=1;i<m;i++){
            b *= (b-i);
        }
        
        return a/b;
    }

    int Digit(int N){
        if(N<10){
            return N;
        }
        int r = 0;
        while (N>=10)
        {
            r += (N%10);
            N /= 10;
        }
        r += N;
        return r;
    }
}

namespace SubLib{
    #define int long long
    #define double long double
    #define incin(n) int (n); cin >> (n);
    #define strcin(s) string (s); cin >> (s);
    #define incin2(a,b) int a,b; cin >> a >> b; 
    #define rap(n,i) for(int (i) = 0;i<(n);(i)++)
    #define input(n,v) (v) = SubLib::Input((n),(v))
    #define all(v) (v).begin(),(v).end()
    using intv = vector<int>;
    using strv = vector<string>;
    using charv = vector<char>;
    template <class T1>
    using pvec = vector<pair<T1,T1>>;
    template <typename T> vector<T> Input(int n,vector<T> v){
        for(int i=0;i<n;i++){
            cin >> v.at(i);
        }
        return v;
    }
}

using namespace math;
using namespace SubLib;

signed main(){
    incin(x);
    if(x%Digit(x)==0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

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

int main() {
	int A, B, C;
	cin >> A >> B >> C;
	
	int D = 3 * max(A, max(B, C)) - (A + B + C);
	D += D % 2 * 3;
	cout << D / 2 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n;
  cin>>n;
  vector<int>a(n),b(n);
  rep(i,n){
    cin>>a[i];
    b[i]=a[i];
  }
  sort(rall(b));
  rep(i,n){
    int ans=b[0];
    if(a[i]==b[0])ans=b[1];
    cout<<ans<<endl;
  }
}

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

#define dbg(a)	cerr << #a << " = " << a << endl;

long long cost(int x[], int n, int p){
	long long ret = 0;
	for (int i = 0; i < n; ++i){
		ret += (x[i]-p)*(x[i]-p);
	}
	return ret;
}
int main(){
	int n;	cin >> n;
	int x[n];
	for (int i = 0; i < n; ++i){
		cin >> x[i];
	}
	sort(x, x+n);
	int lo = 0, hi = 100;
	for (int i = 0; i < 100; ++i){
		int lm = lo + (hi - lo) / 3;
		int rm = hi - (hi - lo) / 3;
		int costlm = cost(x, n, lm);
		int costrm = cost(x, n, rm);
		if(costlm < costrm){
			hi = rm;
		}
		else{
			lo = lm;
		}
	}
	long long ans = cost(x, n, lo);
	for (int i = max(0, lo-5); i < (lo+5); ++i){
		ans = min(ans, cost(x, n, i));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main() {

    int a, b;
    scanf("%d%d", &a, &b);

    puts(a * b % 2 != 0 ? "Yes" : "No");


    return 0;

}


Measured memory_bytes: 128
use itertools_num::ItertoolsNum;
use proconio::input;
use std::iter::once;

fn main() {
    input!(n: usize, m: usize, k: u64, a: [u64; n], b: [u64; m]);
    println!(
        "{}",
        once(0)
            .chain(a.into_iter())
            .cumsum()
            .take_while(|&x: &u64| x <= k)
            .enumerate()
            .scan(
                once(0)
                    .chain(b.into_iter())
                    .cumsum()
                    .enumerate()
                    .collect::<Vec<(usize, u64)>>()
                    .into_iter()
                    .rev()
                    .peekable(),
                |b, (i, x)| {
                    while b.peek().map(|(_, y)| k < x + y).unwrap_or(false) {
                        b.next();
                    }
                    Some(i + b.peek().unwrap().0)
                }
            )
            .max()
            .unwrap()
    );
}


Measured memory_bytes: 12388
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define F first
#define S second
#define db double
#define pb push_back
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
using namespace std;
 
 ll mod=1e9 +7;
 
ll expo(ll base,ll exponent,ll mod){
    ll ans=1;
    while(exponent!=0){
        if(exponent&1) ans=(1LL*ans*base)%mod;
        base=(1LL*base*base)%mod;
        exponent>>=1;
    }
    return ans%mod;
}
 
vector<bool>  prime(90000002,true);
void Sieve() 
{ 
   
    for (int p=2; p*p<=90000001; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            for (int i=p*p; i<=90000001; i += p) 
                prime[i] = false; 
        } 
    } 
}

const ll M=200006;
ll f[M],inv[M];

void compute(){
    f[0]=1;
    rep(i,1,M-1){
        f[i]=(1LL*i*f[i-1])%mod;
    }
    inv[M-1]=expo(f[M-1],mod-2,mod);
    for(ll i=M-2;i>=0;i--){
        inv[i]=(1LL*(i+1)*inv[i+1])%mod;
    }
}
ll C(ll n,ll r){
    return (1LL*((1LL*f[n]*inv[r])%mod)*inv[n-r])%mod;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // compute();
    // Sieve();
    ll tests=1;
    // cin>>tests;
    while(tests--)
    {
      ll n,i,j;
      cin>>n;
      ll ans=0;
      rep(i,1,n)
      {
        if(i%3!=0 && i%5!=0) ans+=i;
      }
      cout<<ans;
    }
    return 0;
   }

Measured memory_bytes: 14164
N = int(input())
A = []
B = []
for n in range(N):
    a, b = [int(n) for n in input().split()]
    A.append(a)
    B.append(b)

A.sort()
B.sort()

if N % 2 == 0:
    median_max = B[N//2-1] + B[N//2]
    median_min = A[N//2-1] + A[N//2]
    print(median_max - median_min + 1)
else:
    print(B[N//2] - A[N//2] + 1)


Measured memory_bytes: 25460
#include <stdio.h>

int
main(void)
{
  int a, b;
  scanf("%d%d", &a, &b);
  if (a < b) {
    printf("a < b\n");
  }
  else if (a > b){
    printf("a > b\n");
  }
  else {
    printf("a == b\n");
  }
  return 0;
}

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

using namespace std;

int main(){
  
  string s;
  int n;
  
  cin>>n;
  cin>>s;
  
  if(n % 2 !=0){
    cout<<"No"<<endl;
    return 0 ;
  }
  
  for(int i = 0 ;i < n/2 ;i++){
  
	if(s.at(i) != s.at(i + n / 2)){
      cout<<"No"<<endl;
      return 0 ;
    }
    if(i == n / 2 - 1) cout<<"Yes"<<endl;
  }
}

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

long long int Fac(int a) {
  long long int f[114514]; 
  f[0] = 1; 
  for (int i = 1; i < 114514; ++i){
     f[i] = (f[i-1] * i) % 1000000007;  
  }
 return f[a];
}
int main() {
    int N, M;  
    cin >> N >> M; 
  if(abs(N-M) == 0) cout << (((2 * Fac(N)) % 1000000007) * Fac(N)) % 1000000007  << endl;
  else if(abs(N-M) == 1) cout << (Fac(M) * Fac(N)) % 1000000007 << endl; 
  else cout << 0 << endl;  
}

Measured memory_bytes: 1152
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;

#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)
int const inf=1<<28;
int const size=500;
int g[size][size];

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

void move(int sx, int sy, int t){
    queue<int> qx,qy;
    qx.push(sx), qy.push(sy);
    g[sy][sx]=0;
    while(qx.size()){
        int x=qx.front(); qx.pop();
        int y=qy.front(); qy.pop();
        if(g[y][x]>t) continue;
        rep(d,6){
            int nx=x+dx[d];
            int ny=y+dy[d];
            // cout << nx << " " << ny << endl;
            if(g[ny][nx]>g[y][x]+1){
                if(g[ny][nx]==-1) continue;
                g[ny][nx]=g[y][x]+1;
                qx.push(nx);
                qy.push(ny);
            }
        }
    }
}

int main(){
    int t,n;
    while(cin>>t>>n && t|n){
        rep(i,size)rep(j,size)g[i][j]=inf;
        rep(i,n){
            int x,y; cin>>x>>y;
            x+=size/2; y+=size/2;
            g[y][x]=-1;
        }
        int sx,sy; cin>>sx>>sy;
        sx+=size/2; sy+=size/2;
        move(sx,sy,t);
        int c=0;
        rep(i,size)rep(j,size){
            if(g[i][j]!=-1 && g[i][j]<=t)c++;
        }
        cout << c << endl;
    }
}

Measured memory_bytes: 2188
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int Player = sc.nextInt();
		int score[] = new int [Player];
		int point[][] = new int [Player][3];
		int work[][] = new int [Player][3];
		for(int i = 0; i < Player; i++){
			score[i] = 0;
			for(int j = 0; j < 3; j++){
				point[i][j] = sc.nextInt();
				work[i][j] = point [i][j];
			}
		}
		for(int j = 0; j < 3; j++){
			for(int i = 0; i < Player; i++){
				for(int k = 0; k < Player; k++){
					if(point[i][j]==point[k][j] && i != k){//同じ数値だった場合
						work[i][j]= 0;					//
					}
				}
			}
		}
		for(int i = 0; i < Player; i++){
			for(int j = 0; j < 3; j++){
				score[i] += work[i][j];		//最終集計
			}
		}

		for(int i = 0; i < Player; i++){
			System.out.println(score[i]);		//結果の出力
		}
	}

}

Measured memory_bytes: 20912
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const int INF = 1001001001;
const int MOD = 1000000007;
typedef long long ll;

int main(){
    string S;
    cin >> S;
    rep(i, 3){
        if(S[i] == '7'){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3596
#include <vector>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <utility>
#include <stack>
#include <numeric>
#include <random>
#include <algorithm>
#include <queue>
#include <functional>
#include <iterator>
#include <list>
#include <unordered_map>
#include <deque>
#include <math.h>
#include <tgmath.h>
using namespace std;

#define rep(i, b, e) for(i = b; i < e; ++i)
#define repr(i, b, e) for (i = b; i >= e; --i)
#define ull unsigned long long int
#define ll long long int
#define pint pair<int, int>

#define M_DEBUG 1
#define PI 3.141592653589793

#define E '\n'

#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << "\n";}
#define INF (1e18)

const ll MAX = 1000000000;
const ll MOD = 1e9 + 7;

ull a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;

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;
}

ll aabs(ll a) {
    if (a < 0) return -a;
    return a;
}

//fast power
ll calc(ll a, ll b) {
    if (b == 0) return 1;
    else if (b % 2 == 0) {
        ll d = calc(a, b / 2);
        return (d * d) % MOD;
    }
    else return (a * calc(a, b - 1)) % MOD;
}

//fast combination
ll comb(ll n, ll a) {
    ll b = 1, c = 1;
    for (ll i = 1; i <= a; ++i) {
        b = b * i % MOD;
        c = c * (n - i + 1) % MOD;
    }

    return c * calc(b, MOD - 2) % MOD;
}

int kyotsu(string ss, int st, int ed, string ss2) {
    int ans = 0;
    for ( int i = st; i < ed; ++i ) {
        if (i - st >= ss2.size()) return ans;
        if (ss[i] == ss2[i - st] || ss[i] == '?') {
            ans++;
        } else {
            return -1;
        }
    }
    return ans;
}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> l;

    long double aa = (long double)l / 3.f;
    //cout << setprecision(10) << aa << endl;
    cout << fixed << setprecision(20) << aa * aa * aa << endl;
    /*if (l % 3 == 1) {
        cout << setprecision(10) << aa * aa * (aa + 1) << endl;
    } else if (l % 3 == 2) {
        cout << setprecision(10) << aa * (aa + 1) * (aa + 1) << endl;
    } else {
        cout << setprecision(10) << aa * aa * aa << endl;
    }*/
 
    return 0;
}


Measured memory_bytes: 256
/*author: hyperion_1724
  date: 
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define inf 1e10
#define READ(X) cin>>X;
#define READV(X) long long X; cin>>X;
#define READAR(A,N) long long A[N]; for(int i=0;i<N;i++) {cin>>A[i];}
#define rz(A,N) A.resize(N);
#define sz(X) (long long)(X.size())
#define fi first
#define se second
#define trav(x,A) for(auto &x:A)
#define veci vector<int>
#define vecl vector<long long>
#define FORI(a,b,c) for(int a=b;a<c;a++)
#define FORD(a,b,c) for(int a=b;a>c;a--)
#define adj(N) vector<vector<int>> ADJ(N+1)
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef tree<long long,null_type,greater<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set1;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long,long> pll;

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

	READV(N);
	READV(X);
	READAR(L,N);
	vecl ans(N+1,0);
	ll prev=0;
	FORI(i,0,N)
	{
		prev=prev+L[i];
		ans[i+1]=prev;
	}
	ll a=0;
	FORI(i,0,N+1)
	{
		if(ans[i]<=X)
		{
			a++;
		}
		else
		{
			break;
		}
	}
	cout<<a<<endl;

	return 0;
}

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

int main() {
  int N;
  cin >> N;
  int l = 1;
  int p = 0;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  for (int m = 0; m < N + 1; m++) {
    l = vec.at(l - 1);
    p++;
    if (l == 2) {
      cout << p << endl;
      break;
    }
    else if (p >= N) {
      cout << "-1" << endl;
      break;
    }
  }
}




Measured memory_bytes: 640
ans =
  Array.new(4) do
    Array.new(3) do
      Array.new(10, 0)
    end
  end

n = gets.to_i
n.times do
  b, f, r, v = gets.split.map(&:to_i)
  ans[b - 1][f - 1][r - 1] += v
end

(ans.length).times do |i|
  puts '#' * 20 if i > 0
  ans[i].each do |j|
    puts " " + j.join(' ')
  end
end

Measured memory_bytes: 8672
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>

using namespace std;

typedef long long ll;

int main() {
    int n;  cin >> n;
    int *a = new int[n];
    map<int, int> m;
    int M = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        m[a[i]]++;
        M = max(M, a[i]);
    }

    vector<bool> flag(M+1, true);

    sort(a, a+n);

    for (int i = 0; i < n; i++) {
        for (int j = 2; j * a[i] <= M; j++) {
            flag[a[i]*j] = false;
        }
    }

    int ans = n;
    for (int i = 0; i < n; i++) {
        if (flag[a[i]] == false || m[a[i]] > 1)
            ans--;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 13884
N = int(input())
t = [0]
x = [0]
y = [0]
for i in range(N):
   a = list(map(int, input().split()))
   t.append(a[0])
   x.append(a[1])
   y.append(a[2])

flag = 0
for i in range(N):
   T_min = (x[i+1]-x[i]) + (y[i+1]-y[i])
   if (t[i+1]-t[i]) < T_min:
      flag = 1
      break
   elif (t[i+1]-t[i]-T_min)%2 != 0:
      flag = 1
      break

if flag ==1:
   print("No")

else:
   print("Yes")

Measured memory_bytes: 12116
main() {
    char s[100001];
    int len = 0, min = 0;
    int i = 0, zero = 0, one = 0;

    scanf("%s", s);
    while(s[i]) {
        len++;
        i++;
    }

    for (i = 0; i < len; i++) {
        if (s[i] == '0') zero++;
        else one++;
    }

    if (zero < one) {min = zero;}
    else {min = one;}

    printf("%d", 2*min);

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		String tomorrow = "";
		
		if(weather.equals("Sunny"))
			tomorrow = "Cloudy";
		if(weather.equals("Cloudy"))
			tomorrow = "Rainy";
		if(weather.equals("Rainy"))
			tomorrow = "Sunny";
		
		System.out.println(tomorrow);
	}
}


Measured memory_bytes: 24148
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<cctype>
using namespace std;


int main() {
	string s;
	cin >> s;
	string t = "CODEFESTIVAL2016";
	int c = 0;
	for (int i = 0; i < 16; i++) {
		if (s[i] != t[i])
			c++;
	}
	cout << c << endl;
}

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

long double unit(int n,long double d,long double x)
{
    if(n == 0)return 0;
    return d + x * (2 * n - 1) / 2 +
           unit(n - 1,d + (2 * d + 5 * x) / (n * 2),x + 4 * x / (n * 2));
}

int main()
{
    int N;
    int D,X;

    scanf("%d%d%d",&N,&D,&X);

    printf("%.10lf\n",(double)unit(N,(long double)D,(long double)X));
    return 0;
}


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

int L, n, x[201000];

struct BIT {
  long long val[201000];

  void Init(void) {
    //cerr << "!" << endl;
    for(int i = 1; i <= n; i++)
      val[i] = 0;
  }

  void add(int x, int y) {
    for(; x <= n; x += -x & x) {
      val[x] += y;
    }
  }

  long long Query(int x, int y) {
    x--;
    long long ans = 0;
    if(x >= y) {
      return 0;
    }
    for(; x; x -= -x & x) {
      ans -= val[x];
    }
    for(; y; y -= -y & y) {
      ans += val[y];
    }
    ans *= 2;
    return ans;
  }
}b[2];

main(void) {
  scanf("%lld%lld", &L, &n);
  long long all = 0;
  for(int i = 1; i <= n; i++) {
    scanf("%lld", &x[i]);
    b[0].add(i, x[i]);
    b[1].add(i, L - x[i]);
  }
  long long ans = 0;
  
  for(int i = 1; i <= n; i++) {
    int ret = n - i + 1;
    int mid = i + ret / 2;
    if(ret & 1) {
      long long tmp = b[0].Query(i, mid - 1) + b[1].Query(mid + 1, n);
      ans = max(ans, max(tmp + x[mid], tmp + L - x[mid]));
    } else {
      long long tmp = b[0].Query(i, mid - 1) + b[1].Query(mid, n);
      ans = max(ans, max(tmp - L + x[mid], tmp - x[mid - 1]));
    }
  }
  b[0].Init();
  b[1].Init();
  //cerr << b[0].Query(1, 3) + b[1].Query(5, 7) + L - x[4] << endl;
  reverse(x + 1, x + n + 1);
  for(int i = 1; i <= n; i++) {
    x[i] = L - x[i];
    b[0].add(i, x[i]);
    b[1].add(i, L - x[i]);
    //cerr << L - x[i] << endl;
  }
  
  //cerr << b[0].Query(1, 3) + b[1].Query(5, 7) + L - x[4] << endl;
  for(int i = 1; i <= n; i++) {
    int ret = n - i + 1;
    int mid = i + ret / 2;
    if(ret & 1) {
      long long tmp = b[0].Query(i, mid - 1) + b[1].Query(mid + 1, n);
      ans = max(ans, max(tmp + x[mid], tmp + L - x[mid]));
    } else {
      long long tmp = b[0].Query(i, mid - 1) + b[1].Query(mid, n);
      ans = max(ans, max(tmp - L + x[mid], tmp - x[mid - 1]));
    }
    //cerr << ans << endl;
  }
  cout << ans << endl;
}


Measured memory_bytes: 4992
///byYerko
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pb push_back
using namespace std;
const int MXX = 2e3 + 7;
const int MXN = 1e6 + 7;
const int N = 1e9 + 7;

ll a, b, c, x, cnt;

int main() {
  cin >>a >>b >>c >>x;
  for(int i = 0; i <= a; i ++) {
    for(int j = 0; j <= b; j ++) {
      for(int k = 0; k <= c; k ++) {
        if((i * 500) + (j * 100) + (k * 50) == x) {
          cnt ++;
        }
      }
    }
  } cout <<cnt;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 922337203685477;
const ll mininf = -922337203685477;
const ll nax = 0;

ll a, b, c, k;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	ll ans = 0;
	cin >> a >> b >> c >> k;
	ll temp = min(a, k);
	ans += temp;
	a -= temp;
	k -= temp;
	temp = min(b, k);
	b -= temp;
	k -= temp;
	temp = min(c, k);
	ans -= temp;
	cout << ans << '\n';
}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define ll int
using namespace std;
const int N=2e5+4;
ll ans[N];
int main(){
       ll n;
       cin>>n;
       ll a[n];
       for(int i=0;i<n;i++) cin>>a[i];
       ll fuck=1;
       for(int i=0;i<n;i++){
              int cur=a[i];
              ans[cur]=max(ans[cur],ans[cur-1]+1);
              fuck=max(fuck,ans[cur]);
       }
       cout<<n-fuck;
       
       return 0;
}

Measured memory_bytes: 1920
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<utility>
using namespace  std;
const long long maxn = 1e9 + 7;

int main(){
	long long n,m;
	scanf("%lld %lld",&n,&m);
	if(abs(n - m) > 1) printf("0");
	else{
		long long sum = 1;
		for(long long i = 1;i <= n;i++) sum = (sum * i) % maxn;
		for(long long i = 1;i <= m;i++) sum = (sum * i) % maxn;
		if(m != n) printf("%lld",sum);
		else{
			sum = (2 * sum) % maxn;
			printf("%lld",sum);
		}
	}
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;
typedef pair<Int, Int> P;

int R, C, K;
Int field[3010][3010];
Int dp[3010][3010][4];

int main(){
    cin >> R >> C >> K;
    rep(i,K){
        Int r, c, v;
        cin >> r >> c >> v;
        field[r][c] = v;
    }

    rep1(r,R) rep1(c,C){
        // アイテムが存在しない/取らないとき
        rep(i,4) dp[r][c][0] = max(dp[r][c][0], dp[r-1][c][i]);
        rep(i,4) dp[r][c][i] = max(dp[r][c][i], dp[r][c-1][i]);

        // アイテムを取るとき
        if (field[r][c] != 0){
            Int v = field[r][c];
            rep(i,4) dp[r][c][1] = max(dp[r][c][1], dp[r-1][c][i] + v);
            rep1(i,3) dp[r][c][i] = max(dp[r][c][i], dp[r][c-1][i-1] + v);
        }
    }

    Int ans = 0;
    rep(i,4) ans = max(ans, dp[R][C][i]);
    cout << ans << endl;
}


Measured memory_bytes: 356224
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  
  for (int i = 1; i < 10; i++){
   for (int j = 1; j < 10; j++){
     if (i * j == n){
       cout << "Yes" << endl;
       return 0;
     }
   }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256