akhauriyash/Code-Regression huggingface dataset:
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
#define vec(s) vector
;
#define vvec(s) vector<vector
> ;
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YN(x) cout<<(bool x?"Yes":"No")<<endl;
#define out(s) cout<<s<<endl;
#define pb(s) push_back(s);
#define sp " ";
#define INF 10000000000
#define all(s) s.begin(),s.end()
void vout(vector<int> v){
    for(int i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    lli d,n;
    cin>>d>>n;
    d=pow(100,d);
    if(n==100) d=d*(n+1);
    else d=d*n;
    out(d);
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

int initialize();
int isEmpty();
int isFull();
void enqueue(P);
P dequeue();

P Q[LEN+1];
int head, tail, n;

int main()
{
  int elaps = 0;
  int i, q;
  P u;

  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  head = 1;
  tail = n + 1;

  while(1){
    if(head == tail) break;

    u = dequeue();
    if(u.t > q){
      elaps += q;
      u.t = u.t - q;
      enqueue(u);
    }
    else{
      elaps += u.t;
      printf("%s ", u.name);
      printf("%d\n", elaps);
    }
  }
   
   return 0;
}


int isEmpty()
{
  if(head == tail) return 1;
  else return 0;
  }


int isFull()
{
  if(head == (tail + 1) % (LEN + 1)) return 1;
  else return 0;
}


void enqueue(P x)
{
  if(isFull() == 0){
    Q[tail] = x;
    if(tail + 1 == (LEN + 1)) tail = 0;
    else tail++;
  }
}

P dequeue()
{
  P x;

  if(isEmpty() == 0){
    x = Q[head];
    if(head + 1 == (LEN + 1)) head = 0;
    else head++;
  }
  return x;
}

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

int main() {
	int a, b;
	scanf("%d%d", &a , &b);
	if(a == b) printf("Draw");
	else if(a == 1) printf("Alice");
	else if(b == 1) printf("Bob");
	else if(a > b) printf("Alice");
	else if(a < b) printf("Bob");
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
class Main {
 
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            String str=br.readLine();
            if(str.equals("0")) break;
            char[] c_array=str.toCharArray();
            int sum=0;
            for(char c:c_array) sum+=Integer.parseInt(String.valueOf(c));
            System.out.println(sum);
        }
    }
}
 

Measured memory_bytes: 24476
#include <bits/stdc++.h>
using namespace std;
int max_z(int a,vector<int>s){
  if(a==0){
    return s.at(0);
  }
  int t =max_z(a-1,s);
  return max(s.at(a),t);
}
int main() {
  int N;
  cin>>N;
  vector<int> s(N);
    for(int i=0;i<N;i++){
        cin>>s.at(i);
    }
  int ans=0;
  for(int i=0;i<N;i++){
    if (i==0||(i>=1&&s.at(i)>=max_z(i-1,s))){
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>

int main(int argc, char** argv)
{
	while (true)
	{
		int height, width;
		std::cin >> height >> width;

		if (height == 0 && width == 0)
		{
			break;
		}

		for (int h = 0; h < height; ++h)
		{
			for (int w = 0; w < width; ++w)
			{
				if ((h % 2 + w) % 2)
				{
					std::cout << ".";
				}
				else
				{
					std::cout << "#";
				}
			}
			std::cout << std::endl;
		}

		std::cout << std::endl;
	}
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

template<typename... Types>
struct dynarr: std::vector<Types...> {
  using std::vector<Types...>::vector;
  using size_type = typename std::vector<Types...>::size_type;
  auto&& operator[](size_type i) { return this->at(i); }
  auto&& operator[](size_type i) const { return this->at(i); }
};

int main() {
  i64 N, K, Q;
  cin >> N >> K >> Q;
  vector<i64> A(Q);
  rep(i,0,Q) cin >> A[i];
  vector<i64> cnt(N);
  rep(i,0,Q) {
    cnt[A[i] - 1]++;
  }
  rep(i,0,N) {
    if(K - (Q - cnt[i]) > 0) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
  }
}


Measured memory_bytes: 2176
package main

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

func main() {
	s := getString()
	l := len(s)
	k := getInt()

	ss := make([]string, 0, len(s)*k)
	for i := range s {
		for j := 1; (j <= k) && (i+j <= l); j++ {
			ss = append(ss, s[i:i+j])
		}
	}
	sort.Strings(ss)

	checker := make(map[string]bool)
	ans := make([]string, 0, k)
	for i := 0; len(ans) < k; i++ {
		if !checker[ss[i]] {
			checker[ss[i]] = true
			ans = append(ans, ss[i])
		}
	}

	fmt.Println(ans[k-1])
}

// -----------------------------------------

var sc = bufio.NewScanner(os.Stdin)

func init() {
	// buf := 200001
	// sc.Buffer(make([]byte, buf), buf)
	sc.Split(bufio.ScanWords)
}

func getInt() int {
	i, err := strconv.Atoi(getString())
	if err != nil {
		panic(err)
	}
	return i
}

func getString() string {
	sc.Scan()
	s := sc.Text()
	return s
}


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

int n;
ll A[100010],S[100010] = {0};

int main(){
	cin >> n;
	ll sum = 0,one = 0,two = 0,ans;
	for(int i=1;i<=n;i++){
		cin >> A[i];
	}
	for(int i=1;i<=n;i++){
		sum += A[i];
		if(i%2==0 && sum>=0){
			one += 1+sum;
			sum = -1;
		}
		if(i%2==1 && sum <= 0){
			one += 1-sum;
			sum = 1;
		}
	}
	sum = 0;
	for(int i=1;i<=n;i++){
		sum += A[i];
		if(i%2==1 && sum>=0){
			two += 1+sum;
			sum = -1;
		}
		if(i%2==0 && sum <= 0){
			two += 1-sum;
			sum = 1;
		}
	}
	cout << min(one,two) << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>	
#include <iomanip>
#include <sstream>
#include <numeric>
#include <cassert>
using namespace std;
int dx[5]={1,0,-1,0,0},dy[5]={0,1,0,-1,0};
long long gcd(long long a,long long b){if(a%b==0){return b;}else return gcd(b,a%b);}
long long lcm(long long a,long long b){if(a==0){return b;} return a/gcd(a,b)*b;}
#define INF 2000000000
#define MOD 1000000007
#define sym cout<<"---------"<<endl;
#define ll long long
#define mk make_pair
#define en endl
#define RE return 0
#define int ll
#define P pair<int,int>

int n,K;
int dp[15][2007];

signed main(){
	cin>>n>>K;
	vector<int> ve[11];
	for(int i=0; i<n; i++){
		int a,b; cin>>a>>b;
		ve[b-1].push_back(a);
	}
	
	for(int i=0; i<10; i++) sort(ve[i].begin(), ve[i].end());
	for(int i=0; i<11; i++) for(int j=0; j<2005; j++) dp[i][j]=-INF;
	dp[0][0]=0;
	for(int i=1; i<=10; i++){
		for(int j=0; j<=K; j++){
			int cnt=0;
			for(int k=0; k<=j&&k<=ve[i-1].size(); k++){
				dp[i][j]=max(dp[i][j],dp[i-1][j-k]+cnt+k*(k-1));
				if(ve[i-1].size()-k) cnt+=ve[i-1][ve[i-1].size()-k-1];
			}
		}
	}
	cout<<dp[10][K]<<en;
}
	
	
	


Measured memory_bytes: 3372
import java.util.*;

public class Main {
	static final long MOD = 1000000007;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long m = sc.nextLong();
		long total = 0;
		if (m < 2 * n) {
			total = m / 2;
		} else {
			total = n;
			m -= n * 2;
			total += m / 4;
		}
		System.out.println(total);
	}
}


Measured memory_bytes: 21716
x1,y1,x2,y2 = map(int,input().split())
x4 = x1-(y2-y1)
y4 = y1+(x2-x1)
x3 = x2-(y2-y1)
y3 = y2+(x2-x1)
print(x3,y3,x4,y4)

Measured memory_bytes: 3060
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
a = ii()

print(a + a**2 + a**3)

Measured memory_bytes: 9192
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pli pair<ll, int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pq priority_queue;

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	int n;
	cin>>n;
	int o=n%10;
	if(o==2||o==4||o==5||o==7||o==9)
		cout<<"hon\n";
	else if(o==0||o==1||o==6||o==8)
		cout<<"pon\n";
	else
		cout<<"bon\n";
	return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb push_back
#define ff first 
#define ss second  
typedef pair<ll,ll> pp;
bool com(pp x,pp y){
    if(x.ff==y.ff) return x.ss<y.ss;
    return x.ff<y.ff;
} 
int N=1e5+9;
void solve(){
    int n;
    cin>>n;
    vector<pp> cord;
    for(int i=0;i<n;i++){
        ll x,y;
        cin>>x>>y;
        cord.pb({x,y});
    }
    ll ans=0;
    pp highx,highy;
    ll sum=1e18,mx=-1e18;
    sort(cord.begin(),cord.end(),com);
    for(int i=0;i<n;i++){
        ll x=cord[i].ff+cord[i].ss;
        ll y=abs(cord[i].ff-cord[i].ss);
        if(x<sum) highx=cord[i],sum=x;
        if(y>mx) mx=y,highy=cord[i];
    }
    for(int i=0;i<n;i++){
        ans=max(ans,abs(highy.ff-cord[i].ff)+abs(highy.ss-cord[i].ss));
        ans=max(ans,abs(highx.ff-cord[i].ff)+abs(highx.ss-cord[i].ss));
    }
    cout<<ans;
}
int main() {
	// your code goes here
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0); 
	int t=1;
	//cin>>t;
	while(t--) 
	    solve();
	return 0; 
	
}


Measured memory_bytes: 7408
#include<iostream>
using namespace std;
 
int main(){
	int k,x,temp;
  	cin >> k >> x;
  	temp = x - (k-1);
  	for(int i = 0;i<k + (k-1);i++){
    	cout << temp << " "; 
      	++temp;
    }
  	cout << "" << endl;
  	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
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;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n,k;
    cin >> n >> k;
    ll ans = 0;
    ll t = n/k;
    ans += t*t*t;
    if(k%2 == 0 && n >= k/2) {
        t = (n-k/2)/k+1;
        ans += t*t*t;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()
struct revran {
  const i64 b, e;
  struct iter {
    i64 i;
    constexpr iter(const i64 i) noexcept: i(i) {}
    void operator++() noexcept { --i; }
    constexpr i64 operator*() const noexcept { return i; }
    constexpr bool operator!=(const iter x) const noexcept { return i != x.i; }
  };
  constexpr revran(const i64 e) noexcept: b(0), e(e) {}
  constexpr revran(const i64 b, const i64 e) noexcept: b(b), e(e) {}
  constexpr iter begin() const noexcept { return iter(e - 1); }
  constexpr iter end() const noexcept { return iter(b - 1); }
};

struct ran {
  const i64 b, e;
  struct iter {
    i64 i;
    constexpr iter(const i64 i) noexcept: i(i) {}
    void operator++() noexcept { ++i; }
    constexpr i64 operator*() const noexcept { return i; }
    constexpr bool operator!=(const iter x) const noexcept { return i != x.i; }
  };
  constexpr ran(const i64 e) noexcept: b(0), e(e) {}
  constexpr ran(const i64 b, const i64 e) noexcept: b(b), e(e) {}
  constexpr iter begin() const noexcept { return iter(b); }
  constexpr iter end() const noexcept { return iter(e); }
  constexpr revran rev() const noexcept { return revran(b, e); }
};

constexpr ran rin(const i64 e) noexcept { return ran(1, e + 1); }
constexpr ran rin(const i64 b, const i64 e) noexcept { return ran(b, e + 1); }

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

i64 solve(vector<i64> need, vector<i64> delta, i64 n) {
  vector<vector<i64>> dp(n + 1, vector<i64>(4));
  i64 ans = 0;
  for(int j = 1;j <= 3;j++) {
    for(int i = 0;i <= n;i++) {
      if(i - 1 >= 0) dp[i][j] = max(dp[i][j], dp[i - 1][j]);
      dp[i][j] = max(dp[i][j], dp[i][j - 1]);
      if(i - need[j - 1] >= 0) {
        dp[i][j] = max(dp[i][j], dp[i - need[j - 1]][j - 1] + delta[j - 1]);
        dp[i][j] = max(dp[i][j], dp[i - need[j - 1]][j] + delta[j - 1]);
      }
    }
  }

  return dp[n][3];
}

int main() {
  i64 N;
  cin >> N;
  i64 a, b, c;
  i64 A, B, C;
  cin >> a >> b >> c;
  cin >> A >> B >> C;
  i64 FIRST = solve({a, b, c}, {A - a, B - b, C - c}, N);
  N += FIRST;
  i64 M = 0;
  {
    i64 g = gcd(a, gcd(b, c));
    i64 LCM = a / g * b / g * c;
    i64 aa = LCM - LCM / a * A;
    i64 bb = LCM - LCM / b * B;
    i64 cc = LCM - LCM / c * C;
    i64 MM = max({ aa, bb, cc });
    i64 need, delta;
    if(MM == aa) {
      need = A;
      delta = a - A;
    }
    else if(MM == bb) {
      need = B;
      delta = b - B;
    }
    else {
      need = C;
      delta = c - C;
    }
    i64 DDD = 500000 * 2;
    if(MM > 0 && N >= DDD) {
      M = ((N - DDD + 250000 * 2) / (need)) * need;
      N -= M;
      M = M + (((N + M) - DDD + 250000 * 2) / need) * delta;
    }
  }
  i64 SECOND = solve({A, B, C}, {a - A, b - B, c - C}, N);
  cout << N + SECOND + M << endl;
}



Measured memory_bytes: 349108
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int main() {

  int N;
  cin>>N;
  cout<<800*N - 200*(N/15)<<endl;

  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.ABC_149
{
    class E
    {
        static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            SetOut(sw);

            Method(args);

            Out.Flush();
        }

        static void Method(string[] args)
        {
            long[] nm = ReadLongs();
            long n = nm[0];
            long m = nm[1];
            long[] array = ReadLongs();
            Array.Sort(array);
            Array.Reverse(array);

            long bottom = 0;
            long top = 300000;
            while (bottom + 1 < top)
            {
                long mid = (bottom + top) / 2;
                long cnt = 0;
                for(int i = 0; i < n; i++)
                {
                    if (mid > array[i] + array[0]) continue;
                    long bottom2 = 0;
                    long top2 = n;
                    while (bottom2 + 1 < top2)
                    {
                        long mid2 = (bottom2 + top2) / 2;
                        if (array[i] + array[mid2] >= mid) bottom2 = mid2;
                        else top2 = mid2;
                    }
                    cnt += bottom2 + 1;
                }
                if (cnt >= m) bottom = mid;
                else top = mid;
            }

            long resCnt = 0;
            long res = 0;
            long[] sums = new long[n];
            for(int i = 0; i < n; i++)
            {
                sums[i] = array[i];
                if (i > 0) sums[i] += sums[i - 1];
            }
            for(int i = 0; i < n; i++)
            {
                if (bottom > array[i] + array[0]) continue;
                long bottom2 = 0;
                long top2 = n;
                while (bottom2 + 1 < top2)
                {
                    long mid2 = (bottom2 + top2) / 2;
                    if (array[i] + array[mid2] >= bottom) bottom2 = mid2;
                    else top2 = mid2;
                }
                resCnt += bottom2 + 1;
                res += sums[bottom2] + array[i] * (bottom2 + 1);
            }
            res -= (resCnt - m) * bottom;
            WriteLine(res);
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 20192
import sys
def input():
    return sys.stdin.readline()[:-1]
N,M=map(int,input().split())
sys.setrecursionlimit(200000)
b=[tuple(map(lambda x: int(x)-1, input().split())) for i in range(M)]
class uf:
    def __init__(self,n):
        self.n=n
        self.l=[-1]*n
    def ro(self,n):         #root
        if self.l[n]<0:
            return n
        r=self.ro(self.l[n])
        self.l[n]=r
        return r
    def me(self,a,b):       #merge
        ra=self.ro(a)
        rb=self.ro(b)
        if self.l[ra]>self.l[rb]:
            ra,rb=rb,ra
        if ra!=rb:
            self.l[ra]+=self.l[rb]
            self.l[rb]=ra
    def size(self,n):
        return -self.l[self.ro(n)]
    def sa(self,a,b):       #same
        return self.ro(a)==self.ro(b)
    def rl(self):           #roots list
        return [i for i,v in enumerate(self.l) if v<0]
    
    def len(self):          #len(roots)
        return len(self.rl())
    def ul(self):
        d={n:i for i,n in enumerate(self.rl())}
        m=[[]for i in range(self.len())]
        for i in range(self.n):
            m[d[self.ro(i)]].append(i)
        return m
    def __str__(self):
        return f"{self.ul()}"
l=[0]*M
s=uf(N)
h=N*(N-1)//2
for i in range(M-1,-1,-1):
    l[i]=h
    if s.ro(b[i][0])!=s.ro(b[i][1]):
        h-=s.size(b[i][0])*s.size(b[i][1])
        s.me(b[i][0],b[i][1])
print(*l,sep="\n")

Measured memory_bytes: 96860
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.function.Consumer;
import java.util.stream.Collectors;

public class Main {
    private static final Scanner scanner = new Scanner(System.in);
    private static final Consumer<List<String>> consumer = solve();

    public static void main(String[] args) {
        consumer.accept(readInput());
    }

    private static List<String> readInput() {
        final List<String> lineList = new ArrayList<>();
        while (scanner.hasNextLine()) {
            lineList.add(scanner.nextLine());
        }
        return lineList;
    }

    private static Consumer<List<String>> solve() {
        return args -> {
            List<Integer> numList = Arrays.stream(args.get(0).split(" ")).map(Integer::valueOf).collect(Collectors.toList());
            int target = numList.get(3);
            int ans = 0;
            for (int i = 0; i <= 3000; i++) {
                int r = numList.get(0) * i;
                if (r > target) {
                    break;
                }
                for (int j = 0; j <= 3000; j++) {
                    int g = numList.get(1) * j;
                    if (r + g > target) {
                        break;
                    }
                    if ((target - r - g) % numList.get(2) == 0) {
                        ans++;
                    }
                }
            }
            System.out.println(ans);
        };
    }
}


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

string str;

bool input(){
		getline(cin,str);
		return str != ".";
}

void solve(){
//	cout << str <<endl;
	int maru=0;
	int kaku=0;
	char flag;
	int count = 0;
	char lst[101];
	for(int i = 0; i < (int)str.size();i++){
			char c =str[i];
			if(c == '('){
					maru++;
					lst[count]='(';
					count++;
					//flag = ')';
			}
			if(c == '['){
					kaku++;
					lst[count] = '[';
					count++;
					//flag = ']';
			}
			if(c == ')'){
					if(maru <= 0 || lst[count-1] !='('){
							cout << "no"  << endl;
							return;
					}
					
					maru --;
					count--;
			}
			if(c == ']'){
					if(kaku <= 0 || lst[count-1] != '['){
							cout << "no" << endl;//c << endl;
							return;
					}
					kaku--;
					count--;
			}
	}
	if(maru == 0 && kaku == 0)cout << "yes" <<endl;
	else cout << "no" <<endl;
}

int main(){
		while(input())solve();
}



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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
const int inf=100100100;
const int mod=(int)1e9+7;
using Graph = vector<vector<int>>;

int main(){
    int n,k;
    cin>>n>>k;
    Graph v(k);
    rep(i,0,k){
        int d;
        cin>>d;
        rep(j,0,d){
            int a;
            cin>>a;
            a--;
            v.at(i).push_back(a);
        }
    }
    vector<int>sum(n);
    int c=0;
    rep(i,0,k){
        for(auto j:v.at(i)){
            sum.at(j)++;
        }
    }
    rep(i,0,n){
        if(sum.at(i)==0)c++;
    }
    cout<<c<<endl;
return 0;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
 
using namespace std;
 
#define LL long long int
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int oo = 1e9 + 5;
const LL ooll = (LL)1e18 + 5;
// const int MOD = 1e9 + 7;
const int MOD = 998244353;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rand(l, r) uniform_int_distribution<int>(l, r)(rng)

clock_t start = clock();

const int N = 4e5 + 5;

int dp[N], sp[N];
void solve() {
    int n, k;
    cin >> n >> k;
    vector<array<int,2>> v(k);
    for (int i=0;i<k;++i) cin >> v[i][0] >> v[i][1];
    dp[n-1] = 1;
    sp[n-1] = 1;
    sp[n] = dp[n] = 0;
    for (int i=n-2;i>=0;--i) {
        for (int j=0;j<k;++j) {
            int l = i + v[j][0], r = i + v[j][1];
            r = min(r, n);
            if (l > r) continue;
            dp[i] += sp[l];
            if (dp[i] >= MOD) dp[i] -= MOD;
            dp[i] -= sp[r+1];
            if (dp[i] < 0) dp[i] += MOD;
        }
        sp[i] = sp[i+1] + dp[i];
        if (sp[i] >= MOD) sp[i] -= MOD;
    }
    cout << dp[0] << '\n';
}

int main() {
    FASTIO;
    int T = 1;
    // cin >> T;
    while (T--) {
        solve();
    }
    return 0;
} 

Measured memory_bytes: 5220
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <stack> 
#include <map>
#include <queue>
#include <unordered_map>
#include <cassert>
#include <iomanip>
#include <cmath>
#include <cstring>
using namespace std;

#define pb 					push_back

template<typename T,typename S>
ostream& operator <<(ostream& os, pair<T, S> input) {
	os<<"("<<input.first<<", "<<input.second<<")";
	return os;
}

template<typename T>
ostream& operator <<(ostream& os, vector<T> input) {
	for(auto t: input)
		os << t <<" ";

	return os;
}

int main() {
    //ios_base::sync_with_stdio(false);
	//cin.tie(0);
	//cout.tie(0);
	string s;
	cin >> s;
	int ans =-1;
	if(s=="SAT")
		ans = 1;
	if(s=="SUN")
		ans = 7;
	if(s=="MON")
		ans = 6;
	if(s=="TUE")
		ans = 5;
	if(s=="WED")
		ans = 4;
	if(s=="THU")
		ans = 3;
	if(s=="FRI")
		ans = 2;
	

	cout << ans<<"\n";


	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
                       ///****   Hasebul Hassan Chowdhury ***////
#define ms(a,v)        memset(a,v,sizeof a)
#define lll            long long
#define FOR(i,a,b)     for(int i=a;i<=b;i++)
#define fast           ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Read           freopen("input.txt", "r", stdin)
#define Write          freopen("output.txt", "w", stdout)
#define INF            1e18

void solve()
{
   int n;
   cin>>n;
   int AC=0,WA=0,TLE=0,RE=0;
   FOR(i,1,n)
   {
       string s;
       cin>>s;
       if(s=="AC") AC++;
       else if(s=="WA") WA++;
       else if(s=="TLE") TLE++;
       else RE++;
   }
   cout<<"AC x "<<AC<<endl;
   cout<<"WA x "<<WA<<endl;
   cout<<"TLE x "<<TLE<<endl;
   cout<<"RE x "<<RE<<endl;
}


int main()
{
    fast
    #ifndef ONLINE_JUDGE
    //Read;
    //Write;
    #endif
    //int t; cin>>t; while(t--) solve();
    solve();

}


Measured memory_bytes: 3604
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <cassert>
using namespace std;
int dx[5]={1,0,-1,0,0},dy[5]={0,1,0,-1,0};
long long gcd(long long a,long long b){if(a%b==0){return b;}else return gcd(b,a%b);}
long long lcm(long long a,long long b){if(a==0){return b;} return a/gcd(a,b)*b;}
#define INF 2000000000
#define MOD 1000000007
#define sym cout<<"---------"<<endl;
#define ll long long
#define mk make_pair
#define en endl
#define RE return 0
#define int ll
#define P pair<int,int>

#define MAX 1000005
const int INT_MA=2147483647;

struct RMQ{
	int n,dat[2*MAX-1];
	void init(int n_){
		n=1;
		while(n<n_) n*=2;
		for(int i=0; i<2*n-1; i++) dat[i]=INT_MA;
	}
	void update(int k,int a){
		k+=n-1;
		dat[k]=a;
		while(k>0){
			k=(k-1)/2;
			dat[k]=min(dat[2*k+1],dat[2*k+2]);
		}
	}
	int query(int a,int b,int k,int l,int r){
		if(r<=a||b<=l) return INT_MA;
		if(a<=l&&r<=b) return dat[k];
		else{
			int vl=query(a, b, 2*k+1, l, (l+r)/2);
			int vr=query(a, b, 2*k+2, (l+r)/2, r);
			return min(vl,vr);
		}
	}
};

RMQ rmq;

signed main(){
	int n,q; cin>>n>>q;
	rmq.init(n);
	for(int i=0; i<q; i++){
		int com,x,y; cin>>com>>x>>y;
		if(com){
			cout<<rmq.query(x, y+1, 0, 0, rmq.n)<<en;
		}else{
			rmq.update(x, y);
		}
	}
}



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

using namespace std;

int main(){
	int n, k;
	cin >> n >> k;
	int arr[n];
	for(int i=0;i<n;++i)cin >> arr[i];
	sort(arr, arr + n);
	int ans = 0;
	for(int i=0;i<k;++i)ans += arr[i];
	cout << ans;
}


Measured memory_bytes: 3592
//  Created by conan1024hao in 2020.
//  Copyright © 2020 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao Twitter/QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 10e17
#define MOD 1000000007
#define mod 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef long long int LL;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
char dir[4]={'u','l','d','r'};
ll cmp1(pair<ll,string>a,pair<ll,string> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}

//---------------------------------------------------------------------------
ll dp[3001][3001];
V<ll>a;
ll n;
ll cal(ll l,ll r){
    if(dp[l][r]>0)return dp[l][r];
    ll ans;
    if((n-(r-l))%2==0){
        if(r-l==1)return a[l];
        ans=-INF;
        ans=mmax(cal(l+1,r)+a[l],cal(l,r-1)+a[r-1]);
    }
    else{
        if(r-l==1)return 0;
        ans=INF;
        ans=mmin(cal(l+1,r),cal(l,r-1));
    }
    dp[l][r]=ans;
    return ans;
}
//---------------------------------------------------------------------------
int main(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!!      llか??????????统一类型        memset()!!!!!!!!!!!!       ペナを減らせ!!!!!!!!!!!!!
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    cin>>n;
    a.resize(n);
    ll sum=0;
    for(ll i=0;i<n;i++){cin>>a[i];sum+=a[i];}

    ll X=cal(0,n);
    ll Y=sum-X;
    cout<<X-Y<<endl;
    
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------








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

int main(void) {
    char S[11];
    char T[12];

    scanf("%s", S);
    scanf("%s", T);

    int len = strlen(S);

    int result = strncmp(S, T, len);

    if (result == 0) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 2152
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <list>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <iterator> 
#include <limits>

#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a); i<(b); i++)
#define ALL(a) (a).begin(),(a).end()
#define RALL(A) (a).rbegin(),(a).rend()
#define PB push_back
#define MP make_pair

#define dump(x) cerr << #x << " = " << (x) << endl;

using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

int N;
VI A, B;

int MAX_K = 28 + 2;

int main(int argc, char const* argv[])
{
    cin >> N;
    REP(i, N) {
        int a; cin >> a; A.PB(a);
    }
    REP(i, N) {
        int b; cin >> b; B.PB(b);
    }

    LL ans = 0;
    LL T;
    REP(k, MAX_K) {
        T = pow(2, k);
        VI B_mod;
        for (auto b: B) {
            B_mod.PB(b % (2 * T));
        }
        sort(ALL(B_mod));
        int cnt = 0;
        for (auto a: A) {
            a = a % (2 * T);
            auto l1 = lower_bound(B_mod.begin(), B_mod.end(), T - a);
            auto r1 = lower_bound(B_mod.begin(), B_mod.end(), 2 * T - a);
            cnt += distance(r1, l1);

            auto l2 = lower_bound(B_mod.begin(), B_mod.end(), 3 * T - a);
            auto r2 = lower_bound(B_mod.begin(), B_mod.end(), 4 * T - a);
            cnt += distance(r2, l2);
        }

        if (cnt % 2 != 0) {
            ans += T;
        }
    }
    cout << ans << endl;

    return 0;
}


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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;


class Solver {
  public:
    bool solve() {
        ll N, A, B; cin >> N >> A >> B;
        if(A > B or (N == 1 and A != B)) {
            cout << 0 << endl;
            return 0;
        }
        if(N > 2) {
            cout << (B - A) * (N - 3) + (B - A + 1) << endl;
        } else {
            cout << 1 << endl;
        }
        return 0;
    }
};

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


Measured memory_bytes: 256
#include <bits/stdc++.h>//復習必須
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
    ll N , M ,ans;
    ans = 0 ;
    cin >> N >> M ;
    ll H[N] ;
    bool Ha[N] ;
    for(ll i = 0 ; i < N ; i++){
        cin >> H[i] ;
        Ha[i] = true ;
    }
    
    ll A , B ;
    for(ll j = 0 ; j < M ; j++){
        cin >> A >> B ;
        if(H[A-1] >H[B-1]){
           Ha[B-1] = false ;
        }else if(  H[A-1] < H[B-1]){
            Ha[A-1] = false ;
        }else{
             Ha[B-1] = false ;
             Ha[A-1] = false ;

        }
    }

    for(ll i = 0 ; i < N ; i++){
        

        
       if(Ha[i] == true){
           ans ++ ;
          
       }else{
          
       }
    }

    cout <<ans << endl;


    
    return 0 ;
}

 


Measured memory_bytes: 4516
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  REP(i, n) { cin >> a[i]; }
  map<ll, ll> l, r;
  ll ans = 0;
  FOR(i, 1, n + 1) {
    ll x = a[i - 1] + i, y = i - a[i - 1];
    // if (x == y) {
    //   ans--;
    // }
    l[x]++;
    r[y]++;
  }
  for (auto& p : l) {
    ll k = p.first;
    ans += l[k] * r[k];
  }
  // ans /= 2;
  cout << ans << endl;
}

Measured memory_bytes: 38996
#include<iostream>
using namespace std;
string S;

int main(){
	cin >> S;

	char c = S[0];
	int cnt = 0;
	for(int i=1; i<S.size(); i++){
		if(c != S[i]){
			c = S[i];
			cnt++;
		}
	}

	cout << cnt << endl;
}


Measured memory_bytes: 512
n,k=(int(x) for x in input().split())
hito = []
d = []
A = []
for i in range(1,n+1):
  hito.append(i)
for j in range(1,k+1):
  d = int(input())
  newa = input().split()
  for m in range(0,d):
    A = int(newa[m])
    if A in hito:
      hito.remove(A)
print(len(hito))
    

Measured memory_bytes: 9136
#include<stdio.h>
#define NUM 1000

int main(){
  int i,j,k,num,n,v;
  int a[NUM];

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

  for(i=1;i<=n-1;i++){
    v=a[i];
    j=i-1;
    for(k=0;k<n;k++){
      if(k!=0)
	printf(" ");
      printf("%d",a[k]);
    }
    printf("\n");
    while(j>=0 && a[j]>v){
      a[j+1]=a[j];
      j--;
      a[j+1]=v;
    }
  }
  for(k=0;k<n;k++){
    if(k!=0)
      printf(" ");
      printf("%d",a[k]);
  }
  printf("\n");
  
  return 0;
  
  
}



Measured memory_bytes: 2084
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
  int N, tmp, ttl = -1;
  int cnt = 0;
  cin >> N;
  rep(i, N) {
    cnt = 0;
    cin >> tmp;
    while(true) {
      if (tmp % 2 != 0) {
        break;
      } else {
        cnt += 1;
        tmp /= 2;
      }
    }
    if (ttl == -1 || cnt <= ttl) {
      ttl = cnt;
    }
  }
  cout << ttl << endl;
}


Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <queue>
#include <utility>
#include <map>
using namespace std;
typedef long long ll;

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

  int a[n+1], count = 0, cur = 1, judge = 0;
  bool flag = true;
  for(int i = 1; i < n+1; i++){
    cin >> a[i];
  }

  for(int i = 1; i < n+1; i++){
    if(a[i] != cur) ++count;
    if(a[i] == cur){
      ++cur;
      ++judge;
    }
  }

  int ans;
  if(judge > 0) ans = count;
  else ans = -1;



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

Measured memory_bytes: 1024
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
//#define PI 3.14159265358979

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

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

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1 << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(20);
	}
};
initializer _____;

int N, M, K, T, Q, H, W;
vector< unordered_map< string, int > > dp;
char cs[] = {'A', 'C', 'G', 'T'};
string ss[] = {"AGC", "ACG", "GAC"};
int dfs(int k, string s) {
	if (k >= N)
		return 1;
	if (dp[k][s] > 0)
		return dp[k][s];
	int ret = 0;
	rep(j, 4) {
		char c = cs[j];
		string t = s;
		t.push_back(c);
		bool f = false;
		rep(l, 3) {
			if (t.substr(1, 3) == ss[l] || t.substr(0, 3) == ss[l]) {
				f = true;
				break;
			}
		}
		if (f)
			continue;
		if (t.size() > 3) {
			if (t[0] == 'A' && t[2] == 'G' && t[3] == 'C')
				continue;
			if (t[0] == 'A' && t[1] == 'G' && t[3] == 'C')
				continue;
		}
		string u;
		if (t.size() > 3)
			u = t.substr(1, 3);
		else
			u = t;
		(ret += dfs(k + 1, u)) %= MOD;
	}
	return dp[k][s] = ret;
}
signed main() {
	cin >> N;
	dp.resize(N + 1);
	int ans = dfs(0, "");
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

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; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  vector<string> CS = {"Sunny", "Cloudy", "Rainy"};
  string s; cin >> s;
  for(size_t i = 0; i < CS.size(); ++i)
  {
    if(s == CS[i]){
      cout << CS[(i + 1) % 3] << CRLF;
      return;
    }
  }
  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


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

int main() {
  int A, B, K;
  cin >> A >> B >> K;
  int small = A + K - 1;
  int large = B - K + 1;
  if ( small < large ) {
    for(int i = A; i <= small; i++) {
      cout << i << endl;
    }
    for(int i = large; i <= B; i++) {
      cout << i << endl;
    }
  }
  else {
    for(int i = A; i <= B; i++) {
      cout << i << endl;
    }
  }
}

Measured memory_bytes: 256
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()

two_power = [pow(2, i) for i in range(30)]

# 2べき判定
if n in two_power:
    print("No")

# 1とNまでつなげる
else:
    edges = []
    for i in range(2, (n+1) - (n+1)%2):
        edges.append((1, i))

# 2からNまでとN+2から2Nまでつなげる (偶数ならN-1まで)
    for i in range(2, (n+1) - (n+1)%2):
        if i % 2:
            edges.append((i, n + i - 1))
        else:
            edges.append((i, n + i + 1))

# N+2とN+1つなげる
    edges.append((n+1, n+2))

# 偶数なら最上位ビットにNを、それ以外+1に2Nをつなげる
    if n%2 == 0:
        edges.append((1 << (n.bit_length() - 1), n))
        edges.append((n - (1 << (n.bit_length()) - 1) + 1, 2*n))

    print("Yes")
    for edge in edges:
        print(*edge)


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

int main() {
  int ans = 0;
  string S,T;
  cin >> S >> T;
  rep(i,S.size()){
    if(S[i] != T[i]){
      ans++;
    }
  }
  cout << ans;
}

Measured memory_bytes: 3832
import itertools
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = [a[0]]
for i in range(n-1):
    b.append(b[i]+a[i+1])
c = list(itertools.combinations(range(n),2))
s = a
for i in c:
    s.append(b[i[1]]-b[i[0]]+a[i[0]])
s.sort(reverse=True)
l = len(bin(s[0]))-2
d = 1<<l-1
t = 0
while d>0:
    s1 = []
    if s[k-1] >= d:
        t += d
        for i in s:
            if i >= d:
                s1.append(i)
            else:
                s=s1
                break
    for i in range(len(s)):
        if s[i] >= d:
            s[i] -= d
        else:
            s.sort(reverse=True)
            break
    d //= 2
print(t)

Measured memory_bytes: 67136
#include<stdio.h>

int main(void){
    int n,limitTime;
    int minCost = 10000;
    int i;
    scanf("%d %d",&n,&limitTime);
    int time[n];
    int cost[n];
    for(i=0;i<n;i++){
        scanf("%d %d",&cost[i],&time[i]);
    }
    /*for(i=0;i<n;i++){
        printf("%d %d\n",cost[i],time[i]);
    }*/
    for(i=0;i<n;i++){
        if(time[i]<=limitTime){
            if(cost[i]<minCost){
                minCost = cost[i];
            }
        }
    }
    if(minCost<=1000){
        printf("%d",minCost);
    }else{
        printf("TLE");
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int, int>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<"\n";
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;
	VAR(int, x, y);
	OUT(x + y/2)BR;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;


int main() {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    int v1 = 0, v2 = 0;
    if(a==5) ++v1;
    if(b==5) ++v1;
    if(c==5) ++v1;

    if(a==7) ++v2;
    if(b==7) ++v2;
    if(c==7) ++v2;
    if(v1==2 && v2==1) puts("YES");
    else puts("NO");
}

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

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

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

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  // 入力
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];

  int ans = 0;
  for (int i = 0; i < N; i++) ans += a[i] - 1;

  // 解答
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
//
//  main.cpp
//  A
//
//  Created by 黄道煜 on 2018/7/21.
//  Copyright © 2018年 黄道煜. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;

char s[105], t[105];

int main()
{
    scanf("%s%s", s, t);
    int len=strlen(s);
    for(int i=0; i<len; i++)
    {
        int flag=1;
        for(int j=0; j<len; j++)
            if(s[j]!=t[(j+i)%len]){flag=0; break;}
        if(flag) {printf("Yes\n"); return 0;}
    }
    printf("No\n");
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
using namespace std;
#include<string>
int main()
{
	string ryuta,ryutan[101];
	int n,i,m,r=0;
	cin>>ryuta>>n;
	for(i=1;i<=n;i++)
	{
		cin>>ryutan[i];
		ryutan[i]=ryutan[i]+ryutan[i];
	}
	for(i=1;i<=n;i++)
	{
		m=0;
		m=ryutan[i].find(ryuta);
		if(m>=0)
		{
			r++;
		}
	}
	cout<<r<<endl;
	return 0;
}

Measured memory_bytes: 3220