akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
vector<int>syutu(500000, 100000);
int main(void)
{
	vector<int>arr;
	int a = 1, b = 1, N; cin >> N;
	arr.push_back(1);
	for (int i = 0; i < 100000; i++)
	{
		if (a * 6 <= 100000)
		{
			arr.push_back(a * 6);
			a *= 6;
		}
		else break;
	}
	for (int i = 0; i < 100000; i++)
	{
		if (b * 9 <= 100000)
		{
			arr.push_back(b * 9);;
			b *= 9;
		}
		else break;
	}
	sort(arr.begin(), arr.end());
	syutu[0] = 0;
	for (int j = 0; j <= 100000; j++)
	{
		for (int i = 0; i < arr.size(); i++)
		{
			syutu[j + arr[i]] = min(syutu[j] + 1, syutu[j + arr[i]]);
		}
	}
	cout << syutu[N] << "\n";
}



Measured memory_bytes: 2176
#include <stdio.h>
#include <math.h>
int main (void){
        int A,B=0;
        scanf("%d",&A);
        scanf("%d",&B);
        if (A<=8&&B<=8) {
        printf("Yay!\n" );
        }else{
        printf(":(\n");
        }

        return 0;

}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
	string S;
  cin >> S;
  if(S[0] == 'A'){
    if(S[1] == 'B' || S[2] == 'B')cout <<"Yes" << endl;
    else cout << "No" << endl;
  }else if(S[0] == 'B'){
    if(S[1] == 'A' || S[2] == 'A')cout <<"Yes" << endl;
    else cout << "No" << endl;
  }
}


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

#define M 1000000
#define L 14

char H[M][L]; /* Hash Table */

int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){ return key%M; }
int h2(int key){ return 1+(key%(M-1)); }

int find(char str[]){

  long long n, i;

  for (i = 0; ; i ++){
    n = (h1(getKey(str)) + i*h2(getKey(str))) % M;
    if (strcmp(H[n],str) == 0)
      return 1;
    else if (H[n][0] == '\0')
      return NULL;
  }
  return 0;
}

int insert(char str[]){

  long long i, n;

  for (i = 0; ; i++){
    n = (h1(getKey(str)) + i*h2(getKey(str))) % M;
    if (strcmp(H[n],str) == 0)
      return 1;
    else if (H[n][0] == '\0'){
      strcpy(H[n],str);
      return 0;
    }
  }
  return 0;
}

int main(){
  int i, n, h;
  char str[L], com[9];
  for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
  scanf("%d", &n);
    
  for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
	
    if ( com[0] == 'i' ){
      insert(str);
    } else {
      if (find(str)){
	printf("yes\n");
      } else {
	printf("no\n");
      }
    }
  }

  return 0;
}



Measured memory_bytes: 15416
s = input()
ans = 0
for i in range(2**(len(s)-1)):
    t = 0
    for j in range(len(s)-1):
        if (i >> j)&1:
            ans += int(s[t:j+1])
            t = j+1
    ans += int(s[t:])
print(ans)

Measured memory_bytes: 9184
#define ONLINE_JUDGE
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vp;
const ll INF=1001001001;
const ll LINF=1001001001001001001;
const ll D4[]={0,1,0,-1,0};
const ll D8[]={0,1,1,0,-1,-1,1,-1,0};
#define _overload3(_1,_2,_3,name,...) name
#define _rep2(i,n) for(ll i=0;i<(n);++i)
#define _rep3(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,_rep3,_rep2)(__VA_ARGS__)
#define _repe2(i,n) for(ll i=0;i<=(n);++i)
#define _repe3(i,a,b) for(ll i=(a);i<=(b);++i)
#define repe(...) _overload3(__VA_ARGS__,_repe3,_repe2)(__VA_ARGS__)
#define _rrep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define _rrep3(i,a,b) for(ll i=(b)-1;i>=(a);i--)
#define rrep(...) _overload3(__VA_ARGS__,_rrep3,_rrep2)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
template<class T>
bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>
bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<class T>
using pq=priority_queue<T,vector<T>,greater<T>>;
const ll mod = 1000000007;

ll N;
ll K;

void solve();

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cin >> N;
    cin >> K;
    solve();
}

// 1 <= N <= 2× 10^5
// 1 <= K <= N+1
// 入力は全て整数

// ll N, ll K
// 和としてあり得るものの個数を \bmod (10^9+7) で出力せよ。
void solve(){
    ll ma=0,mi=0,ans=0;
    rep(i,0,N+1){
        ma+=N-i;
        mi+=i;
        if(i>=K-1)(ans+=ma-mi+1)%=1000000007;
    }
    cout<<ans<<endl;
}


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

int main() {
  int H, N, a;
  cin >> H >> N;
  int sum = 0;
  for (int i = 0; i < N; i++){
    cin >> a;
    sum += a;
  }
  
  if(sum >= H){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}





Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<stdio.h>
using namespace std;

int main(){
    int n;
    string s,ans;
    string word="n";
    cin >> s;
    cin >> ans;
    n=s.size();
    string str=s+s;
    for(int i=0;i<n;i++){
        for(int j=i;j<n+i;j++){
            if(str[j]!=ans[j-i]){
                break;
            }
            if(j==n+i-1){
                cout << "Yes";
                exit(0);
            }
        }
    }
    cout << "No";
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int H, W;
	int i, j;

	scanf("%d %d", &H, &W);
	
	while (!(H == 0 && W == 0)) {
		for (i = 0; i < H; i++) {
			for (j = 0; j < W; j++) {
				if (i > 0 && i < H - 1 && j>0 && j < W - 1)
					putchar('.');
				else
					putchar('#');
			}
			putchar('\n');
		}
		putchar('\n');

		scanf("%d %d", &H, &W);
	}

	return 0;
}

Measured memory_bytes: 572
#include<iostream>
#define SIZE 200000
using namespace std;
 
struct Queue{
  int table[SIZE];
  int tail,head;
 
  void init(){
    head=tail=0;
  }
 
  bool empty(){
    return head==tail;
  }
   
  void inqueue(int x){
    table[tail]=x;
    tail++;
    tail%=SIZE;
  }
 
  int dequeue(){
    if(empty())return 0;
    int res=table[head];
    head++;
    head%=SIZE;
    return res;
  }
};
 
int main(){
  Queue queue,queue2;
  int n,q,num;
  string table[SIZE];
  cin>>n>>q;
  queue.init();
  queue2.init();
  for(int i=0;i<n;i++){
    cin>>table[i]>>num;
    queue.inqueue(num);
    queue2.inqueue(i);
  }
   
  int now=0,A,B;
  while(!queue.empty()){
    A=queue.dequeue();
    B=queue2.dequeue();
    if(A<=q){
      now+=A;
      cout<<table[B]<<' '<<now<<endl;
    }else{
      now+=q;
      A-=q;
      queue.inqueue(A);
      queue2.inqueue(B);
    }
  }
   
  return 0;
}



Measured memory_bytes: 8480
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ub              upper_bound
#define lb              lower_bound
#define isrt            insert
#define clr             clear
#define rsz             resize
#define ff              first
#define ss              second
#define lli             long long int
#define pb              push_back
#define pf              push_front
#define mkp              make_pair
#define pii             pair<lli,lli>
#define vi              vector<int>
#define mii             map<lli,lli>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define INF             1e9
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(v)          v.begin(),v.end()
#define endl            "\n"
const double PI = acos(-1);

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

lli maxm(lli a, lli b)
{
    return (a >= b ? a : b);
}


lli minm(lli a, lli b)
{
    return (a <= b ? a : b);
}

lli power(lli x, lli y, lli p)
{
    lli res = 1;

    x = x % p;
    if (x == 0)
        return 0;

    while (y > 0)
    {

        if (y & 1)
            res = (res * x) % p;


        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

lli nCrmodp(lli n, lli r, lli p)
{
    if (r == 0)
        return 1;
    if (r == 1)
        return n;


    lli pro = 1, k = n;
    while (k > r)
    {
        pro *= k;
        pro %= p;
        --k;
    }

    k = 2;
    while (k <= (n - r))
    {
        pro *= power(k, (p - 2), p);
        pro %= p;
        ++k;
    }

    return pro;
}


lli str_num(string str, lli k)
{

    lli n = str.length(), ans = 0;

    for (lli i = 0; i < n; ++i)
        ans = (k * ans + str[i] - '0');


    return ans;
}


lli first_big(lli n, lli k, vector<lli> arr)
{
    lli l, r, ans = n;
    l = 0;
    r = n - 1;

    while (l <= r) {
        lli m = l + (r - l) / 2;

        if (arr[m] > k) {
            ans = m;
            r = m - 1;
        }

        else
            l = m + 1;
    }

    return ans;
}

lli last_small(lli n, lli k, vector<lli> arr)
{
    lli l, r, ans = -1;
    l = 0;
    r = n - 1;

    while (l <= r)
    {
        lli mid = (l + r) / 2;

        if (arr[mid] <= k)
        {
            ans = mid;
            l = mid + 1;
        }
        else
            r = mid - 1;
    }

    return ans;
}

void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int main()
{
    c_p_c();

    int n, x, t;

    cin >> n >> x >> t;

    int k = (n / x);

    if (n % x != 0)
        k += 1;

    cout << k*t << endl;
    return 0;
}

Measured memory_bytes: 3592
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
bool is_prime(int n) {
  if(n % 2 == 0) {
    return false;
  }
  for(int i = 3; i * i <= n; i += 2) {
    if(n % i == 0) {
      return false;
    }
  }
  return true;
}

int main(void) {
  int x;
  cin >> x;
  int ans = x;
  if(ans == 2) {
    cout << ans << endl;
    return 0;
  }
  while(true) {
    if(is_prime(ans)) {
      cout << ans << endl;
      return 0;
    }
    ans++;
  }
  return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	mochis := make([]int,n)
	for i := 0; i < n; i++ {
		var d int
		fmt.Scan(&d)
		mochis[i] = d
	}

	nums := make([]int,101)
	for _,mochi := range mochis {
		nums[mochi]++
	}

	ans := 0
	for _,num := range nums{
		if num > 0 {
			ans++
		}
	}

	fmt.Println(ans)
}

Measured memory_bytes: 512
#include<iostream>
#include<stdlib.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
  long long int h;
  long long int sum=0;
  int i=0;
  
  cin>>h;
  
  while(h>=1)
  {
    sum=sum+pow(2,i);
    h=h/2;
    i++;
  }
  
  cout<<sum<<endl;
  
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include <queue>
#include <utility>
#include <map>
#include <set>
#include <deque>
#include <numeric>
using namespace std;

#define INF 100000

int main() {
    int N, T,min_cost=INF;
    cin >> N >> T;

    for (int i = 0; i < N; i++) {
        int c, t;
        cin >> c >> t;
        if (T >= t&&c < min_cost) {
            min_cost = c;
        }
    }

    if (min_cost == INF)cout << "TLE" << endl;
    else cout << min_cost << endl;
    
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.io.IOException;

class Main{
	public static void main(String args[]){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] input = new String[100];
		String output = "";
		int 	r,
				c;
		
		try{
			input = br.readLine().split("[\\s]+");
			r = Integer.parseInt(input[0]);
			c = Integer.parseInt(input[1]);
			int table[][] = new int[r+1][c+1];
		
		for(int y = 0;y < r;y++){
			input = br.readLine().split("[\\s]+");
			
			for(int x = 0;x < c;x++){
				table[y][x] = Integer.parseInt(input[x]);
				table[y][c] += table[y][x];
			}
		}
		
		for(int x = 0;x < c + 1;x++){
			for(int y = 0;y < r;y++){
				table[r][x] += table[y][x];
				
			}
			
		}
		
		for(int y = 0;y < r + 1;y++){
			for(int x = 0;x < c + 1;x++){
				output += table[y][x] + " ";
			}
			System.out.println(output.substring(0, output.length()-1));
			output = "";
		}
		}catch(IOException e){
			System.out.println(e);
			return;
		}
	}
}



Measured memory_bytes: 41904
#include <iostream>

using namespace std;

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

	int win = 0;
	for (int i = 0; i < S.length(); i++) {
		if (S[i] == 'o') {
			win++;
		}
	}

	if (win + (15 - S.length()) > 7) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}




Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#define MOD (1000000007l)

using namespace std;

int main(void) {
  // 入力
  long N, L, T;
  cin >> N >> L >> T;
  vector<long> X, W;
  for (long i = 0; i < N; i++) {
    long x, w;
    cin >> x >> w;
    X.push_back(x);
    W.push_back(w);
  }

  // 蟻の位置だけ計算する
  vector<long> result_pos = X;
  for (long i = 0; i < N; i++) {
    if (W[i] == 1) result_pos[i] += T;
    else result_pos[i] -= T;
  }
  for (long i = 0; i < N; i++) {
    result_pos[i] %= L;
    if (result_pos[i] < 0) result_pos[i] += L;
  }
  sort(result_pos.begin(), result_pos.end());

  // result_pos[0]の蟻は何番目の蟻？
  // 初期値 0 番目
  // 0 <= l < T 区間に反時計回り蟻が a 匹いれば +a
  // -T <= l < 0 区間に時計回り蟻が b 匹いれば -b

  // 同じ位置にかぶったときは？ -> 大丈夫な気がする

  long first_ant = 0;
  // 周回の処理
  for (long i = 0; i < N; i++) {
    if (W[i] == 1) first_ant --;
    else first_ant ++;
  }
  first_ant *= (T / L);
  // 端数周回の処理
  for (long i = 0; i < N; i++) {
    if (W[i] == 2 and X[i] < (T % L)) first_ant ++;
    if (W[i] == 1 and L - (T % L) <= X[i]) first_ant --;
  }
  first_ant %= N;
  if (first_ant < 0) first_ant += N;
  /*
  cout << "first_ant: " << first_ant << endl;
  for (long i = 0; i < N; i++) {
    cout << result_pos[i] << endl;
  }
  */
  for (long i = 0; i < N; i++) {
    cout << result_pos[(i + N - first_ant) % N] << endl;
  }

  return 0;
}


Measured memory_bytes: 3820
function Dice( faces ) {
  this.faces = faces;
  this.getFace = function ( id ) {
    return this.faces[id];
  }
  this.roll = function ( cmds ) {
    var t;
    for( var i=0; i<cmds.length; i++ ) {
      if( 'E' == cmds[i] ) {
        t = this.faces[Dice.TOP];
        this.faces[Dice.TOP] = this.faces[Dice.LEFT];
        this.faces[Dice.LEFT] = this.faces[Dice.BOTTOM];
        this.faces[Dice.BOTTOM] = this.faces[Dice.RIGHT];
        this.faces[Dice.RIGHT] = t;
      } else if( 'S' == cmds[i] ) {
        t = this.faces[Dice.TOP];
        this.faces[Dice.TOP] = this.faces[Dice.BACK];
        this.faces[Dice.BACK] = this.faces[Dice.BOTTOM];
        this.faces[Dice.BOTTOM] = this.faces[Dice.FRONT];
        this.faces[Dice.FRONT] = t;
      } else if( 'W' == cmds[i] ) {
        t = this.faces[Dice.TOP];
        this.faces[Dice.TOP] = this.faces[Dice.RIGHT];
        this.faces[Dice.RIGHT] = this.faces[Dice.BOTTOM];
        this.faces[Dice.BOTTOM] = this.faces[Dice.LEFT];
        this.faces[Dice.LEFT] = t;
      } else if( 'N' == cmds[i] ) {
        t = this.faces[Dice.TOP];
        this.faces[Dice.TOP] = this.faces[Dice.FRONT];
        this.faces[Dice.FRONT] = this.faces[Dice.BOTTOM];
        this.faces[Dice.BOTTOM] = this.faces[Dice.BACK];
        this.faces[Dice.BACK] = t;        
      } else if( 'M' == cmds[i] ) {
        t = this.faces[Dice.FRONT];
        this.faces[Dice.FRONT] = this.faces[Dice.RIGHT];
        this.faces[Dice.RIGHT] = this.faces[Dice.BACK];
        this.faces[Dice.BACK] = this.faces[Dice.LEFT];
        this.faces[Dice.LEFT] = t;        
      }
    }
  }
  
  this.isEqual = function( other ) {
    var cmds = "NWWWNMMMM";
    var isequal = false;
    for( var i=0; i<cmds.length && !isequal; i++ ) {
      if( other.getFace( Dice.TOP ) == this.getFace( Dice.TOP ) ) {
        var j;
        for( j=5; j<cmds.length && !isequal; j++ ) {
          if( other.getFace( Dice.FRONT ) == this.getFace( Dice.FRONT ) ) {
            var k;
            for( k=Dice.TOP; k<=Dice.BOTTOM; k++ ) {
              if( this.getFace( k ) != other.getFace( k ) ) { break; }
            }
            isequal = (k==6)?true:false;
          }
          other.roll( cmds[j] );
        }
      }
      other.roll( cmds[i] );
    }
    return isequal;
  }
}
Dice.TOP = 0;
Dice.FRONT = 1;
Dice.RIGHT = 2;
Dice.LEFT = 3;
Dice.BACK = 4;
Dice.BOTTOM = 5;

var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var data = input.split( '\n' );
  var n = parseInt( data[0] );
  var dices = [];
  for( var i=1; i<=n; i++ ) {
    dices.push( new Dice( data[i].split( ' ' ).map( Number ) ) );
  }
  
  var isequal = false;
  for( var i=0; i<n-1 && !isequal; i++ ) {
    for( var j=i+1; j<n && !isequal; j++ ) {
      isequal = dices[i].isEqual( dices[j] );
    }
  }
  if( isequal ) {
    console.log( "No" );
  } else {
    console.log( "Yes" );
  }
});

Measured memory_bytes: 16256
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]A - AtCoDeerくんとペンキ / AtCoDeer and Paint Cans
            var line = ReadLine();
            int a = line[0];
            int b = line[1];
            int c = line[2];

            if (a == b && a == c)
            {
                Console.WriteLine(1);
            }
            else if (a == b | a == c | b == c)
            {
                Console.WriteLine(2);
            }
            else
            {
                Console.WriteLine(3);
            }
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var array = line.Split(' ');

            return array.Select(x => int.Parse(x)).ToList();
        }
    }
}


Measured memory_bytes: 11476
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int lcs(const string & a, const string & b)
{
    vector<vector<int> > dp(a.size(), vector<int>(b.size()));

    for (size_t i = 0; i < dp.size(); ++i) {
        for (size_t j = 0; j < dp[0].size(); ++j) {
            if (a.at(i) == b.at(j)) {
                dp[i][j] = ((i == 0 || j == 0) ? 0 : dp[i - 1][j - 1]) + 1;
            } else {
                dp[i][j] = max(i == 0 ? 0 : dp[i - 1][j],
                               j == 0 ? 0 : dp[i][j - 1]);
            }
        }
    }

    return dp[a.length() - 1][b.length() - 1];
}

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        string a, b;
        cin >> a >> b;
        cout << lcs(a, b) << endl;
    }

    return 0;
}

Measured memory_bytes: 5040
s = input()

angle = {'N':0, 'W':0, 'S':0, 'E':0}

for i in s:
    angle[i] += 1


if angle['N'] > 0 and angle['S'] == 0:
    print('No')
    exit()

if angle['S'] > 0 and angle['N'] == 0:
    print('No')
    exit()

if angle['W'] > 0 and angle['E'] == 0:
    print('No')
    exit()

if angle['E'] > 0 and angle['W'] == 0:
    print('No')
    exit()

print('Yes')

Measured memory_bytes: 3064
n = int(input())
for i in range(n):
    xa, ya, ra, xb, yb, rb = map(float, input().split())
    d = ((xa - xb)**2 + (ya - yb)**2)**0.5
    if d > ra + rb:
        print(0)
    elif ra + d < rb:
        print(-2)
    elif rb + d < ra:
        print(2)
    else:
        print(1)

Measured memory_bytes: 6788
def main():
  while True:
    n, m = map(int,input().split())
    if not n:
      break
    
    lst = [0] * m
  
    for i in range(n):
      lst = [i + j for i, j in zip(lst, map(int,input().split()))]
  
    lst = list(zip(lst,range(1,m + 1)))
    lst = sorted(lst,key=lambda t:-t[0])
    
    print(" ".join(list(map(str,[t[1] for t in lst]))))
  
main()


Measured memory_bytes: 5624
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
#include <cstring>
using namespace std;

using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

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

    int N;
    cin >> N;
    int zero = 0;
    vector<int> positive, negative;
    int mine = INF;
    for(int i = 0; i < N; ++i){
        int A;
        cin >> A;
        if(A == 0)  ++zero;
        else if(A > 0)  positive.emplace_back(A);
        else    negative.emplace_back(-A);
        chmin(mine, abs(A));
    }
    int np = positive.size(), nn = negative.size();
    ll ans = accumulate(positive.begin(), positive.end(), 0LL);
    ans += accumulate(negative.begin(), negative.end(), 0LL);
    if((nn & 1) && !zero)   ans -= mine * 2;
    cout << ans << endl;
}

Measured memory_bytes: 3892
#include <iostream>
#include <string>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;

int main()
{
	int a, b, c,x;
	cin >> a >> b >>c;


	x = b / a;

	if (x > c) {
		cout << c << endl;
	}
	else {
		cout << x << endl;
	}
	//cout << x << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 1e5 + 7, M = 1e7, OO = 0x3f3f3f3f;
#define AC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin.sync_with_stdio(0);
int main()
{
int n,m,i,j;
char array1[100][100];
scanf("%d %d",&n,&m);
for(i=0;i<n;++i){
    for(j=0;j<m;++j){
        scanf(" %c",&array1[i][j]);
    }
}
for(i=0;i<m+2;++i){
    printf("#");
}
printf("\n");
for(i=0;i<n;++i){
    printf("#");
    for(j=0;j<m;++j){
        printf("%c",array1[i][j]);
    }
    printf("#\n");
}
for(i=0;i<m+2;++i){
    printf("#");
}

    return 0;
}


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

#define int long long int

void fileioe(){
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout); 
	freopen("error.txt","w",stderr);
}
#define GO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifndef ONLINE_JUDGE
#define fioe() fileioe()
#else
#define fioe() 1
#endif
//!
double pie = atan(1)*4;
int32_t main()
{
	GO
	//fioe();
	double r;
	cin>>r;
	cout<<setprecision (20) << (2*pie*r)<<endl;
	return 0;
}

Measured memory_bytes: 3804
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

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

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {
	int x, y, z; cin >> x >> y >> z;

	int ans = (z / x) * y;

	cout << ans << endl;

	return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	os << v[0];
	for (int i = 1; i < v.size(); i++) os << " " << v[i];
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u; return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	int N; cin >> N;
	vint L(N); cin >> L;
	ll cnt = 0;
	sort(begin(L), end(L));
	for (int i = 0; i < N; i++) {
		for (int j = i+1; j < N; j++) {
			int pos = --lower_bound(begin(L) + j+1, end(L), L[i] + L[j]) - begin(L);
			cnt += pos - j;
		}
	}
	cout << cnt << endl;
}

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

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int N;
  cin >> N;
  int sai[N][2];
  for(int i = 0; i<N;i++){
    cin >> sai[i][0] >> sai[i][1];
  }
  for(int i = 0;i<N-2;i++){
    if(sai[i][0]==sai[i][1] && sai[i+1][0]==sai[i+1][1] && sai[i+2][0]==sai[i+2][1])
    {
      cout << "Yes" << endl;
      break;
  }
    if(i == N-3){
    cout << "No" << endl;
    }
  }
  
  
}

Measured memory_bytes: 3628
# 2020/05/17
# AtCoder Beginner Contest 168 - A

# Input
n = int(input())

# Calc
wkval = n % 10

if wkval == 3:
    ans = 'bon'
elif wkval == 0 or wkval == 1 or wkval == 6 or wkval == 8:
    ans = 'pon'
else:
    ans = 'hon'

# Output
print(ans)


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

//定数
const long long MOD1=1000000007;
const long long MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};

//省略
#define ll long long
#define ull unsigned long long
#define ld long double
#define uld unsigned long double
#define pll pair<long long,long long>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vvvl vector<vector<vector<long long>>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vs vector<string>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define bitrep(i,s,n) for(long long i=(s);i<(1LL<<(n));i++)
#define bitcheck(bit,i) (bit)&(1LL<<(i))
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define Lin(s) getline(cin,(s))

//Yes,No
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
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;}

//切り上げ除算
long long cutup(long long a,long long b){return (a+b-1)/b;}

//累乗
template<typename t>
constexpr t my_pow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
    }
    return x;
}
#define pow my_pow

//chmin,chmax
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;}

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

//main関数
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll x,k,d;
    cin>>x>>k>>d;
    if(abs(x/d)<=k){
        k-=abs(x/d);
        x%=d;
    }else if(x<0){
        x+=k*d;
        k=0;
    }else{
        x-=k*d;
        k=0;
    }
    if(k%2==1){
        if(x<0)x+=d;
        else x-=d;
    }
    cout<<abs(x)<<endl;
}

Measured memory_bytes: 3652
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
#include<set>
#include<cstring>
using namespace std;
long long int mod = 1e9 + 7;
template <class T>
void inputV(vector<T> &x, int n){
  for(int i=0; i<n; i++) cin >> x[i];
}
int main() {
  for(int i=0; i<3; i++){
    string s; cin >> s;
    cout << s[i];
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#define ll long long
using namespace std;

const int maxn = 1e5 + 10;
ll s[maxn], t[maxn];ll temp1[3], temp2[3];

int main() {
	int A, B, Q;
	scanf("%d%d%d", &A, &B, &Q);
	for (int i = 0; i < A; i++) {
		scanf("%lld", &s[i]);
	}
	for (int i = 0; i < B; i++) {
		scanf("%lld", &t[i]);
	}
	while (Q--) {
		ll x;
		scanf("%lld", &x);
		int s1 = lower_bound(s, s + A, x) - s, t1 = lower_bound(t, t + B, x) - t;
		int s2 = max(s1 - 1, 0), t2 = max(t1 - 1, 0);
		temp1[0] = (ll)s[s1], temp1[1] = (ll)s[s2], temp2[0] = (ll)t[t1], temp2[1] = (ll)t[t2];
		ll d = (ll)1e18;
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				d = min(d, abs(temp1[i] - temp2[j]) + min(abs(temp1[i]-x), abs(temp2[j] - x)));
			}
		}
		printf("%lld\n", d);
	}
	return 0;
}

Measured memory_bytes: 2816
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n; cin >> n; ++n;
  vector<int> a(n, 0); FOR(i, 1, n) cin >> a[i];
  FOR(i, 1, n) a[i] ^= a[i - 1];
  vector<int> cnt(n, 0);
  REP(i, n) {
    if (a[i] == 0) cnt[i] = 1;
    if (i > 0) cnt[i] += cnt[i - 1];
  }
  vector<long long> dp_zero(1 << 20, 1), dp_x(1 << 20, 0), last(1 << 20, -1);
  REP(i, n) if (a[i] > 0) {
    int kosu = (last[a[i]] == -1 ? cnt[i] : cnt[i] - cnt[last[a[i]]]);
    (dp_zero[a[i]] += kosu * dp_x[a[i]] % MOD) %= MOD;
    (dp_x[a[i]] += dp_zero[a[i]]) %= MOD;
    last[a[i]] = i;
  }
  if (a[n - 1] > 0) {
    cout << dp_zero[a[n - 1]] << '\n';
  } else {
    long long ans = 1;
    REP(i, cnt[n - 1] - 2) (ans *= 2) %= MOD;
    REP(i, 1 << 20) (ans += dp_x[i]) %= MOD;
    cout << ans << '\n';
  }
  return 0;
}


Measured memory_bytes: 28800
#include <math.h>
#include <algorithm>
#include <set>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <cstring>
#include <functional>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <chrono>
#include <climits>
using namespace std ;
#define ld long double
#define int long long
#define _ ios_base::sync_with_stdio(false) ;cin.tie(NULL);cout.tie(NULL);
#define inp(a) for(auto& i : a) cin >> i;
#define out(a) for(auto i : a){cout << i << ' ';}cout << endl;
#define dbg(x) cerr << #x << " is " << x << endl;
#define F(i,b) for(int i = 0 ; i < (int)(b) ; i++)
#define RF(j,b) for(int j = (int)(b)-1 ; j >= 0 ; j--)
#define ms(x,a) memset(x,(int)(a),sizeof(x))
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pii pair<int,int>
#define vi vector<int >
#define pb push_back
#define endl '\n'
#define ff first
#define ss second
#define LOCAL
const int N = 2e5+7 ;
const int INF = 1e9 ;
const int MOD = INF + 7 ;
string s ;

int32_t main(){_
	int n,m ;
	cin >> n >> m ;
	vector<pii >a(m) ;
	for(int i = 0 ; i < m ; i++){
		int cost ; int cnt , x ;
		cin >> cost >> cnt ;
		int mask = 0 ;
		for(int j = 0 ; j < cnt ; j++){
			cin >> x ;
			--x ;
			mask |= (1 << x) ;
		}
		a[i] = {mask,cost} ;
	}
	vector<int> dp(1<<n,INF) ;
	dp[0] = 0 ;
	for(int i = 0 ; i <  m ; i++){
		vi ndp = dp ;
		for(int mask = 0 ; mask < (1<< n) ; mask++){
			if(dp[mask] < INF ){
				ndp[mask | (a[i].ff)] = min(ndp[mask | (a[i].ff)] , dp[mask] + a[i].ss) ; 
			}
		}
		swap(dp,ndp) ;
	}

	if(dp.back() < INF) cout << dp.back() << endl ;
	else cout << -1 << endl ;
}


Measured memory_bytes: 384
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Iterator;

class Graph {
	private int totalVertex;
	//adjMatrix[u][v] = 1 if there is an edge from u to v, otherwise 0
	private int[][] adjMatrix;
	//adjWeight[u][v] -- the weight of the edge from u to v if there is one
	private int[][] adjWeight;
	//if a node is settled (e.g., processed in the Dijkstra's algorithm)
	private Boolean[] ifSettled;
	public Graph() { totalVertex = 0; }
	public int getTotalVertex() { return totalVertex; }
	//load graph from standard input
	public void loadAdjMatrix() {
		Scanner in = new Scanner(System.in);
		totalVertex = in.nextInt();
		adjMatrix = new int[totalVertex][totalVertex];
		adjWeight = new int[totalVertex][totalVertex];
		ifSettled = new Boolean[totalVertex];
		int i, j;
		for(i = 0; i < totalVertex; i ++) {
			ifSettled[i] = false;
			for(j = 0; j < totalVertex; j ++) {
				adjMatrix[i][j] = adjWeight[i][j] = 0;
			}
		}
		int u, v;
		for(i = 0; i < totalVertex; i ++) {
			u = in.nextInt();
			int degree = in.nextInt();
			for(j = 0; j < degree; j ++) {
				v = in.nextInt(); 
				adjMatrix[u][v] = 1;
				adjWeight[u][v] = in.nextInt();
			}	
		}
		in.close();
	}
	//return weight of the edge from u to v if there is one
	public int getWeight(int u, int v) {
		return adjWeight[u][v];
	}
	//return neighbors of u as a LinkedList
	public LinkedList<Integer> getNeighbors(int u) {
		LinkedList<Integer> tmp = new LinkedList<Integer>();
		for(int v = 0; v < totalVertex; v ++) {
			if(adjMatrix[u][v] == 1) tmp.add(v);
		}
		return tmp;
	}
	//return unsettled neighbors of u as a LinkedList
	public LinkedList<Integer> getUnsettledNeighbors(int u) {
		LinkedList<Integer> tmp = new LinkedList<Integer>();
		for(int v = 0; v < totalVertex; v ++) {
			if((adjMatrix[u][v] == 1) && (ifSettled[v] == false)) tmp.add(v);
		}
		return tmp;
	}
	//return the unsettled node that has the smallest dist
	public int getUnsettledNearest(int[] dist) {
		int md = Integer.MAX_VALUE;
		int mv = -1;
		int v;
		for(v = 0; v < totalVertex; v ++) {
			if((ifSettled[v] == false) && (dist[v] < md)) {
				md = dist[v];
				mv = v;
			}
		}
		return mv;
	}
	//implement the following	
	public int[] Dijkstra(int s) {
		// create array to store distances
		// initialize source node to 0 and rest to max value
		int[] dist = new int[totalVertex];
		dist[s] = 0;
		for(int i = 1; i < totalVertex; i++) {
			dist[i] = Integer.MAX_VALUE;
		}
		
		for(int i = 0; i < totalVertex; i++) {
			int nearest = getUnsettledNearest(dist);
			ifSettled[nearest] = true;
			
			for(int neighbor : getNeighbors(nearest)) {
				dist[neighbor] = Math.min(dist[neighbor], dist[nearest] + getWeight(nearest, neighbor));
			}
		}
		return dist;
	}
}

public class Main {
	public static void main(String[] argv) {
		Graph g = new Graph();
		g.loadAdjMatrix();
		int[] dist = g.Dijkstra(0);
		for(int i = 0; i < g.getTotalVertex(); i ++) {
			System.out.println(i + " " + dist[i]);
		}
	}
}




Measured memory_bytes: 40724
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,wt;
    cin>>n>>wt;
    long long w[n],val[n];
    for(int i=0;i<n;i++){
        cin>>w[i]>>val[i];
    }
    long long dp[2][wt+1];
    for(int i=0;i<2;i++)
    {
        for(int j=0;j<wt+1;j++){
            dp[i][j]=0;
        }
    }
    for(int i=1;i<n+1;i++){
        for(int j=0;j<wt+1;j++){
            if(w[i-1]<=j){
                dp[1][j]=max(dp[0][j],val[i-1]+dp[0][j-w[i-1]]);
            }
            else
                dp[1][j]=dp[0][j];
        }
        for(int k=0;k<wt+1;k++){
            dp[0][k]=dp[1][k];
            dp[1][k]=0;
        }
    }
    cout<<dp[0][wt]<<endl;
}


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

using namespace std;
typedef long long ll;

#define rep(i, N) for (int i = 0; i < (int)N; i++)
const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;


int main() {
  string S, T; cin >> S >> T;
  int result = 0;
  rep(i,3) if (S[i]==T[i]) result++;
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define vi vector<long long>
#define vvi vector<vector<long long>>
int main(void){
  int H, n;
  cin >> H;
  cin >> n;
  int sum = 0;
  int ai = 0;
  for(int i = 0 ; i < n; i++){
    cin >> ai;
    sum += ai;
  }
  if(sum>=H){
    cout<<"Yes"<<endl;
  }
  else{
  	cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); ++i)
#define REPR(i, n) for (int i = static_cast<int>(n) - 1; i >= 0; --i)
#define FOR(i, a, b) \
  for (int i = static_cast<int>(a); i < static_cast<int>(b); ++i)
#define FORR(i, a, b) \
  for (int i = static_cast<int>(b) - 1; i >= static_cast<int>(a); --i)
#define ALL(f, x, ...) \
  ([&](auto &y) { return (f)(begin(y), end(y), ##__VA_ARGS__); })(x)
#define INDEX(x, xs) &x - &xs[0]

void async_io() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
const auto inf = INT_MAX / 3;
const auto pi = 2 * std::acos(0.0);
const auto eps = 1e-14;
using ll = long long int;
using ull = unsigned long long;

signed main() {
  async_io();
  int n;
  while (true) {
    cin >> n;
    if (n == 0) return 0;
    auto sum = 0;
    for (int i = 2;; i++) {
      auto base = i * (i + 1) / 2;
      if (base > n) break;
      if ((base - n) % i == 0) sum++;
    }
    cout << sum << "\n";
  }
}

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

using namespace std;

using ll = long long;

const int N = 110000;
ll A[N];
ll pref[N];

void maxi(int &a, int b) {
	a = max(a,b);
}

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);	
	int n, v, p;
	ll m;
	cin >> n >> m >> v >> p;
	for (int i =0; i < n; i++) {
		cin >> A[i];
	}
	sort(A, A+n);
	reverse(A, A+n);
	pref[0] = 0;
	for (int i=0; i < n; i++) {
		pref[i+1] = pref[i] + A[i];
	}
	int ans = p;
	for (int i=p; i<n; i++) {
		ll left = max(v-p-(n-1-i), 0);
		if ((A[i] + m >= A[p-1]) && ((pref[i] - pref[p-1] + m*left) <= (i-(p-1))*(A[i]+m))) {
			ans++;
		}	
	}
	cout << ans << "\n";
	return 0;	
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;

using ll = long long;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;

auto R(int s, int n) {
    return boost::irange(s, n);
}
auto R(int n) {
    return boost::irange(0, n);
}
void show(const auto& v){
    for(auto i:v) cout << i << " ";
    cout << endl;
}

int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(b<=c||d<=a){
        cout<<0<<endl;
    }else{
        if(d>=b){
            if(a>=c){
                cout<<b-a<<endl;
            }else{
                cout<<b-c<<endl;
            }
        }else{
            if(a>=c){
                cout<<d-a<<endl;
            }else{
                cout<<d-c<<endl;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for(int i =0 ; i < n; ++i)
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define pii pair < int, int >
typedef vector<int> vi;
typedef  long long ll;
const int mod =1e9+7;
const int N = (int)2e5 + 5;

void solve(){
	int x;
	cin>>x;
	cout<<(x<1200?"ABC":"ARC");

}

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

Measured memory_bytes: 384
N=int(input())
l=[]
l.append(int(input()))
l.append(int(input()))
m1=max(l)
m2=min(l)
for _ in range(N-2):
  l.append(int(input()))
  if l[-1] >= m1:
    m2 = m1
    m1 = l[-1]
  elif l[-1] > m2:
    m2 = l[-1]
for i in range(N):
  if l[i] == m1:
    print(m2)
  else:
    print(m1)

Measured memory_bytes: 16936
#include<stdio.h>
int main(){
       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>

#define int long long

#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##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define all(box) box.begin(), box.end()

using namespace std;

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

const long long INF = LLONG_MAX/3;

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

struct UnionFind{
	std::vector<int> par,siz;
	void init(int n){
		par.resize(n);
		for(int i=0;i<n;i++)par[i]=i;
		siz.resize(n,1);
	}
	UnionFind(int n){
		init(n);
	}
	int root(int n){
		if(par[n]==n)return n;
		else return par[n]=root(par[n]);
	}
	bool issame(int x,int y){
		return (root(x)==root(y));
	}
	bool marge(int a,int b){
		if(issame(a,b))return false;
		else{
			a=root(a),b=root(b);
			if(siz[a]<siz[b])swap(a,b);
			siz[a]+=siz[b];
			par[a]=par[b];
			return true;
		}
	}
	int size(int n){
		return siz[root(n)];
	}
};

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

const int MOD=1e9+7;
long long fac[510000], finv[510000], inv[510000];
long long MAX=510000;
bool COMinited=false;
long long COM(int n, int k){
	if(COMinited==false){
		fac[0] = fac[1] = 1;
    	finv[0] = finv[1] = 1;
    	inv[1] = 1;
    	for (int i = 2; i < MAX; i++){
        	fac[i] = fac[i - 1] * i % MOD;
        	inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        	finv[i] = finv[i - 1] * inv[i] % MOD;
    	}
		COMinited=true;
	}
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

signed main(){
	int n;
	cin>>n;
	int x[110];
	rep(i,n)cin>>x[i];
	int re=INF;
	rep(i,100){
		int cnt=0;
		rep(j,n){
			cnt+=pow(i-x[j],2);
		}
		chmin(re,cnt);
	}
	cout<<re<<endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var K, A, B int
	fmt.Scanf("%d", &K)
	fmt.Scanf("%d %d", &A, &B)

	base := A / K
	if A%K > 0 {
		base += 1
	}

	if base*K <= B {
		fmt.Println("OK")
	} else {
		fmt.Println("NG")
	}
}


Measured memory_bytes: 1816