output_description
stringlengths
15
956
submission_id
stringlengths
10
10
status
stringclasses
3 values
problem_id
stringlengths
6
6
input_description
stringlengths
9
2.55k
attempt
stringlengths
1
13.7k
problem_description
stringlengths
7
5.24k
samples
stringlengths
2
2.72k
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s367991188
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
import sys input=sys.stdin.readline from bisect import bisect_left, bisect_right Q=int(input()) llr=[] maxr=1 for i in range(Q): l,r=map(int,input().split()) if r>maxr: maxr=r llr.append([l,r]) def isprime(n): if n==1: return 0 m=int(n**(1/2)) for i in range(2,m+1): if n%i==0: return 0 break return 1 l2017=[] for i in range(1,maxr+1,2): if isprime(i) and isprime((i+1)/2): l2017.append(i) for i in range(Q): il=bisect_left(l2017,llr[i][0]) ir=bisect_right(l2017,llr[i][1]) print(ir-il
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s475007654
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
import sys input=sys.stdin.readline from bisect import bisect_left, bisect_right Q=int(input()) llr=[] maxr=1 for i in range(Q): l,r=map(int,input().split()) if r>maxr: maxr=r llr.append([l,r]) def isprime(n): m=int(n**(1/2)) for i in range(2,m+1): if n%i==0: return 0 break return 1 l2017=[] for i in range(3,maxr+1,2): if isprime(i) and isprime((i+1)/2): l2017.append(i) for i in range(Q): il=bisect_left(l2017,llr[i][0]) ir=bisect_right(l2017,llr[i][1]) print(ir-il
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s258804539
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
q = int(input()) l = [] r = [] for i in range(q): x,y = map(int,input().split()) l += [x] r += [y] def is_2017(x): if x % 2 == 0: return False return is_p[x] && is_p[(x+1)//2] def is_prime(x): if x == 1: return False i = 2 while i * i <= x: if x % i == 0: return False return True is_p = [False] * 100000 n_2017 = [0] * 100000 for i in range(1, 100000): is_p[i] = is_prime(i) for i in range(1, 100000): if is_p[i]: n_2017[i] = n_2017[i-1] + 1 for i in range(q): print(n_2017[r]-n_2017[l-1])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s000094083
Accepted
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
# -*- coding: utf-8 -*- import sys from itertools import accumulate def input(): return sys.stdin.readline().strip() def list2d(a, b, c): return [[c] * b for i in range(a)] def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)] def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)] def ceil(x, y=1): return int(-(-x // y)) def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)] def Yes(): print("Yes") def No(): print("No") def YES(): print("YES") def NO(): print("NO") sys.setrecursionlimit(10**9) INF = float("inf") MOD = 10**9 + 7 def eratosthenes_sieve(n): """素数列挙(エラトステネスの篩)""" table = [0] * (n + 1) prime_list = [] for i in range(2, n + 1): if table[i] == 0: prime_list.append(i) for j in range(i + i, n + 1, i): table[j] = 1 return prime_list N = 100000 primes = set(eratosthenes_sieve(N + 1)) A = [0] * (N + 1) for a in range(1, N + 1, 2): if a in primes and (a + 1) // 2 in primes: A[a] = 1 acc = [0] + list(accumulate(A)) for i in range(INT()): l, r = MAP() ans = acc[r + 1] - acc[l] print(ans)
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s317228050
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
q = int(input()) l, r = [0] * q, [0] * q for i in range(q): l[i], r[i] = map(int, input().split()) mini = min(min(l), min(r)) maxi = max(max(l), max(r)) ans = [0] * (maxi + 1) prime = [0] * (maxi + 1) def judge_prime(n): for i in range(2, int(n ** 0.5) + 1): if n % i == 0: return False return True if n != 1 else False for i in range((mini + 1) // 2, maxi + 1): prime[i] = judge_prime(i) for i in range(mini, maxi + 1, 2): ans[i] = ans[i - 2] + 1 if prime[i] and prime[(i + 1) // 2] else ans[i - 2 for i in range(q): print(ans[r[i]] - ans[max(0, l[i] - 2)])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s368850149
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
import math def eratosthenes(n): prime_list = [] num_list=[i for i in range(2, n+1)] limit = math.sqrt(n) while True: if limit <= num_list[0]: return prime_list + num_list prime_list.append(num_list[0]) num_list = [e for e in num_list if e % num_list[0] != 0] Q = int(input()) for i in range(Q): l, r = input().split() l = int(l) R = eratosthenes(int(r)) row = [] for j in R: if j in R and j >= l: row.append(j) cnt = 0 for k in row: if (k + 1) / 2 in R: cnt+=1 print(cnt)
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s907156569
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
Q = int(input()) judge_arr = [] data = [] max_number = 0 for i in range(Q): x = input().split() data.append([int(x[0]),int(x[1])]) if max_number<data[i][1]: max_number = data[i][1] prime_arr = [2] for i in range(3,max_number,2): c = 0 for j in prime_arr: if j>i**0.5 or i%j!=0: break elif i%j==0: c = 1 if c==0: if (i+1)/2 in prime_arr prime_arr.append(i) judge_arr.append(1) else: prime_arr.append(i) judge_arr.append(0) #for n in range(len(prime_arr)): #if (prime_arr[n]+1)/2 in prime_arr: #judge_arr[n] = 1 def sumz(a,b): x = 0 y = 0 for n in range(len(prime_arr)): if prime_arr[n]<a: x = n if prime_arr[n]>b: y = n break return sum(judge_arr[x+1:y])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s840608786
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
#include <cstring> #include <iostream> #include <vector> using namespace std; class Prime { // n以下の素数を列挙する public: const int n; vector<bool> is_prime; vector<int> primes; Prime(int size) : n(size), is_prime(n, true) { is_prime[0] = false; is_prime[1] = false; for (int i = 2; i <= n; ++i) { if (!is_prime[i]) continue; primes.push_back(i); int tmp = 2*i; while (tmp <= n) { is_prime[tmp] = false; tmp += i; } } } bool check(int x) { return is_prime[x]; } }; int dp[100001]; int main() { memset(dp, 0, sizeof(dp)); Prime prime(100001); for (int i = 1; i <= 100000; ++i) { dp[i] = dp[i-1]; if (i % 2 == 0) continue; if (!prime.check(i)) continue; if (!prime.check((i+1)/2)) continue; dp[i] += 1; } int q; cin >> q; for (int i = 0; i < q; ++i) { int l, r; cin >> l >> r; cout << dp[r] - dp[l-1] << endl; } }
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s654889635
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
import math Q = int(input())#numの数の個数 Query = [] maxn=0 for _ in range(Q): l,r = map(int,input().split()) Query.append((l,r)) maxn = max(maxn,r) N = maxn num = [0]*(N+2)#部分和を計算したい数列 def souwa(left,right,ruisekiwa):#0based,numの[left,right)間の総和を計算 return ruisekiwa[right]-ruisekiwa[left] def using_sqrt(N):#入力 対象の整数,出力,素数ならば1,合成数ならば1 flag = 0 for i in range(2,math.floor(math.sqrt(N))+1): if N % i == 0: flag = 1 break else: continue if flag == 1: return 0 else: return 1 for i in range(1,N+2,2): if using_sqrt(i)==1 and using_sqrt((i+1)//2)==1: num[i] = 1 ruisekiwa = [0]*(N+2) ruisekiwa[0] = 0 num[1] =0 for i in range(1,N+2):#累積和の前処理 ruisekiwa[i]=num[i-1]+ruisekiwa[i-1] for q in Query: print(souwa(q[0],q[1]+1,ruisekiwa)
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s636533461
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
#include <iostream> #include <fstream> #include <cstdio> #include <cmath> #include <vector> #include <cstring> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <algorithm> #include <climits> using namespace std; #define REP(i,n) for(int i=0; i<n; ++i) #define FOR(i,a,b) for(int i=a; i<=b; ++i) #define FORR(i,a,b) for (int i=a; i>=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector<int> VI; typedef vector<ll> VL; const int N_MAX = 100001; VI prime; void generate_prime() { prime.push_back(2); FOR(i, 3, N_MAX) { for(auto p : prime) { if(i % p == 0) break; if(p > sqrt(i)) { prime.push_back(i); break; } } } } int main(){ cin.tie(0); ios::sync_with_stdio(false); generate_prime(); set<int> prime1(ALL(prime)); set<int> prime2; for(auto& p : prime1) { if(p == 2) continue; if(prime1.count((p + 1) / 2) == 1) prime2.insert(p); } VI ans(N_MAX); ans[0] = 0; FOR(i, 1, N_MAX - 1) { if(prime2.count(i) == 1) ans[i] = ans[i - 1] + 1; else ans[i] = ans[i - 1]; } int q; cin >> q; REP(i, q) { int l, r; cin >> l >> r; cout << ans[r] - ans[l - 1] << '\n'; } return 0; }
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s235062527
Wrong Answer
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
print("1") print("0") print("0") print("1")
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s239452252
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
import gmpy2 n = int(input()) s = [[0] for i in range(100000)]
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s502792109
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
q = int(input()) a = [list(int(i) for i in input().split()) for i in range(q)] MAX = 10**5 is_prime = [1]*MAX for i in range(2, MAX): if not is_prime[i]: continue for j in range(i*2, MAX, i): is_prime[j] = 0 s = [0]*MAX for i in range(3,MAX): s[i] = s[i-1] + 1 if is_prime[i] and is_prime[(i+1)//2] for i in range(q): l,r = a[i] print(s[r]-s[l-1])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s254804179
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
def main(): cache = set() primes = {2} def isprime(n): if n in primes: return True for i in range(3, math.sqrt(n)+1, 2): if n % i == 0: return False primes[n] = True return True Q = int(input()) for i in range(Q): l, r = map(int, input().split()) cnt = 0 if l % 4 == 3: l += 2 for n in range(l, r+1, 4): m = (n - 1) // 2 assert n % 4 == 1 if isprime(m+1) and isprime(n) cnt += 1 print(cnt) main()
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s406386040
Runtime Error
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
q = int(input()) l, r = [0]*q, [0]*q for i in range(q): l[i], r[i] = map(int, input().split()) MAX = 101010 is_prime = [1]*MAX is_prime[0] = 0 is_prime[1] = 0 for i in range(2,MAX): if not is_prime[i]: continue for j in range(i*2, MAX, i): is_prime[j] = 0 a = [0]*MAX for i in range(MAX,,2): # ,,2 # if i%2 == 0: # continue if is_prime[i] and is_prime[(i+1)//2]: a[i] = 1 s = [0]*(MAX+1) for i in range(MAX): s[i+1] = s[i] + a[i] for i in range(q): print(s[r[i]+1]-s[l[i]])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s120764407
Accepted
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
q = int(input()) a = [[int(i) for i in input().split()] for i in range(q)] prime = [True] * 100000 prime[0], prime[1] = False, False for i in range(2, 317): if not prime[i]: continue for j in range(i * 2, 100000, i): prime[j] = False y = [0] for i in range(3, 10**5, 2): if prime[i] and prime[(i + 1) // 2]: y.append(y[-1] + 1) else: y.append(y[-1]) for i in a: print(y[(i[1] - 1) // 2] - y[max((i[0] - 3) // 2, 0)])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s622932354
Accepted
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
import sys input_methods = ["clipboard", "file", "key"] using_method = 0 input_method = input_methods[using_method] tin = lambda: map(int, input().split()) lin = lambda: list(tin()) mod = 1000000007 # +++++ def main(): pp = [1] * (10**5 + 1) pp[0] = 0 pp[1] = 0 for i, _ in enumerate(pp): if pp[i] == 0: continue st = i while st * i < len(pp): pp[st * i] = 0 st += 1 like = pp[:] like[2] = 0 for i, v in enumerate(pp): if v == 1 and i != 2 and pp[(i + 1) // 2] == 0: like[i] = 0 ss = [0] * len(pp) for i, v in enumerate(ss[:-1]): ss[i + 1] = like[i + 1] + ss[i] # pa(like[:10]) q = int(input()) # b , c = tin() # s = input() for _ in range(q): l, r = tin() print(ss[r] - ss[l - 1]) # +++++ isTest = False def pa(v): if isTest: print(v) def input_clipboard(): import clipboard input_text = clipboard.get() input_l = input_text.splitlines() for l in input_l: yield l if __name__ == "__main__": if sys.platform == "ios": if input_method == input_methods[0]: ic = input_clipboard() input = lambda: ic.__next__() elif input_method == input_methods[1]: sys.stdin = open("inputFile.txt") else: pass isTest = True else: pass # input = sys.stdin.readline ret = main() if ret is not None: print(ret)
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s674893960
Accepted
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math # from math import gcd import bisect from collections import defaultdict from collections import deque from functools import lru_cache ############# # Constants # ############# MOD = 10**9 + 7 INF = float("inf") ############# # Functions # ############# ######INPUT###### def I(): return int(input().strip()) def S(): return input().strip() def IL(): return list(map(int, input().split())) def SL(): return list(map(str, input().split())) def ILs(n): return list(int(input()) for _ in range(n)) def SLs(n): return list(input().strip() for _ in range(n)) def ILL(n): return [list(map(int, input().split())) for _ in range(n)] def SLL(n): return [list(map(str, input().split())) for _ in range(n)] ######OUTPUT###### def P(arg): print(arg) return def Y(): print("Yes") return def N(): print("No") return def E(): exit() def PE(arg): print(arg) exit() def YE(): print("Yes") exit() def NE(): print("No") exit() #####Shorten##### def DD(arg): return defaultdict(arg) #####Inverse##### def inv(n): return pow(n, MOD - 2, MOD) ######Combination###### kaijo_memo = [] def kaijo(n): if len(kaijo_memo) > n: return kaijo_memo[n] if len(kaijo_memo) == 0: kaijo_memo.append(1) while len(kaijo_memo) <= n: kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD) return kaijo_memo[n] gyaku_kaijo_memo = [] def gyaku_kaijo(n): if len(gyaku_kaijo_memo) > n: return gyaku_kaijo_memo[n] if len(gyaku_kaijo_memo) == 0: gyaku_kaijo_memo.append(1) while len(gyaku_kaijo_memo) <= n: gyaku_kaijo_memo.append( gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD ) return gyaku_kaijo_memo[n] def nCr(n, r): if n == r: return 1 if n < r or r < 0: return 0 ret = 1 ret = ret * kaijo(n) % MOD ret = ret * gyaku_kaijo(r) % MOD ret = ret * gyaku_kaijo(n - r) % MOD return ret ######Factorization###### def factorization(n): arr = [] temp = n for i in range(2, int(-(-(n**0.5) // 1)) + 1): if temp % i == 0: cnt = 0 while temp % i == 0: cnt += 1 temp //= i arr.append([i, cnt]) if temp != 1: arr.append([temp, 1]) if arr == []: arr.append([n, 1]) return arr #####MakeDivisors###### def make_divisors(n): divisors = [] for i in range(1, int(n**0.5) + 1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n // i) return divisors #####MakePrimes###### def make_primes(N): max = int(math.sqrt(N)) seachList = [i for i in range(2, N + 1)] primeNum = [] while seachList[0] <= max: primeNum.append(seachList[0]) tmp = seachList[0] seachList = [i for i in seachList if i % tmp != 0] primeNum.extend(seachList) return primeNum #####GCD##### def gcd(a, b): while b: a, b = b, a % b return a #####LCM##### def lcm(a, b): return a * b // gcd(a, b) #####BitCount##### def count_bit(n): count = 0 while n: n &= n - 1 count += 1 return count #####ChangeBase##### def base_10_to_n(X, n): if X // n: return base_10_to_n(X // n, n) + [X % n] return [X % n] def base_n_to_10(X, n): return sum(int(str(X)[-i - 1]) * n**i for i in range(len(str(X)))) #####IntLog##### def int_log(n, a): count = 0 while n >= a: n //= a count += 1 return count ############# # Main Code # ############# def make_primes(N): max = int(math.sqrt(N)) seachList = [i for i in range(2, N + 1)] primes = [] while seachList[0] <= max: primes.append(seachList[0]) tmp = seachList[0] seachList = [i for i in seachList if i % tmp != 0] primes.extend(seachList) return primes P = make_primes(100000)[1:] like = [] for p in P: if len(factorization((p + 1) // 2)) == 1 and factorization((p + 1) // 2)[0][1] == 1: like.append(p) imosu = [0 for i in range(101000)] for i in like: imosu[i] += 1 imosu[i + 1] -= 1 ans = [0] for i in imosu: ans.append(ans[-1] + i) ruiseki = [0] for i in ans: ruiseki.append(ruiseki[-1] + i) Q = I() for _ in range(Q): l, r = IL() print(ruiseki[r + 2] - ruiseki[l + 1])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s119550585
Wrong Answer
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
is_Prime = [True] * (10**5 + 1) is_Prime[0] = False is_Prime[1] = False for i in range(2, int((10**5 + 1) ** 0.5) + 1): for j in range(2 * i, 10**5 + 1, i): is_Prime[j] = False P = [i for i in range(10**5 + 1) if is_Prime[i] and is_Prime[(i + 1) // 2]] odd = [0 for i in range(10**5 + 1)] odd[0] = 0 for i in range(0, len(odd) - 1): odd[i + 1] = odd[i] if i in P: odd[i + 1] += 1 Q = int(input()) for q in range(Q): l, r = map(int, input().split()) if l != r: print(odd[r] - odd[l]) else: if l in P: print(1) else: print(0)
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s526121801
Accepted
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
from itertools import takewhile """ 演算子は要素とセットでモノイドを形成するようなものでなければならない。 すなわち、結合律が成り立ち単位元が存在する必要がある。 equalityはsetを高速化するために使う。めんどい場合はNoneにしてもOK """ class SegmentTree: @classmethod def all_identity(cls, operator, equality, identity, size): return cls( operator, equality, identity, [identity] * (2 << (size - 1).bit_length()) ) @classmethod def from_initial_data(cls, operator, equality, identity, data): size = 1 << (len(data) - 1).bit_length() temp = [identity] * (2 * size) temp[size : size + len(data)] = data data = temp for i in reversed(range(size)): data[i] = operator(data[2 * i], data[2 * i + 1]) return cls(operator, equality, identity, data) # これ使わずファクトリーメソッド使いましょうね def __init__(self, operator, equality, identity, data): if equality is None: equality = lambda a, b: False self.op = operator self.eq = equality self.id = identity self.data = data self.size = len(data) // 2 def _interval(self, a, b): a += self.size b += self.size ra = self.id rb = self.id data = self.data op = self.op while a < b: if a & 1: ra = op(ra, data[a]) a += 1 if b & 1: b -= 1 rb = op(data[b], rb) a >>= 1 b >>= 1 return op(ra, rb) def __getitem__(self, i): if isinstance(i, slice): return self._interval( 0 if i.start is None else i.start, self.size if i.stop is None else i.stop, ) elif isinstance(i, int): return self.data[i + self.size] def __setitem__(self, i, v): i += self.size data = self.data op = self.op eq = self.eq while i and not eq(data[i], v): data[i] = v v = op(data[i ^ 1], v) if i & 1 else op(v, data[i ^ 1]) i >>= 1 def __iter__(self): return self.data[self.size :] # 素数生成器 def generate_primes(): from collections import defaultdict from itertools import count D = defaultdict(list) q = 2 for q in count(2): if q in D: for p in D[q]: D[p + q].append(p) del D[q] else: yield q D[q * q].append(q) from operator import add, eq Q = int(input()) Q = [tuple(map(int, input().split())) for _ in range(Q)] m = max(r for l, r in Q) primes = set(takewhile(lambda x: x <= m, generate_primes())) primes.remove(2) A = [0] * (m + 1) for p in primes: if (p + 1) // 2 in primes: A[p] = 1 A[3] = 1 T = SegmentTree.from_initial_data(add, eq, 0, A) for l, r in Q: print(T[l : r + 1])
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s029739973
Wrong Answer
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
def eratosthenes(N): prime = [] a = list(range(2, N + 1)) end = N**0.5 while len(a) and a[0] <= end: nn = a.pop(0) prime.append(nn) a = [i for i in a if i % nn != 0] prime += a return prime def binsearch_lb(lst, lb): """lb以上の最小のインデックス""" li = 0 ri = len(lst) - 1 if lst[li] >= lb: return 0 if lst[ri] < lb: return -1 while li + 1 < ri: tgt = (li + ri) // 2 if lst[tgt] < lb: li = tgt else: ri = tgt return ri def binsearch_ub(lst, ub): """ub以下の最大のインデックス""" li = 0 ri = len(lst) - 1 if lst[li] > ub: return -1 if lst[ri] <= ub: return ri while li + 1 < ri: tgt = (li + ri) // 2 if lst[tgt] > ub: ri = tgt else: li = tgt return li N = int(input().strip()) primes = sorted(eratosthenes(int(1e5))) p_set = set(primes) primes2 = [] for p in primes: # MlogM if (p + 1) // 2 in p_set: primes2.append(p) for i in range(N): # N l, r = map(int, input().split()) li = binsearch_lb(primes2, l) # l以上のインデックス logM ri = binsearch_ub(primes2, r) # r以下のインデックス print(ri - li + 1)
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
Print Q lines. The i-th line (1≤i≤Q) should contain the response to the i-th query. * * *
s541663178
Wrong Answer
p03476
Input is given from Standard Input in the following format: Q l_1 r_1 : l_Q r_Q
p, q, r = [2], [3], [] for k in range(3, 100000): flag = True for t in p: if t * t > k: break if k % t == 0: flag = False if flag: p.append(k) if (k + 1) // 2 in p: q.append(k) k += 2 q.append(100000 + 3) k = 0 for i in range(50000): while q[k] <= 2 * i + 1: k += 1 r.append(k) c = int(input()) while c > 0: x, y = map(int, input().split()) print(r[y // 2] - r[max(x, 3) // 2 - 1]) c -= 1
Statement We say that a odd number N is _similar to 2017_ when both N and (N+1)/2 are prime. You are given Q queries. In the i-th query, given two odd numbers l_i and r_i, find the number of odd numbers x similar to 2017 such that l_i ≤ x ≤ r_i.
[{"input": "1\n 3 7", "output": "2\n \n\n * 3 is similar to 2017, since both 3 and (3+1)/2=2 are prime.\n * 5 is similar to 2017, since both 5 and (5+1)/2=3 are prime.\n * 7 is not similar to 2017, since (7+1)/2=4 is not prime, although 7 is prime.\n\nThus, the response to the first query should be 2.\n\n* * *"}, {"input": "4\n 13 13\n 7 11\n 7 11\n 2017 2017", "output": "1\n 0\n 0\n 1\n \n\nNote that 2017 is also similar to 2017.\n\n* * *"}, {"input": "6\n 1 53\n 13 91\n 37 55\n 19 51\n 73 91\n 13 49", "output": "4\n 4\n 1\n 1\n 1\n 2"}]
If there is no sequence satisfying the conditions, print `-1`. Otherwise, print the lexicographically smallest sequence satisfying the conditions. * * *
s794772850
Wrong Answer
p02637
Input is given from Standard Input in the following format: K a_1 a_2 \dots a_K
import numpy as np K = input() counts = np.array(list(map(int, input().split()))) def subtract_count(counts: np.ndarray): if counts.max() == 1: block = np.ones_like(counts) else: block = (counts == counts.max()).astype(int) + 1 return counts - block, block def block_to_str(block): arange = np.arange(1, len(block) + 1) if block.max() == 1: return " ".join(map(str, arange)) twice = list(arange[block == block.max()]) once = list(arange[block != block.max()]) return " ".join(map(str, twice + once + twice)) def greedy_solution(counts): blocks = [] while counts.max() > 0: counts, block = subtract_count(counts) blocks.append(block) # print(blocks, counts) if counts.min() < 0: return -1 sorted_strs = sorted([block_to_str(block) for block in blocks]) return " ".join(sorted_strs) def solution(counts): candidates = [] candidates.append(greedy_solution(counts)) alt = np.ones_like(counts) alt[0] = 2 alts = [alt] for alt in alts: alt = np.array(alt) sol = greedy_solution(counts - alt) if sol == -1: continue candidates.append(block_to_str(alt) + " " + sol) return sorted(candidates)[0] print(solution(counts))
Statement Given are an integer K and integers a_1,\dots, a_K. Determine whether a sequence P satisfying below exists. If it exists, find the lexicographically smallest such sequence. * Every term in P is an integer between 1 and K (inclusive). * For each i=1,\dots, K, P contains a_i occurrences of i. * For each term in P, there is a contiguous subsequence of length K that contains that term and is a permutation of 1,\dots, K.
[{"input": "3\n 2 4 3", "output": "2 1 3 2 2 3 1 2 3 \n \n\nFor example, the fifth term, which is 2, is in the subsequence (2, 3, 1)\ncomposed of the fifth, sixth, and seventh terms.\n\n* * *"}, {"input": "4\n 3 2 3 2", "output": "1 2 3 4 1 3 1 2 4 3 \n \n\n* * *"}, {"input": "5\n 3 1 4 1 5", "output": "-1"}]
Print C in a line.
s922030843
Accepted
p02267
In the first line _n_ is given. In the second line, _n_ integers are given. In the third line _q_ is given. Then, in the fourth line, _q_ integers are given.
n_count = int(input()) n = set(map(int, input().split())) q_count = int(input()) q = list(map(int, input().split())) n_and_q = 0 for i in q: if i in n: n_and_q += 1 print(n_and_q)
Search I You are given a sequence of _n_ integers S and a sequence of different _q_ integers T. Write a program which outputs C, the number of integers in T which are also in the set S.
[{"input": "5\n 1 2 3 4 5\n 3\n 3 4 1", "output": "3"}, {"input": "3\n 3 1 2\n 1\n 5", "output": "0"}, {"input": "5\n 1 1 2 2 3\n 2\n 1 2", "output": "2"}]
Print C in a line.
s780397035
Wrong Answer
p02267
In the first line _n_ is given. In the second line, _n_ integers are given. In the third line _q_ is given. Then, in the fourth line, _q_ integers are given.
n = int(input()) S = input().split(" ") q = int(input()) T = input().split(" ") def equal_element(S, T): m = 0 for i in range(len(T)): for j in range(len(S)): if S[j] == T[i]: m += 1 return m print(equal_element(S, T))
Search I You are given a sequence of _n_ integers S and a sequence of different _q_ integers T. Write a program which outputs C, the number of integers in T which are also in the set S.
[{"input": "5\n 1 2 3 4 5\n 3\n 3 4 1", "output": "3"}, {"input": "3\n 3 1 2\n 1\n 5", "output": "0"}, {"input": "5\n 1 1 2 2 3\n 2\n 1 2", "output": "2"}]
Print C in a line.
s447117097
Accepted
p02267
In the first line _n_ is given. In the second line, _n_ integers are given. In the third line _q_ is given. Then, in the fourth line, _q_ integers are given.
_, S = input(), input().split() _, T = input(), input().split() print(sum(t in S for t in T))
Search I You are given a sequence of _n_ integers S and a sequence of different _q_ integers T. Write a program which outputs C, the number of integers in T which are also in the set S.
[{"input": "5\n 1 2 3 4 5\n 3\n 3 4 1", "output": "3"}, {"input": "3\n 3 1 2\n 1\n 5", "output": "0"}, {"input": "5\n 1 1 2 2 3\n 2\n 1 2", "output": "2"}]
Print C in a line.
s651007226
Accepted
p02267
In the first line _n_ is given. In the second line, _n_ integers are given. In the third line _q_ is given. Then, in the fourth line, _q_ integers are given.
n, s, q, t = ( input(), set(map(int, input().split())), input(), set(map(int, input().split())), ) print(sum(i in s for i in t))
Search I You are given a sequence of _n_ integers S and a sequence of different _q_ integers T. Write a program which outputs C, the number of integers in T which are also in the set S.
[{"input": "5\n 1 2 3 4 5\n 3\n 3 4 1", "output": "3"}, {"input": "3\n 3 1 2\n 1\n 5", "output": "0"}, {"input": "5\n 1 1 2 2 3\n 2\n 1 2", "output": "2"}]
Print values of nodes in the max-heap in order of their id (from $1$ to $H$). _Print a single space character before each value._
s917358820
Accepted
p02288
In the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).
class MaxHeap: def __init__(self): self.heap = [] self.length = 0 def __str__(self): return " " + " ".join(str(n) for n in self.heap) def up_insert(self, key): self.heap.append(key) self._upheap() self.length += 1 def down_insert(self, key): self.heap.append(key) self.length += 1 for i in range(self.length // 2, -1, -1): self._downheap(i) def down_many_insert(self, key): self.heap.extend(key) self.length += len(key) for i in range(self.length // 2, -1, -1): self._downheap(i) def _upheap(self): index = self.length - 1 while True: parent_index = (index - 1) // 2 if parent_index < 0 or self.heap[parent_index] >= self.heap[index]: break self.heap[parent_index], self.heap[index] = ( self.heap[index], self.heap[parent_index], ) index = parent_index def _downheap(self, index): while True: child_index_left, child_index_right = index * 2 + 1, index * 2 + 2 # print(index, child_index_left, child_index_right) if child_index_left >= self.length: break elif ( child_index_right >= self.length or self.heap[child_index_left] > self.heap[child_index_right] ) and self.heap[index] < self.heap[child_index_left]: self.heap[index], self.heap[child_index_left] = ( self.heap[child_index_left], self.heap[index], ) index = child_index_left elif ( child_index_right < self.length and self.heap[child_index_left] < self.heap[child_index_right] ) and self.heap[index] < self.heap[child_index_right]: self.heap[index], self.heap[child_index_right] = ( self.heap[child_index_right], self.heap[index], ) index = child_index_right else: break a = MaxHeap() length = int(input()) t = [int(n) for n in input().split(" ")] a.down_many_insert(t) print(a)
Maximum Heap A binary heap which satisfies max-heap property is called max-heap. In a max- heap, for every node $i$ other than the root, $A[i] \leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself. Here is an example of a max-heap. ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ALDS1_9_B_1) Write a program which reads an array and constructs a max-heap from the array based on the following pseudo code. $maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap. 1 maxHeapify(A, i) 2 l = left(i) 3 r = right(i) 4 // select the node which has the maximum value 5 if l ≤ H and A[l] > A[i] 6 largest = l 7 else 8 largest = i 9 if r ≤ H and A[r] > A[largest] 10 largest = r 11 12 if largest ≠ i // value of children is larger than that of i 13 swap A[i] and A[largest] 14 maxHeapify(A, largest) // call recursively The following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner. 1 buildMaxHeap(A) 2 for i = H/2 downto 1 3 maxHeapify(A, i)
[{"input": "10\n 4 1 3 2 16 9 10 14 8 7", "output": "16 14 10 8 7 9 3 2 4 1"}]
Print values of nodes in the max-heap in order of their id (from $1$ to $H$). _Print a single space character before each value._
s649617927
Accepted
p02288
In the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).
import heapq N = input() H = [-x for x in map(int, input().split())] heapq.heapify(H) print("", *[-x for x in H])
Maximum Heap A binary heap which satisfies max-heap property is called max-heap. In a max- heap, for every node $i$ other than the root, $A[i] \leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself. Here is an example of a max-heap. ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ALDS1_9_B_1) Write a program which reads an array and constructs a max-heap from the array based on the following pseudo code. $maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap. 1 maxHeapify(A, i) 2 l = left(i) 3 r = right(i) 4 // select the node which has the maximum value 5 if l ≤ H and A[l] > A[i] 6 largest = l 7 else 8 largest = i 9 if r ≤ H and A[r] > A[largest] 10 largest = r 11 12 if largest ≠ i // value of children is larger than that of i 13 swap A[i] and A[largest] 14 maxHeapify(A, largest) // call recursively The following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner. 1 buildMaxHeap(A) 2 for i = H/2 downto 1 3 maxHeapify(A, i)
[{"input": "10\n 4 1 3 2 16 9 10 14 8 7", "output": "16 14 10 8 7 9 3 2 4 1"}]
Print values of nodes in the max-heap in order of their id (from $1$ to $H$). _Print a single space character before each value._
s971516861
Wrong Answer
p02288
In the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).
print(1, 2, 3)
Maximum Heap A binary heap which satisfies max-heap property is called max-heap. In a max- heap, for every node $i$ other than the root, $A[i] \leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself. Here is an example of a max-heap. ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ALDS1_9_B_1) Write a program which reads an array and constructs a max-heap from the array based on the following pseudo code. $maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap. 1 maxHeapify(A, i) 2 l = left(i) 3 r = right(i) 4 // select the node which has the maximum value 5 if l ≤ H and A[l] > A[i] 6 largest = l 7 else 8 largest = i 9 if r ≤ H and A[r] > A[largest] 10 largest = r 11 12 if largest ≠ i // value of children is larger than that of i 13 swap A[i] and A[largest] 14 maxHeapify(A, largest) // call recursively The following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner. 1 buildMaxHeap(A) 2 for i = H/2 downto 1 3 maxHeapify(A, i)
[{"input": "10\n 4 1 3 2 16 9 10 14 8 7", "output": "16 14 10 8 7 9 3 2 4 1"}]
If the immigrant should be allowed entry according to the regulation, print `APPROVED`; otherwise, print `DENIED`. * * *
s021423807
Wrong Answer
p02772
Input is given from Standard Input in the following format: N A_1 A_2 \dots A_N
N = input() nums = map(int, input()) print(nums)
Statement You are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria. According to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied: * All even numbers written on the document are divisible by 3 or 5. If the immigrant should be allowed entry according to the regulation, output `APPROVED`; otherwise, print `DENIED`.
[{"input": "5\n 6 7 9 10 31", "output": "APPROVED\n \n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\n* * *"}, {"input": "3\n 28 27 24", "output": "DENIED\n \n\n28 violates the condition, so the immigrant should not be allowed entry."}]
If the immigrant should be allowed entry according to the regulation, print `APPROVED`; otherwise, print `DENIED`. * * *
s504552315
Accepted
p02772
Input is given from Standard Input in the following format: N A_1 A_2 \dots A_N
lines = [] for i in range(2): inp = input() lines.append(inp) searchList = [] for i in range(int(lines[0])): split = lines[1].split() if int(split[i]) % 2 == 0: searchList.append(int(split[i])) out = "APPROVED" for s in searchList: if s % 3 != 0 and s % 5 != 0: out = "DENIED" print(out) break if out == "APPROVED": print(out)
Statement You are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria. According to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied: * All even numbers written on the document are divisible by 3 or 5. If the immigrant should be allowed entry according to the regulation, output `APPROVED`; otherwise, print `DENIED`.
[{"input": "5\n 6 7 9 10 31", "output": "APPROVED\n \n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\n* * *"}, {"input": "3\n 28 27 24", "output": "DENIED\n \n\n28 violates the condition, so the immigrant should not be allowed entry."}]
Print the abbreviation of the name of the contest. * * *
s460873326
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
title = input().split(" ") name = title[1] fst = list(name) print("A" + fst[0] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s994341918
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
ls = list(map(str, input().split())) M = ls[1][0] print("A" + M + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s320877016
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt from collections import deque from bisect import bisect, bisect_left, bisect_right from string import ascii_lowercase from functools import lru_cache import sys sys.setrecursionlimit(10000) INF = float("inf") YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no" dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0] dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1] def inside(y, x, H, W): return 0 <= y < H and 0 <= x < W def ceil(a, b): return (a + b - 1) // b def main(): a, b, c = input().split() print("A" + b[0] + "C") if __name__ == "__main__": main()
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s216731240
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a, b, c = input().split() x = b[0] A = [] A.append("A") A.append(x) A.append("C") print("".join(A))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s219694311
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
contest = list(input().split()) print(contest[0][0] + contest[1][0] + contest[2][0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s688548056
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
st = input().split() N = int(st[0]) x = int(st[1]) A = input().split() a = [] for i in range(N): a.append(int(A[i])) a.append(0) a.append(0) ret = 0 for i in range(N): if a[i] + a[i + 1] > x: d1 = max((a[i] + a[i + 1]) - x, 0) ret += min(a[i + 1], d1) a[i + 1] -= min(a[i + 1], d1) d1 = max((a[i] + a[i + 1]) - x, 0) ret += min(a[i], d1) a[i] -= min(a[i], d1) print(ret)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s125630297
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
title = list(input.split()) word = list(title[1]) print("A" + word[0] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s003133000
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
string = input() Capital = string[0] print("A" + Capital + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s114050149
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
import java.util.*; class Main { public static void main(String args[]) { Scanner inp = new Scanner(System.in); inp.next(); char s = inp.next().toCharArray()[0]; System.out.println("A" + s + "C"); } }
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s433254560
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
s, t, u = map(str, input().split()) print(s[0] + t[0] + u[0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s546205795
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a, s, b = input().split() print(a[0] + s[0] + b[0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s655646632
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a, b, c = input().split(" ") print(f"A{b[0]}C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s590969499
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("".join(map(lambda x: x[0], input().split())))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s365676898
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
A = [i for i in input().split()] print("A" + A[1] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s920519231
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("".join(s[0] for s in input()split()))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s352266253
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("".join(map(lambda x: x[0].upper(), input().split())))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s687355803
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
l = input().replace(" ", "") print(l) print(l[0] + l[7] + l[-7])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s025249183
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a, b, c = map(input.split()) print("A" + b.head + "C", sep="")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s645059499
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
caps = [str[0] for str in input().split()] print(caps)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s608723144
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print(f"A{input()[8]}C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s849864513
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("A" + input()[8:9] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s803556160
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("A" + str(input())[9] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s493035513
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("A" + upper(input()[0]) + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s760791367
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("A%sC".input()[8])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s236822217
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("AtCoder " + input()[0] + " Contest")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s621316468
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
contName = input().split() print(''.join([contName[0][0],contName[1][0],contName[2][0]])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s708254526
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("".join(map(lambda s: s[0], input().split())))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s701442942
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
# ABC048 B a, s, t = input().split() print(a, s[0], t)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s825874643
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
_, S, _ = input().split() print("A", S[0], "C", sep="")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s651580538
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
#AtCoder *** Contest def ABC_48_A(): A,B,C = map(str, input().split()) print('A' + B[0] + 'C') if __name__ == '__main__':
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s510911651
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
( n, *s, ) = zip(*input().split()) print("".join(n))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s706970463
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
Atcoder, s, Contest = input().split() print(Atcoder[0] + s[0] + Contest[0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s858640604
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
A, B, C = list(input().split()) result = A[0] + B[0] + C[0] print(result.upper())
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s464109688
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
lis = input().split() print(lis[0][0], lis[1][0], lis[2][0], sep="")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s602371702
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
input1 = input().split() A = input1[0] s = input1[1] C = input1[2] listA = [str(x) for x in A] listS = [str(y) for y in s] listC = [str(z) for z in C] print(listA[0] + listS[0] + listC[0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s799732655
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
S = list(map(str, input().split())) print(S[0][0], end="") print(S[1][0], end="") print(S[2][0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s487854069
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a,b,x = map(int,input().split()) #if a > x or b < x: # print("0") elif a%x == 0: print(b//x-a//x+1) else: print(b//x-a//x)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s967119755
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
list = input() i = 0 while True: if i>3: break print(list[0][0:1],end='') i += 1
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s967982793
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
AtCoder, s, Contest = map(str, input().split()) print(f'A{s[0]}C')AtCoder, s, Contest = map(str, input().split()) x = s[0] print(f'A{s}C')
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s574707824
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a=list(map(input().split()) for w in a: a=a[0] a=strings(a) print(a)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s032727439
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
list = input().split() i=0 while True: if i>2: break print(list[i][0:1]) i++
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s290546676
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
s = input().split()[1] s_ini = list(s)[0] print(A{}C.format(s_ini))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s274419564
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
name1 = input() name2 = name1.replace(" ", "") name3 = name2[7:] name4 = name3[:7] print(name4) lst1 = list(name4) print("A" + lst1[0] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s007186192
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
n = input().split()[1][0] print("A" + n + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s843315922
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("".join([x[0] for x in input().split()]))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s807933169
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("".join([s[0] for s in input().split()]))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s643170399
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
S = input().split(" ") print([i[0] for i in S])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s529342515
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a,b,c=map(str,input().split()) print('A'b[0]'C')
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s181488131
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a,b,c = input().split() print(a[0]+b[0]+c[0]
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s906765241
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
s = input().split(" ")[1] print(f"A{s[0].upper()}C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s370435486
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a,b,c=[for i in input().split()] print("A"+b[0]+"C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s852196572
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("AtCoder" + input().split()[1][0] + "Contest")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s469169848
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("A{}C".format(input().split()[1][1]))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s496460771
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
A, hoge, C = input().split() print("A" + hoge[0].upper() + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s418106629
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
N = input().split() print(N[0][0] + N[1][0] + N[2][0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s727148234
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
l = input().split(" ") print(l[0][0] + l[1][0].upper() + l[2][0])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s277108629
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
line = input() o = "".join([s[0] for s in line.split()]) print(o)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s506600535
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
a, b, c = map(list, input().split()) print("".join("A", b[0], "C"))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s115166637
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
A = input().split() print({}{}{}.format(A[0],A[1][0],A[2])
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s461623341
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("".join(c for c in input() if "A" <= c <= "Z"))
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s849546276
Wrong Answer
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
vowelslist = ["a", "e", "i", "o", "u"] print(input() in vowelslist)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s449501059
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print(input("A").split()[1][0] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s894435998
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("A" + input().split()[1][:1] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s319509444
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
text = input() S = text[8] print("A" + S + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s824089841
Accepted
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
st = input() print("A" + st[8] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s654041412
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
A, S, C = input() print(A + S[0] + C)
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s231923954
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
print("A" + int()[8] + "C")
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]
Print the abbreviation of the name of the contest. * * *
s334042219
Runtime Error
p03860
The input is given from Standard Input in the following format: AtCoder s Contest
s = input()[8] print('A' + s + 'C')
Statement Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s. Given the name of the contest, print the abbreviation of the name.
[{"input": "AtCoder Beginner Contest", "output": "ABC\n \n\nThe contest in which you are participating now.\n\n* * *"}, {"input": "AtCoder Snuke Contest", "output": "ASC\n \n\nThis contest does not actually exist.\n\n* * *"}, {"input": "AtCoder X Contest", "output": "AXC"}]