akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

class Main {
    private static void solve() {
        final Scanner scanner = new Scanner(System.in);

        while (true) {
            final int n = scanner.nextInt();
            final int m = scanner.nextInt();
            final int p = scanner.nextInt();
            if (n == 0 && m == 0 && p == 0) {
                break;
            }
            int sum = 0;
            int winner = 0;
            for (int i = 0; i < n; i++) {
                final int x = scanner.nextInt();
                sum += x;
                if (i == m - 1) {
                    winner = x;
                }
            }
            if (winner == 0) {
                System.out.println(0);
            } else {
                System.out.println((int) ((double) sum * (100 - p) / winner));
            }
        }
    }

    public static void main(String... args) {
        solve();
    }
}

Measured memory_bytes: 0
a, b, m = map(int, input().split())
a_arr = list(input().split())
b_arr = list(input().split())

m_arr = []

for _ in range(m):
    m_arr.append(list(input().split()))

temp_min = int(min(a_arr)) + int(min(b_arr))

for xm, ym, cm in m_arr:
    wari = int(a_arr[int(xm)-1]) + int(b_arr[int(ym)-1]) - int(cm)

    if wari < temp_min:
        temp_min = wari


print(temp_min)


Measured memory_bytes: 46012
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    long long tmp1, tmp2;
    cin >> tmp1;
    int count = 0, max = 0; 
    for(int i=0;i<N-1;i++){
        cin >> tmp2;
        if(tmp1 >= tmp2){
            count++;
        }
        else{
            if(count > max) max = count;
            count = 0;
        }
        tmp1 = tmp2;
    }
    
    if(count > max) max = count;
    cout << max << "\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <set>

struct TestData
{
  int testNum;
  std::string input;
  std::string expectedOutput;
};

struct TestResult
{
  std::string testOutput;
  bool testPassed;
};

void testSolution();
TestResult runTestCase(const TestData& testData);
std::string formatResult(const TestData& testData, const TestResult& testResult);
void solution(std::istream& is, std::ostream& os);

static const bool IS_TESTING = false;

// define test data
static const std::vector<TestData> testDatas = {
  {1, "2\n10 30\n", "7.5\n"},
  {2, "1\n1000\n", "1000\n"},
};

int main()
{
  if (IS_TESTING)
    testSolution();
  else
    solution(std::cin, std::cout);

  return 0;
}

void testSolution()
{
  for (const auto& testData : testDatas) {
    auto testResult = runTestCase(testData);

    std::cout << formatResult(testData, testResult);
  }
}

TestResult runTestCase(const TestData& testData)
{
    std::istringstream iss {testData.input};
    std::ostringstream oss {};

    solution(iss, oss);

    auto testOutput = oss.str();
    auto testPassed = testData.expectedOutput.compare(testOutput) == 0;
    
    return {testOutput, testPassed};
}

std::string formatResult(const TestData& testData, const TestResult& testResult)
{
  std::ostringstream oss {};

  oss << "Test " << std::setw(2) << testData.testNum << ": "
    << (testResult.testPassed ? "Passed!" : "Failed!") << std::endl;
  
  oss << "\tExpected: " << testData.expectedOutput << "\tActual  : " << testResult.testOutput << std::endl;

  return oss.str();
}


// solution to the problem
void solution(std::istream& is, std::ostream& os)
{
  auto inverse = [](double number) { return 1 / number; };

  // read input
  int numInputs; is >> numInputs;
  double input;
  double sumOfInverse = 0;
  for (auto i = 0; i < numInputs; ++i) {
    is >> input;
    sumOfInverse += inverse(input);
  }

  os << inverse(sumOfInverse) << std::endl;
}

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

int main() {
  vector<int> vec(3);
  for (int i = 0; i < 3; i++){
    cin >> vec.at(i);
  }
  
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  
  cout << 10*vec.at(0) + vec.at(1) + vec.at(2) << endl;
}

Measured memory_bytes: 256
n = int(input())
d = [int(input()) for i in range(n)]

cnt = 0
value_before = 0
for i in range(n):
    value = max(d)
    if i == 0:
        value_before = value
        d.remove(value)
        cnt += 1
        continue
    if value_before > value:
        value_before = value
        cnt += 1
    d.remove(value)

print(cnt)

Measured memory_bytes: 38256
<?php
    fscanf(STDIN, "%s", $input);
    // $chars = str_split($input);
    $length = strlen($input);
    $output = '';
    for ($i = 0; $i < $length; $i=$i+2) {
        $output = $output . substr($input, $i, 1);
    }
    echo $output . "\n";
?>


Measured memory_bytes: 3852
from collections import defaultdict

N, M = [int(x) for x in input().split()]
a = []

for _ in range(M):
    a.append(int(input()))

MOD = 1000000007

stair_list = [0] * (N + 2)

stair_list[0] = 1
a_s = set(a)
for i in range(N):
    if not i in a_s:
        stair_list[i + 1] += stair_list[i]
        stair_list[i + 2] += stair_list[i]


print(stair_list[N] % MOD)




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

typedef long long ll;

int N;
int A[100010],B[100010],C[100010];
ll cnt[100010][4] = {0};
ll ans = 0;

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N; i++)scanf("%d",A + i);
    for(int i = 0; i < N; i++)scanf("%d",B + i);
    for(int i = 0; i < N; i++)scanf("%d",C + i);

    sort(A,A + N);
    sort(B,B + N);
    sort(C,C + N);

    int now = N - 1;
    ll sum = 0;


    for(int i = 0; i < N; i++)cnt[i][2] = 1;

    for(int i = N - 1; i >= 0; i--)
    {
        while(now != -1 && B[i] < C[now]){sum += cnt[now][2];now--;}
        cnt[i][1] = sum;
    }

    now = N - 1;sum = 0;

    for(int i = N - 1; i >= 0; i--)
    {
        while(now != -1 && A[i] < B[now]){sum += cnt[now][1];now--;}
        cnt[i][0] = sum;
        ans += cnt[i][0];
    }


    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 4480
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    long k;
    scanf("%ld", &k);
    if(k % 2 == 0 || k % 5 == 0){
        printf("-1");
        return 0;
    }
    
    long n = 1;
    long iNum = 7;
    long iTenMulti = 10;
    while(true){
        if(iNum % k == 0){
            break;
        }
        else {
            iNum += (iTenMulti * 7);
            iTenMulti *= 10;
            iTenMulti %= k;
            n++;
        }
    }
    printf("%ld", n);
    return 0;
}


Measured memory_bytes: 3232
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
    string N;
    cin >> N;

    string ans = "No";
    for (int i = 0; i < (int)N.size(); i++)
        if (N[i] == '7')
            ans = "Yes";

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
const int MAXN=100;
int uN,vN;  //u,v数目
int g[MAXN][MAXN];//编号是0~n-1的
int linker[MAXN];
bool used[MAXN];
bool dfs(int u)
{
    int v;
    for(v=0;v<vN;v++)
        if(g[u][v]&&!used[v])
        {
            used[v]=true;
            if(linker[v]==-1||dfs(linker[v]))
            {
                linker[v]=u;
                return true;
            }
        }
    return false;
}
int hungary()
{
    int res=0;
    int u;
    memset(linker,-1,sizeof(linker));
    for(u=0;u<uN;u++)
    {
        memset(used,0,sizeof(used));
        if(dfs(u))  res++;
    }
    return res;
}

struct Node
{
    int x,y;
}A[110],B[110];
int main()
{
    int n;
    scanf("%d",&n);

    for (int i = 0 ; i < n ; i++ )
        scanf("%d%d",&A[i].x,&A[i].y);
    for (int i = 0 ; i < n ; i++ )
        scanf("%d%d",&B[i].x,&B[i].y);

    memset(g,0,sizeof g);
    for (int i = 0 ; i < n ; i++ )
        for (int j = 0 ; j < n ; j++)
        if (A[i].x < B[j].x && A[i].y < B[j].y)
           g[i][j]  = 1;

       uN = vN = n;
    cout<<hungary()<<endl;
    return 0;

}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

int main()
{
	string str;
	int rect_num=0;
	int diam_num=0;
	int edge1, edge2, diag;
	while(~scanf("%d,%d,%d",&edge1,&edge2,&diag)){

		if(edge1 + edge2 <= diag) continue;

		if(edge1*edge1 + edge2*edge2 == diag * diag){
			rect_num++;
		}
		else if(edge1 == edge2){
			diam_num++;
		}
	}

	printf("%d\n%d\n",rect_num,diam_num);
}

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

typedef long long ll;
typedef pair<int,int> P;
double const pi = acos(-1);

#define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

struct coord {
    double x,y;
    bool operator<(const coord& a) const {
        double s = atan(y/x),t = atan(a.y/a.x);
        if (x < 0) s += pi;
        if (a.x < 0) t += pi;
        return s < t;
    }
};

int main() {
    int n;
    cin >> n;
    vector<coord> a(n);
    for (int i = 0;i < n;++i) cin >> a[i].x >> a[i].y;
    sort(a.begin(),a.end());
    double ans = 0.0;
    for (int i = 0;i < n;++i) {
        double x = 0,y = 0;
        for (int j = 0;j < n;++j) {
            x += a[(i+j)%n].x;
            y += a[(i+j)%n].y;
            ans = max(ans,sqrt(x*x+y*y));
        }
    }
    cout << fixed << setprecision(12) << ans << endl;
    return 0;
}

Measured memory_bytes: 384
_ = gets.chomp.to_i
list = gets.split.map(&:to_i)

max = nil
min = nil
sum = 0
list.each do |e|
  max = e if max.nil? || e > max
  min = e if min.nil? || e < min
  sum += e
end

puts "#{min} #{max} #{sum}"



Measured memory_bytes: 7156
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MAX=1e5+5;
LL DP[3002][3002];

int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
    string a,b;
    cin >> a >> b;
    int n = a.length();
    int m = b.length();
    
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=m;j++)
        {
            DP[i][j] = 0;
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            if(a[i-1] == b[j-1])
            {
                LL x = DP[i-1][j-1] + 1;
                DP[i][j] = x;
            }
            else
            {
                if(DP[i-1][j]>DP[i][j-1])
                {
                    DP[i][j] = DP[i-1][j];
                }
                else
                {
                    DP[i][j] = DP[i][j-1];
                }
            }
        }
    }
    string ans="";
    int i = n , j = m;
    while(i>0 || j>0)
    {
        //cout<<i<<" "<<j<<" "<<ans<<endl;
        if(i == 0 || j == 0) break;
        if(DP[i][j] == DP[i-1][j])
        {
            i--;
            continue;
        }
        if(DP[i][j] == DP[i][j-1])
        {
            j--;
            continue;
        }
        ans = ans + a[i-1];
        i--;j--;
        
    }
    //cout<<"Hi";
    reverse(ans.begin() , ans.end());
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 70656
//tt89 ;)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
void testcase(int t) { cout<<"Case #"<<t<<": "; }
void online() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif //ONLINE_JUDGE
}
const int mod= 1e9+7;

int main() {
    fastIO;
    int n; cin>>n;
    ll d; cin>>d;
    d=d*d;
    int ans=0;
    for(int i=0;i<n;i++) {
        ll a,b; cin>>a>>b;
        ll dist= a*a + b*b;
        if(dist<=d) ans++;
    }
    cout<<ans;
    return 0;
}



Measured memory_bytes: 3660
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
A=[0]
for i in range(n):
  A.append(A[i]+a[i])
B=[0]
for i in range(m):
  B.append(B[i]+b[i])
ans=0
j=m
for i in range(n+1):
  if A[i]>k:
      break
  while B[j]>(k-A[i]):
    j-=1
  ans=max(ans,i+j)
print(ans)

Measured memory_bytes: 47480
if __name__ == "__main__":
    n = int(input())
    R = []
    for i in range(0,n,1):
        R.append(int(input()))
    maxv = R[1] - R[0]
    minv = R[0]
    for i in range(1,n,1):
        maxv = max(maxv, R[i]-minv)
        minv = min(minv,R[i])
    print(maxv)


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

using namespace std;

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


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int a1, a2, a3, max, min;

	scanf("%d %d %d", &a1, &a2, &a3);

	max = a1;
	min = a1;

	if(max < a2)	max = a2;
	if(max < a3)	max = a3;

	if(min > a2)	min = a2;
	if(min > a3)	min = a3;

	printf("%d", max - min);

	return 0;

}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long
#define INF 1e9
#define pb push_back
#define mp  make_pair
#define loop(a,n) for(long long i=a;i<n;i++)
#define vil vector<long long int>
#define vi vector<int>
#define sz(v) v.size()
#define setbits(x)          __builtin_popcountll(x)
#define ff first
#define ss second
using namespace std;


ll gcd(ll a, ll b) {
  if (a == 0)return b;
  return gcd(b % a, a);
}
bool isperfect(ll n) {
  ll y = sqrt(n);
  if (n % y == 0 && y * y == n)return true;
  return false;
}
bool comp(pair<int,int> a, pair<int,int> b) {
    if(a.first == b.first) return a.second>b.second;
  return a.first < b.first;
}
 ll powi(ll a, ll b) {
  ll ans = 1;
  while (b > 0) {
    if (b & 1)ans = (ans * a);
    b = b >> 1;
    a = (a * a);
  }
  return ans;
}
bool isprime(ll n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)return false;
  }
  return true;
}
bool prime[10000000];
void seive() {

  prime[1] = true;
  for (int i = 2; i * i < 10000000; i++) {

    if (prime[i])continue;
    for (int j = i * i; j < 10000000; j += i) {
      prime[j] = true;
    }

  }
}
int main()
{
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  ll n,m;
  cin>>n;
  vil v[n+1];
  for(int i=0;i<n-1;i++){
      ll x;cin>>x;
      v[x].pb(i+2);
  }
  for(int i=1;i<n+1;i++){
      cout<<v[i].size()<<endl;
  }
}



  


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

int main(){
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;

    // int ans = 0;
    // if(X >= Y){
    //     if(A + B <= C * 2) ans += (A + B) * Y + A * (X - Y);
    //     else if(A >= C * 2) ans += 2 * C * Y + 2 * C * (X - Y);
    //     else ans += 2 * C * Y + A * (X - Y);
    // }else{
    //     if(A + B <= C * 2) ans += (A + B) * X + A * (Y - X);
    //     else if(B >= C * 2) ans += 2 * C * X + 2 * C * (Y - X);
    //     else ans += 2 * C * X + B * (Y - X);
    // }

    int price_ans = A * X + B * Y;
    for(int i = 0; i <= 100000; i++){
        int price = i * 2 * C + A * max(0, X-i) + B * max(0, Y-i);
        price_ans = min(price_ans, price);
    }

    cout << price_ans << endl;


    return 0;
}

Measured memory_bytes: 256
#pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std; typedef long double ld; typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define MP make_pair
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORR(x,arr) for(auto& x:arr)
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define FI first 
#define SE second
#define ALL(x) (x).begin(), (x).end()
constexpr int INF=1<<30; constexpr ll LINF=1LL<<60; constexpr ll mod=1e9+7; constexpr int NIL = -1;
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#pragma endregion
//-------------------

int main(){
    cin.tie(0); ios::sync_with_stdio(false); //cout << fixed << setprecision(15);
    int n; cin >> n;
    int cnt = 0;
    FOR(i,1,n){
        int a; cin >> a;
        if(a%2==1 and i%2==1)cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3648
def M():return map(int,input().split())
d='URLD'
h,w,n=M()
b=[h,w,w,h]
r,c=M()
o=[h-r+1,c,w-c+1,r]
s=input()
t=[dict(zip(d,d[::-1]))[i] for i in input()]
a=0
for i,j in enumerate(d):
  x=o[i]
  for k in range(n):
    x+=(s[k]==j)
    if x>b[i]:a=1
    if x>1:x-=(t[k]==j)
print('YNEOS'[a::2])

Measured memory_bytes: 63676
m = {"yotta":24, "zetta":21, "exa":18, "peta":15, "tera":12, "giga":9, "mega":6, "kilo":3, "hecto":2, "deca":1, "deci":-1, "centi":-2, "milli":-3, "micro":-6, "nano":-9, "pico":-12, "femto":-15, "ato":-18, "zepto":-21, "yocto":-24}
for _ in range(int(input())):
    v, *b = input().split()
    if len(b) == 2:
        k, b = b[0], b[1]
        a = m[k]
    else:b = b[0];a = 0
    s = 0
    for i in range(len(v)):
        if v[i] in "123456789":
            if i != 0:
                a -= i - 1
                if i != len(v) - 1:v = v[i] + "." + v[i + 1:]
                else:v = v[i]
            else:
                try:
                    j = v[i:].index(".")
                    a += j - 1
                    v = v[0] + "." + v[1:j] + v[j + 1:]
                except:
                    a += len(v) - 1
                    v = v[0] + "." + v[1:]
            break
    print("{} * 10^{} {}".format(v, a, b))


Measured memory_bytes: 5608
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <tuple>
#include <unordered_map>
#include <map>
#include <cmath>

#define endl "\n"
#define eb emplace_back
#define ll long long

using namespace std;

int dp[100001];
int nums[100001];
int n;

int memoization(int ind) {

    if (dp[ind] != -1)
        return dp[ind];

    if (ind >= n-1)
        return 0;

    if (ind >= n-2)
        return dp[ind] = abs(nums[ind] - nums[ind+1]) + memoization(ind+1);

    return dp[ind] = min( abs(nums[ind] - nums[ind+1]) + memoization(ind+1), abs(nums[ind] - nums[ind+2]) + memoization(ind+2));

}

int main() {

    cin.tie(nullptr); cout.tie(nullptr);
    ios_base::sync_with_stdio(false);

    cin >> n;

    fill(dp, dp+n+1, -1);

    for (int i = 0; i < n; i++)
        cin >> nums[i];

    cout << memoization(0);

    return 0;

}

Measured memory_bytes: 7480
loop do
  n = gets.to_i
  break if n == 0
  ary = []
  0.upto(n-1) do |i|
    ary[i] = gets.to_i
  end
  ary.sort!.shift
  ary.pop
  sum = ary.inject { |sum, n| sum + n}
  puts sum / ary.size
end

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

using namespace std;

typedef long long ll;

#ifdef RED
  mt19937 rnd(228);
#else
  mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

const int N = (int)1e6 + 5;

string s;

int main() {
#ifdef RED
  freopen("a.in", "r", stdin);
#endif
  ios_base :: sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (i % 2) {
      if (!(s[i] == 'L' || s[i] == 'U' || s[i] == 'D')) {
        cout << "No";
        return 0;
      }
    }else {
      if (!(s[i] == 'R' || s[i] == 'U' || s[i] == 'D')) {
        cout << "No";
        return 0;
      }
    }
  }
  cout << "Yes";
  return 0;
}


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

int main(){
    int t;
    cin>>t;
    unordered_map<string,int> umap;
    umap["AC"]=0;
    umap["WA"]=0;
    umap["TLE"]=0;
    umap["RE"]=0;
    while(t--){
        string verd;
        cin>>verd;
        umap[verd]++;
    }
    
    cout<<"AC"<<" x "<<umap["AC"]<<endl;
    cout<<"WA"<<" x "<<umap["WA"]<<endl;
    cout<<"TLE"<<" x "<<umap["TLE"]<<endl;
    cout<<"RE"<<" x "<<umap["RE"]<<endl;    
    
}

Measured memory_bytes: 3592
#include <iostream>
using namespace std;
int main() {
  int n,a,b,c,d;
  cin >> n;
  a = n/1000%10;
  b = n/100%10;
  c = n/10%10;
  d = n%10;
  if (b == c) {
    if (b == a || b == d) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl; 
  }
}

Measured memory_bytes: 256
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int d = 0;
		int r = 0;
		double f = 0;
		double double_a = a;
		double double_b = b;

		//処理
		d = a / b;
		r = a % b;
		f = double_a / double_b;

		//fの小数点以下の桁数を指定(5桁)
		BigDecimal x = new BigDecimal(f);
		x = x.setScale(5, BigDecimal.ROUND_HALF_UP);

		//出力
		System.out.println( d + " " + r + " " + x );
		//System.out.print(d + " " + r + " ");
		//System.out.printf("%f\n",f);

	}

}



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

using namespace std;

void solve()
{
    int n;
    string s;
    cin >> n >> s;

    if(s.size() <= n)
        cout << s << '\n';
    else
    {
        s.resize(n);
        cout << s << "...";
    }
}

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

    int t;
    t = 1;

    //cin >> t;

    for(; t; --t)
        solve();
}


Measured memory_bytes: 3652
import java.util.Scanner;	//Scannerクラス：Java標準入力を取得する

class Main{
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
		int n = sc.nextInt();
		int[][][] member = new int[4][3][10];
		int r = 0;
		int f = 0;
		int b = 0;
		int v = 0;

		for(int i = 0;i < n;i++) {
		r = sc.nextInt();
		f = sc.nextInt();
		b = sc.nextInt();
		v = sc.nextInt();
		member[r-1][f-1][b-1] += v;
		}

		for(int j = 0;j < 4;j++) {
			for(int k = 0;k < 3;k++) {
				for(int l = 0;l < 10;l++) {
					System.out.print(" ");
					System.out.print(member[j][k][l]);
				}
				System.out.println();
				if(k == 2 && j < 3)
					System.out.println("####################");
				}
			}
		}
	}
}


Measured memory_bytes: 29512
#include <iostream>
#include <fstream>
#include <algorithm>
//#define LOCAL
using namespace std;
typedef long long ll;
const int mx=1e3+10;
ll num[mx];
int main() {
#ifdef LOCAL
ifstream fin("1.txt");
streambuf*p;
p=cin.rdbuf(fin.rdbuf());
#endif // LOCAL
ll n;
cin>>n;
for(ll i=0;i<n;i++) cin>>num[i];

ll qn;
cin>>qn;
for(ll i=1;i<=qn;i++){
    ll b, e, k;
    cin>>b>>e>>k;
    printf("%d\n", count(num+b, num+e, k));
}


#ifdef LOCAL
fin.close();
#endif // LOCAL
}




Measured memory_bytes: 3232
k=int(input())
if k%2==0:
    print(-1)
else:
    n=7
    cnt=1
    l={}
    while n%k!=0:
        if n not in l:
            l[n]=1
        else:
            print(-1)
            exit()
        n=(n*10+7)%k
        cnt+=1
    print(cnt)

Measured memory_bytes: 92560
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=998244353
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,p=LI()
  s=S()

  ans=0
  if p==2 or p==5:
    for i,x in enumerate(s):
      if int(x)%p==0:
        ans+=i+1
    return ans

  _s=list(s)
  _s.reverse()

  a=[]
  i=1
  for x in _s:
    b=(i*int(x))%p
    a.append(b)
    i*=10
    i%=p

  b=[0]*p
  b[a[0]%p]=1
  for i in range(n-1):
    a[i+1]+=a[i]
    a[i+1]%=p
    b[a[i+1]]+=1

  for i,x in enumerate(b):
    if i==0:
      ans+=x
    if x>1:
      ans+=x*(x-1)//2

  return ans

# main()
print(main())


Measured memory_bytes: 14912
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;

int main(){
  double r, s, l;
  cin >> r;
  s = r * r * M_PI;
  l = 2 * r * M_PI;
  cout << fixed << setprecision(6) << s << " " << l;
  return 0;
}



Measured memory_bytes: 3280
#include <iostream>
#include <fstream>
#include <queue>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
#ifdef LOCAL
    ifstream cin("input.txt");
    ofstream cout("output.txt");
#else
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#endif // LOCAL

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i)
        cin >> a[i];

    vector<int> cnt(n + 1, 0);
    int diam = 0;
    for (int i = 0;i < n; ++i)
    {
        if (a[i] > diam)
            diam = a[i];
        ++cnt[a[i]];
    }
    bool possible = true;
    for (int i = diam / 2 + 1; i <= diam; ++i)
    {
        if (cnt[i] < 2)
            possible = false;
    }
    int top = diam / 2 + diam % 2;
    if (diam % 2 == 0 && cnt[top] != 1)
    {
        possible = false;
    }
    if (diam % 2 == 1 && cnt[top] != 2)
        possible = false;
    for (int i = 0; i < top; ++i)
    {
        if (cnt[i] != 0)
        {
            possible = false;
            break;
        }
    }
    if (possible)
    {
        cout << "Possible\n";
    }
    else
    {
        cout << "Impossible\n";
    }

#ifdef LOCAL
    cin.close();
    cout.close();
#endif // LOCAL
    return 0;
}


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

#define fr(i, n) for (ll i = 0; i < n; i++)
#define fr1(i, n) for (ll i = 1; i <= n; i++)
#define pb(x) push_back(x)
#define l(s) s.size()
#define as(a) sort(a, a + n)
#define ds(a) sort(a, a + n, greater<int>())
#define vas(v) sort(v.begin(), v.end());
#define inf 1e18
#define nl cout << endl;
#define F first
#define S second
typedef vector<ll> vi;
typedef pair<int, int> pi;

int infi = 1000000007;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,x,t;
    cin>>n>>x>>t;

    if(n%x == 0){
        cout<<(n/x)*t;
    }else{
        cout<<((n/x)+1)*t;
    }

    return 0;
}

Measured memory_bytes: 3636
n, m = list(map(int, input().split(' ')))
d = {}
for i in range(n):
  l = list(map(int, input().split(' ')))
  for j in l[1:]:
    d[j] = d.get(j, 0) + 1
ans = 0
for key in d:
  if d[key] == n:
    ans += 1
print(ans)

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            String line1 = reader.readLine();
            int n = Integer.parseInt(line1);
            String line2 = reader.readLine();
            String[] str = line2.split(" ");
            for(int i = n-1;i >= 0;i-- ){
                if(i != 0){
                    System.out.print(str[i] + " ");
                }else{
                    System.out.println(str[i]);
                }
            }
        } catch (IOException e) {
    
        }
    }
   
}


Measured memory_bytes: 24276
#include<bits/stdc++.h>
using namespace std;
const int mxn = 110;
int ar[2][mxn];

int dp[2][mxn];
int n;
int solve(int x , int y)
{
	if(x==1 && y==n-1)
	return ar[x][y];
	if(dp[x][y]!=-1)
	return dp[x][y];
	int tmpx = x+1;
	int tmpy = y+1;
	int ret = INT_MIN;
	if(tmpx < 2)
	ret = max(ret , solve(tmpx , y) + ar[x][y]);
	if(tmpy < n)
	ret = max(ret , solve(x , tmpy)+ar[x][y]);
	return dp[x][y] = ret;
}

int main()
{
	cin>>n;
	for(int i = 0; i < n; i++)
	{
		cin>>ar[0][i];
	}
	for(int i = 0; i < n; i++)
	{
		cin>>ar[1][i];
	}
	memset(dp , -1 , sizeof dp);
	int ret = solve(0 , 0);
	cout<<ret<<endl;
	return 0;
}


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

int main(){
  int n, m;
  cin >> n >> m;
  
  vector<int> a;
  int sum=0;
  for(int i=0; i<n; i++){
    int tmp;
    cin >> tmp;
    a.push_back(tmp);
    sum+=tmp;
  }
  sort(a.begin(),a.end(),greater<int>());
  if(a[m-1]*4*m < sum){
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
    
  return 0;
}

Measured memory_bytes: 256
A = list(input())
B = list(input())
C = list(input())
now = "a"
for i in range(len(A)+len(B)+len(C)):
    if now == "a":
        try:
            now = A[0]
            A.pop(0)
        except IndexError:
            print("A")
            exit()
    elif now == "b":
        try:
            now = B[0]
            B.pop(0)
        except IndexError:
            print("B")
            exit()
    else:
        try:
            now = C[0]
            C.pop(0)
        except IndexError:
            print("C")
            exit()

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <numeric>
//#include<bits/stdc++.h>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);
//ll dx[4] = {1,0,-1,0};
//ll dy[4] = {0,1,0,-1};

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
const ll mod = 1e9 + 7;

int main() {
	string s, t;
	t = "keyence";
	cin >> s;
	bool flag = false;
	rep(i, s.size()) {
		REP(j,i,s.size()+1)
			if (s.substr(0, i) + s.substr(j) == t) flag = true;
	}
	if (flag) cout << "YES\n";
	else cout << "NO\n";
	return 0;
}

Measured memory_bytes: 256
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int M = scanner.nextInt();
    int sum = 0;
    HashMap<Integer, Integer> freq = new HashMap<>();
    freq.put(0, 1);
    for (int i = 0; i < N; i++) {
      sum += scanner.nextInt();
      sum %= M;
      freq.put(sum, freq.getOrDefault(sum, 0) + 1);
    }

    long count = 0;
    for (Map.Entry<Integer, Integer> entry: freq.entrySet()){
      long c = entry.getValue();
      if (c > 1) {
        count += c * (c - 1) / 2;
      }
    }
    System.out.println(count);
  }
}


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

using namespace std;

int main(void)
{
    string S, T;

    cin >> S;
    cin >> T;

    int count = 0;
    for(int i = 0;i < (int)S.size();i++){
        if(S[i] != T[i]) {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3912
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#pragma warning (disable: 4996)

// 入力
long long mod = 1000000007;
long long N, M;
string S;

// その他
long long fib[1 << 19];
long long dp[1 << 19], ru[1 << 19];
long long ret[1 << 19];

long long modpow(long long a, long long b, long long m) {
	long long p = 1, q = a;
	for (int i = 0; i < 32; i++) {
		if ((b / (1LL << i)) % 2 == 1) { p *= q; p %= m; }
		q *= q; q %= m;
	}
	return p;
}

long long Div(long long p, long long q, long long m) {
	return (p * modpow(q, m - 2, m)) % m;
}

long long solve(long long n, long long r) {
	for (int i = 0; i <= N; i++) dp[i] = 0;
	for (int i = 0; i <= N; i++) ru[i] = 0;
	for (int i = 1; i <= r / 2; i++) dp[i] = 1LL * (i * 2);
	for (int i = 1; i <= n / 2; i++) {
		long long v = ru[i - 1]; if (i - (r / 2) - 1 >= 0) v -= ru[i - (r / 2) - 1];
		v = (v + mod) % mod;
		dp[i] += v; dp[i] %= mod;
		ru[i] = (dp[i] + ru[i - 1]) % mod;
	}
	
	long long val = dp[n / 2];
	return val;
}

int main() {
	cin >> N >> M >> S;

	// 判定
	bool flag = false;
	for (int i = 0; i < S.size() - 1; i++) {
		if (S[i] != S[i + 1]) flag = true;
	}

	// 特殊
	if (flag == false) {
		fib[0] = 1;
		fib[1] = 1;
		for (int i = 2; i <= N; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
		cout << (fib[N] + fib[N - 2]) % mod << endl;
		return 0;
	}

	// 奇数
	if (N % 2 == 1) {
		cout << "0" << endl;
		return 0;
	}

	// 偶数
	if (S[0] == 'B') {
		for (int i = 0; i < S.size(); i++) {
			if (S[i] == 'B') S[i] = 'R';
			else S[i] = 'B';
		}
	}
	int MaxLength = N, cur = 0, cnt = 0;
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == 'R') cur++;
		else {
			if (cnt == 0) {
				MaxLength = min(MaxLength, cur);
			}
			else if (cur % 2 == 1) {
				MaxLength = min(MaxLength, cur);
			}
			cur = 0; cnt++;
		}
	}
	MaxLength += 2;

	vector<long long> E;
	for (int i = 1; i <= N / 2; i++) {
		if ((N / 2) % i == 0) E.push_back(i);
	}
	for (int i = E.size() - 1; i >= 0; i--) {
		long long d1 = (N / E[i]);
		long long d2 = MaxLength;
		ret[i] = solve(d1, d2);
		for (int j = i + 1; j < E.size(); j++) {
			if (E[j] % E[i] == 0) { ret[i] -= ret[j]; ret[i] = (ret[i] + mod) % mod; }
		}
	}

	long long FinalAns = 0;
	for (int i = 0; i < E.size(); i++) {
		FinalAns += 1LL * ret[i];
		FinalAns %= mod;
	}
	cout << FinalAns << endl;
	return 0;
}

Measured memory_bytes: 4612
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
    //後ろの方から入れられるかどうかを確認し、できたら他の？は全てaにする
    
    string a,b;
    
    cin >> a>>b;
    
    int la = a.size();
    int lb = b.size();
    int answer = la;
    
    
    
    if (la < lb) {cout << "UNRESTORABLE"; goto Exit2; }
    
    
    else{
        for(int i=0;i<la-lb+1;i++){
            for (int j=0;j<lb;j++){
                if (a[la-lb-i+j] != '?' && a[la-lb-i+j] != b[j]) break;
                if (j==lb-1 && (a[la-lb-i+j] == '?' || a[la-lb-i+j] == b[j]))
                {answer = i; goto Exit1;}
            }
        }
    }
    
    if (answer == la) {cout << "UNRESTORABLE"; goto Exit2; }
    
Exit1: ;
    
    for (int i=0;i<lb;i++){
        a[la-lb-answer+i]=b[i];}
    
    for (int i=0;i<la;i++){
        if (a[i]=='?')  a[i]= 'a';}
    
    
    for (int i=0;i<la;i++){
        cout << a[i];}
    
Exit2:;
    
}

  
     
       

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

using namespace std;

using ll = long long;

template<typename T> using V = std::vector<T>;
using Vi = V<int>;
using VVi = V<V<int>>;
using Vl = V<ll>;
using VVl = V<V<ll>>;
using Vs = V<string>;

template<typename T1, typename T2> using P = std::pair<T1, T2>;
using Pii = P<int, int>;
using Pll = P<ll, ll>;
using Pdd = P<double, double>;

template<typename T1, typename T2> using M = std::map<T1, T2>;
using Mii = M<int, int>;
using Msi = M<string, int>;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define REP2(i,s,e) for(int i=(int)(s);i<(int)(e);++i)
#define RREP(i,s,e) for(int i=(int)(s);i>=(int)(e);--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin(),ie=(c).end();i!=ie;++i)
#define ALL(c) (c).begin(), (c).end()

const double PI = acos(-1);
const ll MOD = 1e9+7;

int n, w, h;
// string s;

int main() {
    while (true) {
        cin >> n >> w >> h;
        if (n == 0 && w == 0 && h == 0) break;

        V<Pii> v = {{w, h}};
        REP(i, n) {
            int p, s; cin >> p >> s; p--;
            int W = v[p].first, H = v[p].second;
            s %= (W+H)*2;
            v.erase(v.begin() + p);

            if (s <= W/2) {
                v.push_back({s, H});
                v.push_back({W-s, H});
            } else if (s <= W) {
                v.push_back({W-s, H});
                v.push_back({s, H});
            } else if (s-W <= H/2) {
                v.push_back({W, s-W});
                v.push_back({W, H-(s-W)});
            } else if (s-W <= H) {
                v.push_back({W, H-(s-W)});
                v.push_back({W, s-W});
            } else if (s-(W+H) <= W/2) {
                v.push_back({s-(W+H), H});
                v.push_back({W-(s-(W+H)), H});
            } else if (s-(W+H) <= W) {
                v.push_back({W-(s-(W+H)), H});
                v.push_back({s-(W+H), H});
            } else if (s-(W+W+H) <= H/2) {
                v.push_back({W, s-(W+W+H)});
                v.push_back({W, H-(s-(W+W+H))});
            } else {
                v.push_back({W, H-(s-(W+W+H))});
                v.push_back({W, s-(W+W+H)});
            }
        }
        Vi res(v.size());
        REP(i, v.size()) {
            res[i] = v[i].first * v[i].second;
        }
        sort(ALL(res));
        REP(i, res.size()) {
            std::cout << res[i];
            if (i != res.size()-1) std::cout << ' ';
            else std::cout << '\n';
        }
    }

    return 0;
}



Measured memory_bytes: 3164
#include <iostream>
#include <string.h>
using namespace std;
int num[200001];
int flag[200001];


int main() {
    long long n;
    long long k;
    int time = 0;
    int temp;
    cin >> n >> k;
    for (int i = 1; i <= n; ++i) {
        cin >> num[i];
    }
    for (int i = 1; i <= n; ++i) {
        flag[i] = 0;
    }
    int location = 1;
    for (int i = 1; i <= k; ++i) {
        location = num[location];
        if (flag[location] == 0) {
            flag[location] = i;
            continue;
        }
        else{
            time = i - flag[location];
            temp = flag[location];
            break;
        }
    }
    if (time != 0) {
        for (int i = 1; i <= (k - temp) % time; ++i)
            location = num[location];
    }
    cout << location << endl;
    return 0;
}

Measured memory_bytes: 5208
A = []
for i in range(3):
    A.extend(input().split())
N = int(input())
b = []
for i in range(N):
    b.append(input())

card = [False] * 9
for selection in b:
    for i, a in enumerate(A):
        if selection == a:
            card[i] = True

# judge
answer = 'No'
# row
if (card[0] and card[1] and card[2]) \
or (card[3] and card[4] and card[5]) \
or (card[6] and card[7] and card[8]):
    answer = 'Yes'
# col
if (card[0] and card[3] and card[6]) \
or (card[1] and card[4] and card[7]) \
or (card[2] and card[5] and card[8]):
    answer = 'Yes'
# cross
if (card[0] and card[4] and card[8]) \
or (card[2] and card[4] and card[6]):
    answer = 'Yes'
print(answer)


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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

int main()
{
	string S;
	cin >> S;
	if (S[0]==S[1]&&S[1]==S[2]) {
		cen;
	}
	else {
		cey;
	}

    return 0;
}



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

int main() {
	int N, ans = 0;
	string S;
	cin >> N >> S;
	for (int i = 0; i < N - 1; ++i) {
		if ("OX" == S.substr(i, 2) || "XO" == S.substr(i, 2)) {
			++ans;
			++i;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3332
/* 
 * Project: AtCoder Beginners Contest 143 B - TAKOYAKI FESTIVAL 2019
 * Author: toms74209200 <https://github.com/toms74209200>
 *
 * Created on 2020/08/15
 * Copyright (c) 2020 toms74209200
 * 
 * This software is released under the MIT License.
 * http://opensource.org/licenses/mit-license.php
 */
#include <cstdio>
#include <cstdint>
#include <cmath>
#include <vector>
using namespace std;

int32_t n;
vector<int32_t> d;

void solve() {

    int32_t sum = 0;
    for (int i=0;i<n;i++) {
        for (int j=i+1;j<n;j++) {
            sum += d[i]*d[j];
        }
    }
    printf("%d\n", sum);

}

int main() {

    scanf("%d", &n);
    for (int i=0;i<n;i++) {
        int32_t tmp;
        scanf("%d", &tmp);
        d.push_back(tmp);
    }

    solve();

}

Measured memory_bytes: 3220
a=[list(map(int,input().split())) for A in range(3)]
n=int(input())

for i in range(n):
  b=int(input())
  for j in range(3):
    for k in range(3):
      if b==a[j][k]:
        a[j][k]=0

if a[0][0]==a[0][1]==a[0][2] or a[1][0]==a[1][1]==a[1][2] or a[2][0]==a[2][1]==a[2][2]\
or a[0][0]==a[1][0]==a[2][0] or a[0][1]==a[1][1]==a[2][1] or a[0][2]==a[1][2]==a[2][2]\
or a[0][0]==a[1][1]==a[2][2] or a[2][0]==a[1][1]==a[0][2]:
  print("Yes")
else:
  print("No")


Measured memory_bytes: 9228
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            int N = S.length();

            long[] sum = new long[1];
            dfs(N - 1, S, sum);

            System.out.println(sum[0]);
        }
    }

    private static void dfs(int index, String s, long[] sum) {
        if (index <= 0) {
            sum[0] += sum(s);
            return;
        }

        dfs(index - 1, s, sum);
        dfs(index - 1, s.substring(0, index) + "+" + s.substring(index), sum);
    }

    private static long sum(String s) {
        long sum = 0;
        for (String split : s.split("\\+")) {
            sum += Long.parseLong(split);
        }
        return sum;
    }

}


Measured memory_bytes: 28300
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    int a,b,c;
    cin>>a>>b>>c;
    int ans=0;
    for(int i=a; i<=b; i++){
        if(i%c==0) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3632
function Main(input) {
  var lines = input.split("\n").filter(v=>v!=='')
  var body = lines.slice(1)

  var n = +lines.slice(0,1)
  var poss = body.map(s=>s.split(' ').map(v=>+v))
  var cache = {}
  var sum = 0

  var diff = (x1,y1,x2,y2) => {
    var v = Math.sqrt(((x1-x2)*(x1-x2)) + ((y1-y2)*(y1-y2)))
    return v
  }

  var f = (past_poss,use_poss) => {
    if(use_poss.length == 0) {
      var d = 0;
      for(var i=1;i<past_poss.length;i++){
        var x = +past_poss[i-1][0]
        var y = +past_poss[i-1][1]
        var _x = +past_poss[i][0]
        var _y = +past_poss[i][1]
        sum += diff(x,y,_x,_y)
      }
      return
    }
    use_poss.forEach(_pos=>{
      //sum += diff(x,y,_x,_y)
      f([...past_poss,_pos],use_poss.filter(__pos=>__pos.toString() != _pos.toString()))
    })
  }
  poss.forEach(_pos=>{
    f([_pos],poss.filter(__pos=>__pos.toString() != _pos.toString()))
  })
  var b = 1
  for(;n>0;n--){
    b *=  n
  }
  console.log(sum/b)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 33764
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define All(V) v.begin(), v.end()
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD = 1e9+7, INF = 1e9;

vector<vector<pair<int, int>>> v;
int main()
{
  ll a, b, c; cin >> a >> b >> c;
  ll d = c-a-b;
  if(d > 0 && 4*a*b < d*d){
    cout << "Yes" << endl;
  }else cout << "No" << endl;
  system("pause");
}

Measured memory_bytes: 504
/* AtCoder Beginner Contest 060. Task B - Choose Integers, by Abreto <m@abreto.net>. */
#include <stdio.h>

int gcd(int m, int n)
{
    return (0==n)?m:gcd(n,m%n);
}

int main(void)
{
    int A = 0, B = 0, C = 0;
    int ok = 0;

    scanf("%d %d %d", &A, &B, &C);
    ok = C % gcd(A,B);

    printf("%s\n", ok?"NO":"YES");
    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

double area(double ax,double ay,double bx,double by,double cx,double cy)
{
  double l1,l2,l3;

  l1=sqrt( (ax-bx)*(ax-bx)+(ay-by)*(ay-by) );
  l2=sqrt( (bx-cx)*(bx-cx)+(by-cy)*(by-cy) );
  l3=sqrt( (cx-ax)*(cx-ax)+(cy-ay)*(cy-ay) );

  double s=(l1+l2+l3)/2;
  return sqrt( s*(s-l1)*(s-l2)*(s-l3) );
}

int main()
{
  double len[20][2]={};
  int n=0;

  while(scanf("%lf,%lf",&len[n][0],&len[n][1])!=EOF)
    n++;
  double sum=0;

  int i,j,k;
  for(i=2;i<n;i++)
    sum+=area(len[0][0],len[0][1],len[i-1][0],len[i-1][1],len[i][0],len[i][1]);
  cout<<sum<<endl;

}

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

#define ll long long
#define all(x) (x).begin(), (x).end()
const long long INF = 1LL << 60;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //(i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

int main() {
    // cin.tie(0);
    // ios::sync_with_stdio(false);
    // cout << fixed << setprecision(5);

    // 入力
    string s;
    cin >> s;

    // 処理
    s[5]  = ' ';
    s[13] = ' ';
    // 出力
    cout << s << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
int max;

Node root,NIL;

/*Node treeMinimum(Node x){


}

Node treeMaximum(Node x){


}

Node treeSearch(Node u, int k){


}

Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}*/

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;
  int H;
  
  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key){
      x = x->left;
    }
    else{
      x = x->right;
    }
  }

  z->parent = y;

  if( y == NIL){
    root = z;
  }
  else{
    if(z->key < y->key){
      y->left = z;
    }
    else{
      y->right = z;
    }
  }
}





void inorder( Node u){
  if( u == NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder( Node u){
  if(u == NIL)return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
 }


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);
  max = 0;
  for(i = 0; i < n; i++){
    scanf("%s",com);
    if( strcmp(com, "insert") == 0){
      scanf("%d",&x);
      insert(x);
    }
    else if( strcmp(com, "print") == 0){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }
  /* for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));*/
  

  return 0;
}



Measured memory_bytes: 25116
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S, T;
  cin >> S >> T;
  int count=0;
  REP(i,3) {
    if(S[i]==T[i]) count++;
  }
  cout << count << endl;
}

Measured memory_bytes: 256