buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> a(n); for (auto &x : a) cin >> x; vector<vector<ll>> dp( n + 1, vector<ll>(3, -1e+18)); // dp[n個目まで][いくつ飛ばしたか]; int base = (n % 2 == 0 ? 1 : 2); int lim = 2; dp[0][0] = 0; for (int i...
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; vector<int> a(n); for (auto &x : a) cin >> x; vector<vector<ll>> dp( n + 1, vector<ll>(3, -1e+18)); // dp[n個目まで][いくつ飛ばしたか]; int base = (n % 2 == 0 ? 1 : 2); int lim = 2; dp[0][0] = 0; for (int i...
[["+", 0, 69, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 28, 69, 341, 342, 0, 16, 12, 23, 0, 24], ["+", 341, 342, 0, 16, 12, 23, 0, 16, 31, 22], ["+", 341, 342, 0, 16, 12, 23, 0, 16, 17, 33], ["+", 341, 342, 0, 16, 12, 23, 0, 16, 12, 22], ["+", 28, 69, 341, 342, 0, 16, 12, 23, 0, 25]]
1
449
from itertools import accumulate,chain from itertools import combinations from random import randrange def solve(A): N = len(A) oddacc = tuple(chain((0,),accumulate(A[1::2]))) evenacc = tuple(chain((0,),accumulate(A[::2]))) if N%2==0: return max(oddacc[i]+evenacc[-1]-evenacc[i] for i in range...
from itertools import accumulate,chain from itertools import combinations from random import randrange def solve(A): N = len(A) oddacc = tuple(chain((0,),accumulate(A[1::2]))) evenacc = tuple(chain((0,),accumulate(A[::2]))) if N%2==0: return max(evenacc[i]+oddacc[-1]-oddacc[i] for i in range(...
[["-", 3, 668, 8, 657, 31, 657, 31, 206, 51, 22], ["+", 3, 668, 8, 657, 31, 657, 31, 206, 51, 22], ["-", 3, 668, 8, 657, 31, 657, 12, 206, 51, 22], ["+", 3, 668, 8, 657, 31, 657, 12, 206, 51, 22], ["-", 0, 652, 3, 668, 8, 657, 12, 206, 51, 22], ["+", 0, 652, 3, 668, 8, 657, 12, 206, 51, 22]]
5
354
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #define all(a) (a).begin(), (a).end() #define mk make_pair ll mod = 998244353; int inf = 1000001000; ll INF = 1e18 + 5; ll MOD = 1000000007; int main...
#include <bits/stdc++.h> using namespace std; #define pp pair<int, int> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define ll long long #define ld long double #define all(a) (a).begin(), (a).end() #define mk make_pair ll mod = 998244353; int inf = 1000001000; ll INF = 1e18 + 5; ll MOD = 1000000007; int main...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
516
//#pragma once #include <algorithm> #include <bitset> #include <cctype> #include <cstdlib> // srand,rand #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stdio.h> #include <stdl...
//#pragma once #include <algorithm> #include <bitset> #include <cctype> #include <cstdlib> // srand,rand #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stdio.h> #include <stdl...
[["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13]]
1
2,950
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; ll A[200005]; ll dp[200005]; ll dp2[200005...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; ll A[200005]; ll dp[200005]; ll dp2[200005...
[["-", 64, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
756
/////////////////////////////////////////////////////////////////////////////// #include <bits/stdc++.h> #include <sys/time.h> #include <time.h> #include <unistd.h> using namespace std; /////////////////////////////////////////////////////////////////////////////// #define DEBUG 0 #define pb push_back #define V ve...
/////////////////////////////////////////////////////////////////////////////// #include <bits/stdc++.h> #include <sys/time.h> #include <time.h> #include <unistd.h> using namespace std; /////////////////////////////////////////////////////////////////////////////// #define DEBUG 0 #define pb push_back #define V ve...
[["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38]]
1
7,102
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include ...
[["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13]]
1
727
from sys import stdin import sys import math from functools import reduce import functools import itertools from collections import deque,Counter,defaultdict from operator import mul import copy # ! /usr/bin/env python # -*- coding: utf-8 -*- import heapq sys.setrecursionlimit(10**6) INF = float("inf") import bisect ...
from sys import stdin import sys import math from functools import reduce import functools import itertools from collections import deque,Counter,defaultdict from operator import mul import copy # ! /usr/bin/env python # -*- coding: utf-8 -*- import heapq sys.setrecursionlimit(10**6) INF = float("inf") import bisect ...
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
304
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef vector<double> Vec; typedef vector<Vec> Mat; typedef pair<ll, ll> P; typedef pair<double, ll> Pd; typedef pair<double, double> PD; typedef priority_queue<P, vector<P>, greater...
#include <bits/stdc++.h> #include <stdlib.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef vector<double> Vec; typedef vector<Vec> Mat; typedef pair<ll, ll> P; typedef pair<double, ll> Pd; typedef pair<double, double> PD; typedef priority_queue<P, vector<P>, greater...
[["-", 3, 4, 0, 69, 28, 69, 341, 342, 0, 13], ["+", 3, 4, 0, 69, 28, 69, 341, 342, 0, 13]]
1
466
#include <bits/stdc++.h> using namespace std; #define ll long long const int INF = 0x3f3f3f3f; const int N = 2e5 + 10; const ll mod = 1e9 + 7; map<int, ll> dp[N]; int n; ll a[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%lld", &a[i]); dp[1][1] = a[1]; dp[1][0] = 0; dp[2][0] = 0; ...
#include <bits/stdc++.h> using namespace std; #define ll long long const int INF = 0x3f3f3f3f; const int N = 2e5 + 10; const ll mod = 1e9 + 7; map<int, ll> dp[N]; int n; ll a[N]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%lld", &a[i]); dp[1][1] = a[1]; dp[1][0] = 0; dp[2][0] = 0; ...
[["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 1, 0, 11, 12, 16, 12, 69, 28, 22], ["+", 0, 11, 12, 16, 12, 69, 341, 342, 0, 70], ["+", 0, 11, 12, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 11, 12, 16, 12, 69, 341, 342, 0, 73]]
1
404
#include <bits/stdc++.h> using namespace std; long long N; long long A[200005]; int main() { cin >> N; for (long long i = 0; i < N; i++) { cin >> A[i]; } if (N % 2 == 0) { long long odd = 0; long long even = 0; for (long long i = 0; i < N; i++) { if (i % 2 == 0) { even += A[i]; ...
#include <bits/stdc++.h> using namespace std; long long N; long long A[200005]; int main() { cin >> N; for (long long i = 0; i < N; i++) { cin >> A[i]; } if (false) { long long odd = 0; long long even = 0; for (long long i = 0; i < N; i++) { if (i % 2 == 0) { even += A[i]; ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 51, 147]]
1
619
#include <bits/stdc++.h> using namespace std; using LL = long long; constexpr LL INF = 1e15; struct ListNode { ListNode() = default; ListNode(LL _data, LL _id) : data(_data), id(_id) {} bool operator<(const ListNode &other) const { return data == other.data ? id < other.id : data < other.data; } LL dat...
#include <bits/stdc++.h> using namespace std; using LL = long long; constexpr LL INF = 1e15; struct ListNode { ListNode() = default; ListNode(LL _data, LL _id) : data(_data), id(_id) {} bool operator<(const ListNode &other) const { return data == other.data ? id < other.id : data < other.data; } LL dat...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78]]
1
431
#include <bits/stdc++.h> using namespace std; int dp[200005]; int sum[200005]; int yoyo[200005]; int main() { int t; cin >> t; cin >> yoyo[1]; sum[1] = yoyo[1]; for (int i = 2; i <= t; i++) { cin >> yoyo[i]; if (i % 2) sum[i] = sum[i - 2] + yoyo[i]; } for (int i = 2; i <= t; i++) { if (i...
#include <bits/stdc++.h> using namespace std; long long int dp[200005]; long long int sum[200005]; long long int yoyo[200005]; int main() { int t; cin >> t; cin >> yoyo[1]; sum[1] = yoyo[1]; for (int i = 2; i <= t; i++) { cin >> yoyo[i]; if (i % 2) sum[i] = sum[i - 2] + yoyo[i]; } for (int i...
[["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96]]
1
186
#include <bits/stdc++.h> using namespace std; #define ll long long #define fi first #define sec second ll n, m, k, a, b, x, x2, y, y2, sol = 0, cnt, sad, koliko; char c; string s; vector<ll> V; ll dp[200010][3][2]; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> x; V.push_back(x); } dp[0...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fi first #define sec second ll n, m, k, a, b, x, x2, y, y2, sol = 0, cnt, sad, koliko; char c; string s; vector<ll> V; ll dp[200010][3][2]; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> x; V.push_back(x); } dp[0...
[["+", 8, 9, 0, 1, 0, 11, 12, 91, 17, 33]]
1
466
#include <bits/stdc++.h> #define ll long long using namespace std; ll n, x, sol = 0; vector<ll> V; ll dp[200005][3][2]; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> x; V.push_back(x); } dp[0][0][0] = INT_MIN; dp[0][0][1] = V[0]; dp[0][1][0] = 0; dp[0][1][1] = INT_MIN; dp[0][2][0...
#include <bits/stdc++.h> #define ll long long using namespace std; ll n, x, sol = 0; vector<ll> V; ll dp[200005][3][2]; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> x; V.push_back(x); } dp[0][0][0] = INT_MIN; dp[0][0][1] = V[0]; dp[0][1][0] = 0; dp[0][1][1] = INT_MIN; dp[0][2][0...
[["-", 3, 4, 0, 69, 28, 69, 341, 342, 0, 13], ["+", 3, 4, 0, 69, 28, 69, 341, 342, 0, 13]]
1
445
from sys import stdin n = int(stdin.readline()) nums = list(map(int, stdin.readline().split())) # Gives TLE def naive_2D_dp(n, nums): # let dp[i][j]: maximum sum of j elements chosen from the first i elements where no two are adjacent. # dp[i][j] = max(dp[i-2][j-1] + nums[i], dp[i-1][j]); maximum between sele...
from sys import stdin n = int(stdin.readline()) nums = list(map(int, stdin.readline().split())) # Gives TLE def naive_2D_dp(n, nums): # let dp[i][j]: maximum sum of j elements chosen from the first i elements where no two are adjacent. # dp[i][j] = max(dp[i-2][j-1] + nums[i], dp[i-1][j]); maximum between sele...
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 57, 15, 657, 31, 23, 0, 24], ["-", 0, 57, 15, 657, 31, 23, 0, 657, 17, 72], ["-", 0, 57, 15, 657, 31, 23, 0, 657, 12, 612], ["-", 8, 196, 0, 57, 15, 657, 31, 23, 0, 25]]
5
386
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) typedef long long Int; const Int INF = 1e18; int main() { Int N; cin >> N; vector<Int> A(N); rep(i, N) cin >> A[i]; vector<Int> dp0(N, -INF), dp1(N, -I...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) typedef long long Int; const Int INF = 1e18; int main() { Int N; cin >> N; vector<Int> A(N); rep(i, N) cin >> A[i]; vector<Int> dp0(N, -INF), dp1(N, -I...
[["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13], ["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13]]
1
235
#include <bits/stdc++.h> using namespace std; #ifndef modint_hpp #define modint_hpp #include <cassert> #include <iostream> template <int mod> class modint { int val; public: static constexpr modint identity() noexcept { return 1; } constexpr modint() noexcept : val{0} {} constexpr modint(long long x) noexcep...
#include <bits/stdc++.h> using namespace std; #ifndef modint_hpp #define modint_hpp #include <cassert> #include <iostream> template <int mod> class modint { int val; public: static constexpr modint identity() noexcept { return 1; } constexpr modint() noexcept : val{0} {} constexpr modint(long long x) noexcep...
[["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 13], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 31, 22], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 47]]
1
1,636
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() using namespace std; using ll = int64_t; using P = pair<int, int>; using vs = vector<string>; using vi = vector<ll>; using vvi = vector<vi>; const int IN...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() using namespace std; using ll = int64_t; using P = pair<int, int>; using vs = vector<string>; using vi = vector<ll>; using vvi = vector<vi>; const int IN...
[["-", 0, 57, 64, 9, 0, 43, 49, 50, 51, 13], ["+", 64, 9, 0, 43, 49, 50, 51, 91, 17, 33], ["+", 64, 9, 0, 43, 49, 50, 51, 91, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
533
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iter...
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iter...
[["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13]]
1
526
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #inclu...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <sstream> #inclu...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
338
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 2e5 + 69, INF = 1e17; int n; int a[MAXN]; int dp[MAXN][3]; signed main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= n; i++) for (int j = 0; j < 3; j++) dp[i][j] = -INF; dp[1][0] = a...
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 2e5 + 69, INF = 1e17; int n; int a[MAXN]; int dp[MAXN][3]; signed main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= n; i++) for (int j = 0; j < 3; j++) dp[i][j] = -INF; dp[1][0] = a...
[["-", 0, 69, 28, 69, 341, 342, 0, 16, 12, 22], ["+", 0, 69, 28, 69, 341, 342, 0, 16, 12, 13]]
1
369
// Problem : F - Select Half // Contest : AtCoder - AtCoder Beginner Contest 162 // URL : https://atcoder.jp/contests/abc162/tasks/abc162_f // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define ll long lon...
// Problem : F - Select Half // Contest : AtCoder - AtCoder Beginner Contest 162 // URL : https://atcoder.jp/contests/abc162/tasks/abc162_f // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define ll long lon...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
286
N = int(input()) A = list(map(int,input().split())) DP = [0,0,0] m = N//2*2 if N%2 == 0: for i in range(0,m,2): DP[0] += A[i] DP[1] += A[i+1] DP[1] += max(DP[0],DP[1]) print(DP[1]) else: for i in range(0,m,2): DP[0] += A[i] DP[1] += A[i+1] DP[2] += A[i+2] ...
N = int(input()) A = list(map(int,input().split())) DP = [0,0,0] m = N//2*2 if N%2 == 0: for i in range(0,m,2): DP[0] += A[i] DP[1] += A[i+1] DP[1] = max(DP[0],DP[1]) print(DP[1]) else: for i in range(0,m,2): DP[0] += A[i] DP[1] += A[i+1] DP[2] += A[i+2] ...
[["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32]]
5
190
#include <algorithm> #include <cmath> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main() { long long n; ...
#include <algorithm> #include <cmath> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main() { long long n; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["-", 0, 57, 15, 339, 51, 91, 28, 23, 0, 24], ["-", 0, 57, 15, 339, 51, 91, 28, 23, 0, 25]]
1
232
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxs = 2e5 + 5; const ll lmaxs = 20; ll mod = 1e9 + 7; ll oo = 1e15; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxs = 2e5 + 5; const ll lmaxs = 20; ll mod = 1e9 + 7; ll oo = 1e15; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(...
[["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35]]
1
332
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } #define rep(i, n) for (int i ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <typename T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } #define rep(i, n) for (int i ...
[["-", 0, 9, 0, 57, 64, 1, 0, 2, 63, 22], ["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 1, 0, 2, 3, 4, 0, 25]]
1
509
#include <bits/stdc++.h> #define rep(i, a) for (int i = (int)0; i < (int)a; ++i) #define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i) #define pb push_back #define eb emplace_back #define all(x) x.b...
#include <bits/stdc++.h> #define rep(i, a) for (int i = (int)0; i < (int)a; ++i) #define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i) #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i) #define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i) #define pb push_back #define eb emplace_back #define all(x) x.b...
[["-", 3, 4, 0, 16, 31, 69, 341, 342, 0, 13], ["+", 3, 4, 0, 16, 31, 69, 341, 342, 0, 13]]
1
808
#include <algorithm> #include <cstdint> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, s, t) for (int i ...
#include <algorithm> #include <cstdint> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, s, t) for (int i ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]]
1
1,538
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<s...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<int> VI; typedef vector<ll> VL; typedef vector<s...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
339
#include <bits/stdc++.h> using namespace std; typedef long long ll; int const N = 2e5 + 5; int n; ll arr[N], dp[N][3]; int lst; ll solve(int idx, int state) { if (idx >= n) return 0; ll &ret = dp[idx][state]; if (ret != -1) return ret; ret = -1e18; if (state < 2) ret = solve(idx + 1, state + 1); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int const N = 2e5 + 5; int n; ll arr[N], dp[N][3]; int lst; ll solve(int idx, int state) { if (idx >= n) return 0; ll &ret = dp[idx][state]; if (ret != -1) return ret; ret = -1e18; if (state < 2) ret = solve(idx + 1, state + 1); ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
231
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1e18; int main() { int N; cin >> N; ll a[N]; for (int i = 0; i < N; i++) { cin >> a[i]; } int M = N % 2 + 1; vector<vector<ll>> dp(N + 2, vector<ll>(M + 1, -inf)); dp[0][0] = 0; for (int i = 0; i < N; i++) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1e18; int main() { int N; cin >> N; ll a[N]; for (int i = 0; i < N; i++) { cin >> a[i]; } int M = N % 2 + 1; vector<vector<ll>> dp(N + 10, vector<ll>(M + 1, -inf)); dp[0][0] = 0; for (int i = 0; i <= N; i++) { ...
[["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
238
#include <algorithm> #include <iostream> using namespace std; long long a[200010]; long long dp[200010]; long long presum[200010]; int n; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); presum[1] = a[1]; for (int i = 3; i <= n; i += 2) presum[i] = presum[i - 2] + a[i]; ...
#include <algorithm> #include <iostream> using namespace std; long long a[200010]; long long dp[200010]; long long presum[200010]; int n; int main() { scanf("%lld", &n); for (int i = 1; i <= n; i++) scanf("%lld", &a[i]); presum[1] = a[1]; for (int i = 3; i <= n; i += 2) presum[i] = presum[i - 2] + a[i]...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
206
from itertools import accumulate import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) odd = list(accumulate([0] + A[::2])) even = list(accumulate([0] + A[::-1][::2])) ans = max(odd[i] + even[N//2-i] for i in range(N//2)) if N % 2 == 1: dp = [0] * (N//2+1) for i in range(0,...
from itertools import accumulate import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) odd = list(accumulate([0] + A[::2])) even = list(accumulate([0] + A[::-1][::2])) ans = max(odd[i] + even[N//2-i] for i in range(N//2+1)) if N % 2 == 1: dp = [0] * (N//2+1) for i in range(...
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
214
#include <algorithm> #include <climits> #include <stdio.h> long long input[200010]; long long dp[3][200010]; bool check[3][200010]; int n; long long func(int left, int x) { if (x > n) { if (left == 0) return 0; return LLONG_MIN / 2; } if (check[left][x] == true) return dp[left][x]; check[le...
#include <algorithm> #include <climits> #include <stdio.h> long long input[200010]; long long dp[3][200010]; bool check[3][200010]; int n; long long func(int left, int x) { if (x > n) { if (left <= 1) return 0; return LLONG_MIN / 2; } if (check[left][x] == true) return dp[left][x]; check[le...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
252
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <tu...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <tu...
[["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["-", 12, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["+", 12, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 0, 69, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 69, 28, 69, 341, 342, 0, 16, 12, 13]]
1
466
/* Aa^~ kokoro ga pyonpyon suru n jaa^~ // ZZZXXkXkkkZ!``` ``` ``` ``` ``` ``` ``` ``` ``` ``` ``` ```?Wfpppbpbbpbbpbbbkbkk // ppbbbpbbpVr`` `` ` ` ` ` ```` `` ` ` `` ` ` ` ` ` ` ` ` ` dppbbkkkkkkkkkkqkqkk // HkqqqqqkkWr`` ` ` ``` ``` `?G, ` ` ``.JC!```` ` ` `` `` ````(Wpbkkkkkkkkqkkkkkqk // mmmmmqqqqpr` `` `` ```````...
/* Aa^~ kokoro ga pyonpyon suru n jaa^~ // ZZZXXkXkkkZ!``` ``` ``` ``` ``` ``` ``` ``` ``` ``` ``` ```?Wfpppbpbbpbbpbbbkbkk // ppbbbpbbpVr`` `` ` ` ` ` ```` `` ` ` `` ` ` ` ` ` ` ` ` ` dppbbkkkkkkkkkkqkqkk // HkqqqqqkkWr`` ` ` ``` ``` `?G, ` ` ``.JC!```` ` ` `` `` ````(Wpbkkkkkkkkqkkkkkqk // mmmmmqqqqpr` `` `` ```````...
[["+", 3, 4, 0, 69, 341, 342, 0, 16, 31, 22], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33]]
1
811
//============================================================================ // Name : e.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostrea...
//============================================================================ // Name : e.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostrea...
[["-", 31, 16, 12, 2, 3, 4, 0, 69, 28, 22], ["+", 31, 16, 12, 2, 3, 4, 0, 69, 28, 22]]
1
372
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll MOD = 1000000007; const ll INF = 10000000000000000; vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1}; vec...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll MOD = 1000000007; const ll INF = 10000000000000000; vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1}; vec...
[["-", 49, 50, 51, 4, 0, 2, 3, 4, 0, 13], ["+", 51, 4, 0, 2, 3, 4, 0, 91, 17, 33], ["+", 51, 4, 0, 2, 3, 4, 0, 91, 28, 22], ["-", 0, 2, 3, 4, 0, 2, 3, 4, 0, 13], ["+", 3, 4, 0, 2, 3, 4, 0, 91, 17, 33], ["+", 3, 4, 0, 2, 3, 4, 0, 91, 28, 22]]
1
1,364
// pragma //#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define YOU using #define DONT namespace #define SAY std YOU DONT SAY; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ll, int> pli; type...
// pragma //#pragma GCC optimize("Ofast") //#pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define YOU using #define DONT namespace #define SAY std YOU DONT SAY; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ll, int> pli; type...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
632
N_List = list(map(int,input().split())) N_List.append(N_List.pop(0)) print(" ".join(map(str,N_List)))
N_List = list(map(int,input().split())) N_List.insert(0,N_List.pop(2)) print(" ".join(map(str,N_List)))
[["-", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612]]
5
44
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <...
[["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
171
import numpy as np import pandas as pd X, Y, Z = map(int, input().split()) print(Z, X, Y)
import numpy as np X, Y, Z = map(int, input().split()) print(Z, X, Y)
[["-", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 0, 656, 0, 596, 141, 704, 141, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 596, 141, 704, 0, 272], ["-", 36, 36, 0, 656, 0, 596, 141, 704, 705, 22]]
5
34
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; swap(a, b); swap(a, c); cout << "a" << " " << "b" << " " << "c" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; swap(a, b); swap(a, c); cout << a << " " << b << " " << c << endl; return 0; }
[["-", 31, 16, 31, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62]]
1
68
#include <stdio.h> int main() { int a, b, c; scanf("%d %d %d", a, b, c); printf("%d %d %d", c, a, b); return 0; }
#include <stdio.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); printf("%d %d %d", c, a, b); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
44
x, y, z = map(int, input().split()) print(z, ' ', y, ' ', x)
x, y, z = map(int, input().split()) print(z, ' ', x, ' ', y)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
34
#include <stdio.h> int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); printf("%d%d%d", c, a, b); }
#include <stdio.h> int main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); printf("%d %d %d", c, a, b); }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
44
#include <iostream> int main() { int a, b, c; std::cin >> a >> b >> c; std::cout << c << " " << b << " " << a << "\n"; return 0; }
#include <iostream> int main() { int a, b, c; std::cin >> a >> b >> c; std::cout << c << " " << a << " " << b << "\n"; return 0; }
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
50
a,b,c = map(int,input().split()) print("{} {} {}".format(c,b,a))
a,b,c = map(int,input().split()) print("{} {} {}".format(c,a,b))
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
5
33
#include <bits/stdc++.h> using namespace std; #define int long long const int MOD = 1000000007; signed main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> A(N); int INF = (int)1 << 60; int res = -INF; for (int i = 0; i < N; i++) { cin >> A[i]; } if (N % 2 == 0) { ...
#include <bits/stdc++.h> using namespace std; #define int long long const int MOD = 1000000007; signed main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> A(N); int INF = (int)1 << 60; int res = -INF; for (int i = 0; i < N; i++) { cin >> A[i]; } if (N % 2 == 0) { ...
[["-", 64, 9, 0, 43, 49, 50, 51, 91, 17, 33], ["-", 64, 9, 0, 43, 49, 50, 51, 91, 28, 22], ["+", 0, 57, 64, 9, 0, 43, 49, 50, 51, 13]]
1
341
a=gets.split a.shift(a.pop) puts a.join ' '
a=gets.chomp.split a.unshift(a.pop) puts a.join ' '
[["+", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
20
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; swap(a, b); swap(a, c); cout << a << "" << b << "" << c << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; swap(a, b); swap(a, c); cout << a << " " << b << " " << c << endl; return 0; }
[["+", 31, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
60
x,y,z = map(int,input().split()) print(y,end=' ') print(x,end=' ') print(z)
x,y,z = map(int,input().split()) print(z,end=' ') print(x,end=' ') print(y)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
42
#include <bits/stdc++.h> #define rep(i, start, end) for (long long i = start; i < end; ++i) #define repreverse(i, start, end) for (long long i = start; i >= end; --i) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define len(x) ((long long)(x).size()) #define lcm(a, b) ((a) / __gcd((a),...
#include <bits/stdc++.h> #define rep(i, start, end) for (long long i = start; i < end; ++i) #define repreverse(i, start, end) for (long long i = start; i >= end; --i) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define len(x) ((long long)(x).size()) #define lcm(a, b) ((a) / __gcd((a),...
[["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 147]]
1
968
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; swap(a, c); swap(a, b); cout << a << " " << b << " " << c << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; swap(a, b); swap(a, c); cout << a << " " << b << " " << c << endl; return 0; }
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
62
[A, B, C] = list(map(int, input().split(' '))) print(C + ' ' + A + ' ' + B)
[A, B, C] = list(map(str, input().split(' '))) print(C + ' ' + A + ' ' + B)
[["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
5
42
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define sp " " #define endl "\n" #define MAX 10e9 #define MAXN 100001 #define mod 1000000007 #define inf_int 2e9 #define inf_ll 2e18 #define e 1e-9 #define vi vector<int> #define vl vector<ll> #define vc vector<char> #define vs vector<string> #define vpl vector<pair<...
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define sp " " #define endl "\n" #define MAX 10e9 #define MAXN 100001 #define mod 1000000007 #define inf_int 2e9 #define inf_ll 2e18 #define e 1e-9 #define vi vector<int> #define vl vector<ll> #define vc vector<char> #define vs vector<string> #define vpl vector<pair<...
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
316
a, b, c = input().split() print("{} {} {}".format(c, b, a))
a, b, c = input().split() print("{} {} {}".format(c, a, b))
[["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
5
28
X,Y,Z=map(int,input()) print(str(Z)+' '+str(X)+' '+str(Y))
X,Y,Z=map(int,input().split()) print(str(Z)+' '+str(X)+' '+str(Y))
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
39
#include <stdio.h> int main(void) { int X, Y, Z; scanf("%d %d %d", &X, &Y, &Z); printf("%d %d %d", &Z, &X, &Y); }
#include <stdio.h> int main(void) { int X, Y, Z; scanf("%d %d %d", &X, &Y, &Z); printf("%d %d %d", Z, X, Y); }
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
48
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int a, b, c; cin >> a >> b >> c; cout << c << " " << b << " " << a << endl; ; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int a, b, c; cin >> a >> b >> c; cout << c << " " << a << " " << b << endl; ; return 0; }
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
73
#include <bits/stdc++.h> #define rep(i, N) for (int i = 0; i < (N); ++i) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; using P = pair<int, int>; int main(void) { int x, y, z; cin >> x >> y >> z; swap(x, y); swap(y, z); cout << x << " " << y << " " << z << endl; }
#include <bits/stdc++.h> #define rep(i, N) for (int i = 0; i < (N); ++i) #define all(v) v.begin(), v.end() using namespace std; using ll = long long; using P = pair<int, int>; int main(void) { int x, y, z; cin >> x >> y >> z; swap(x, y); swap(x, z); cout << x << " " << y << " " << z << endl; }
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
90
x, y, z = list(map(str, input().split(' '))) print(z + '' + x + '' + y)
x, y, z = list(map(str, input().split(' '))) print(z + ' ' + x + ' ' + y)
[["+", 31, 657, 31, 657, 31, 657, 12, 557, 0, 6], ["+", 3, 4, 0, 657, 31, 657, 12, 557, 0, 6]]
5
38
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, tmp; cin >> a >> b >> c; tmp = a; a = b; b = tmp; tmp = a; a = c; c = tmp; cout << a << "" << b << "" << c << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, tmp; cin >> a >> b >> c; tmp = a; a = b; b = tmp; tmp = a; a = c; c = tmp; cout << a << " " << b << " " << c << endl; }
[["+", 31, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
69
import bisect,collections,copy,itertools,math,string import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip.split()) def main(): x,y,x = LI() ...
import bisect,collections,copy,itertools,math,string import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip.split()) def main(): x,y,z = LI() ...
[["-", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22], ["+", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22]]
5
127
#include <stdio.h> int main(void) { int a, b, c, t; scanf("%d%d%d", &a, &b, &c); t = a; a = b; b = t; t = a; a = c; c = t; printf("%d%d%d", a, b, c); return 0; }
#include <stdio.h> int main(void) { int a, b, c, t; scanf("%d%d%d", &a, &b, &c); t = a; a = b; b = t; t = a; a = c; c = t; printf("%d %d %d", a, b, c); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
74
#include <stdio.h> int main(void) { int a, b, c; int tmp; scanf("%d %d %d", a, b, c); tmp = a; a = b; b = tmp; tmp = a; a = c; c = tmp; printf("%d %d %d", a, b, c); return 0; }
#include <stdio.h> int main(void) { int a, b, c; int tmp; scanf("%d %d %d", &a, &b, &c); tmp = a; a = b; b = tmp; tmp = a; a = c; c = tmp; printf("%d %d %d", a, b, c); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
72
#include <stdio.h> int main() { int x, y, z; int *px = &x, *py = &y, *pz = &z; int temp; scanf("%d" "%d" "%d", &x, &y, &z); temp = *px; *px = *py; *py = temp; int temp2; temp2 = *px; *px = *pz; *pz = temp2; printf("%d" "%d" "%d\n", *px, *py, ...
#include <stdio.h> int main() { int x, y, z; int *px = &x, *py = &y, *pz = &z; int temp; scanf("%d" "%d" "%d", &x, &y, &z); temp = *px; *px = *py; *py = temp; int temp2; temp2 = *px; *px = *pz; *pz = temp2; printf("%d" " " "%d" " " "...
[["+", 0, 2, 3, 4, 0, 61, 0, 5, 0, 6], ["+", 0, 2, 3, 4, 0, 61, 0, 5, 0, 62]]
0
120
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; printf("%d %d %d\n", b, c, a); }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; printf("%d %d %d\n", c, a, b); }
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
41
xyz = list(map(int,input().split())) xyz[0] ,xyz[1] = xyz[1],xyz[0] xyz[0], xyz[2] = xyz[2], xyz[0] print(xyz)
xyz = list(map(int,input().split())) xyz[0] ,xyz[1] = xyz[1],xyz[0] xyz[0], xyz[2] = xyz[2], xyz[0] print(*xyz)
[["+", 0, 1, 0, 652, 3, 4, 0, 661, 0, 48]]
5
59
#include <stdio.h> int main(void) { int x, y, z; int a; scanf("%d", &x); scanf("%d", &y); scanf("%d", &z); a = x; x = y; y = a; a = z; z = x; x = a; printf("%d", x); printf("%d", y); printf("%d", z); return 0; }
#include <stdio.h> int main(void) { int x, y, z; int a; scanf("%d", &x); scanf("%d", &y); scanf("%d", &z); a = x; x = y; y = a; a = z; z = x; x = a; printf("%d ", x); printf("%d ", y); printf("%d ", z); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
103
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << c << "␣" << a << "␣" << b << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << c << " " << a << " " << b << endl; }
[["-", 31, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 31, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
45
x, y, z = list(map(int, input())) x, y = y, x x, z = z, x print(x, y, z)
x, y, z = list(map(int, input().split())) x, y = y, x x, z = z, x print(x, y, z)
[["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
39
#include <iostream> int main() { int x, y, z; std::cin >> x >> y >> z; std::cout << z << " " << y << " " << x << std::endl; }
#include <iostream> int main() { int x, y, z; std::cin >> x >> y >> z; std::cout << z << " " << x << " " << y << std::endl; }
[["-", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
47
#include <stdio.h> int main() { int x, y, z; scanf("%d %d %d", &x, &y, &z); printf("%d %d %d\n", z, y, x); return 0; }
#include <stdio.h> int main() { int x, y, z; scanf("%d %d %d", &x, &y, &z); printf("%d %d %d\n", z, x, y); return 0; }
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
0
48
# import sys input=sys.stdin.readline def main(): x,y,z=map(int.input().split()) print(z,x,y) if __name__=="__main__": main()
# import sys input=sys.stdin.readline def main(): x,y,z=map(int,input().split()) print(z,x,y) if __name__=="__main__": main()
[["-", 0, 652, 63, 319, 500, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21]]
5
51
X,Y,Z = int(input().split()) print('{} {} {}'.format(Z,X,Y))
X,Y,Z = map(int, input().split()) print('{} {} {}'.format(Z,X,Y))
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21]]
5
31
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); int Z = sc.nextInt(); System.out.println(Z + " " + Y + " " + X); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); int Z = sc.nextInt(); System.out.println(Z + " " + X + " " + Y); } }
[["-", 3, 4, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 3, 4, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 1, 0, 492, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 12, 22]]
3
83
#include <iostream> using namespace std; int main() { int a, b, c; int t = 0; cin >> a >> b; t = a; a = b; b = t; t = c; c = a; a = t; cout << a << " " << b << " " << c << endl; return 0; }
#include <iostream> using namespace std; int main() { int a, b, c; int t = 0; cin >> a >> b >> c; t = a; a = b; b = t; t = c; c = a; a = t; cout << a << " " << b << " " << c << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
75
x, y, z = map(int, input().split()) print("z", "x", "y")
x, y, z = map(int, input().split()) print(z, x, y)
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]]
5
32
x, y, z = gets.split.map(&:to_i) a = [y, z, x] p a.join(' ')
x, y, z = gets.split.map(&:to_i) a = [z, x, y] puts a.join(' ')
[["-", 36, 36, 0, 493, 0, 662, 12, 516, 0, 22], ["-", 36, 36, 0, 493, 0, 662, 12, 516, 0, 21], ["+", 36, 36, 0, 493, 0, 662, 12, 516, 0, 21], ["+", 36, 36, 0, 493, 0, 662, 12, 516, 0, 22], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
33
# [箱A, 箱B, 箱C] list = input().split() # 箱Aと箱B入れ替え list[0], list[1] = list[1], list[0] # 箱Aと箱C入れ替え list[0], list[2] = list[2], list[0] print(list)
# [箱A, 箱B, 箱C] list = input().split() # 箱Aと箱B入れ替え list[0], list[1] = list[1], list[0] # 箱Aと箱C入れ替え list[0], list[2] = list[2], list[0] print(' '.join(list))
[["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 6], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
54
#include <bits/stdc++.h> using namespace std; int main() { int x, y, z; cin >> x, y, z; int k = y; y = x; x = k; k = z; z = x; x = k; cout << x << " " << y << " " << z << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x, y, z; cin >> x >> y >> z; int k = y; y = x; x = k; k = z; z = x; x = k; cout << x << " " << y << " " << z << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 34, 0, 21], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["-", 8, 9, 0, 1, 0, 34, 12, 34, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
73
x,y,z=map(int,input().split()) t=x x=y y=t t=x x=z z=t print(x,y,z,sep="")
x,y,z=map(int,input().split()) t=x x=y y=t t=x x=z z=t print(x,y,z,sep=" ")
[["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 6]]
5
49
#include <bits/stdc++.h> using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for...
#include <bits/stdc++.h> using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for...
[["+", 31, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
148
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mii map<int, int> #define mll map<ll, ll> #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vd vector<double> #define vll vector<ll> #define fi first #define se second #define si set<int...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mii map<int, int> #define mll map<ll, ll> #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vd vector<double> #define vll vector<ll> #define fi first #define se second #define si set<int...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
545
#include <bits/stdc++.h> #include <numeric> using namespace std; typedef long long ll; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FOR_IN(i, a, b) for (int i = (a); i <= (b); ++i) #define REP(i, n) FOR(i, 0, n) const int MOD = 1000000007; // 可変引数で最大公約数を求める関数 // コンパイルオプションに"-std=c++17"を追加 template <cla...
#include <bits/stdc++.h> #include <numeric> using namespace std; typedef long long ll; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FOR_IN(i, a, b) for (int i = (a); i <= (b); ++i) #define REP(i, n) FOR(i, 0, n) const int MOD = 1000000007; // 可変引数で最大公約数を求める関数 // コンパイルオプションに"-std=c++17"を追加 template <cla...
[["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]]
1
294
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<vi> vvi; #define INF 1000000000 #define pb push_back #define sz(a) int((a).size()) #define all(c) c.begin(), c.end() #define tr(c, i) for (typeof(c).begin() i =...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef vector<vi> vvi; #define INF 1000000000 #define pb push_back #define sz(a) int((a).size()) #define all(c) c.begin(), c.end() #define tr(c, i) for (typeof(c).begin() i =...
[["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 48], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]]
1
316
#include <bits/stdc++.h> using namespace std; #define lli long long #define all(i) i.begin(), i.end() #define rall(i) i.rbegin(), i.rend() #define rep0(i, j) for (int i = 0; i < j; i++) #define rep1(i, j) for (int i = 1; i <= j; i++) #define rep0d(i, j) for (int i = j - 1; i >= 0; i--) #define MOD 1000000007 #define M...
#include <bits/stdc++.h> using namespace std; #define lli long long #define all(i) i.begin(), i.end() #define rall(i) i.rbegin(), i.rend() #define rep0(i, j) for (int i = 0; i < j; i++) #define rep1(i, j) for (int i = 1; i <= j; i++) #define rep0d(i, j) for (int i = j - 1; i >= 0; i--) #define MOD 1000000007 #define M...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22]]
1
1,519
N, K = map(int, input().split()) MOD = 10 ** 9 + 7 ans = 0 ctr = [0] * (N + 1) for x in reversed(range(1, N + 1)): ctr[x] = pow(K // x, N, MOD) for y in range(2 * x, N + 1, x): ctr[x] -= ctr[y] ans = 0 for n in range(1, K + 1): ans += n * ctr[n] ans %= MOD print(ans)
N, K = map(int, input().split()) MOD = 10 ** 9 + 7 ans = 0 ctr = [0] * (K + 1) for x in reversed(range(1, K + 1)): ctr[x] = pow(K // x, N, MOD) for y in range(2 * x, K + 1, x): ctr[x] -= ctr[y] ans = 0 for n in range(1, K + 1): ans += n * ctr[n] ans %= MOD print(ans)
[["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 22], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22]]
5
122
N, K = map(int, input().split()) def func(n): r = n for i in range(2, n + 1): if i ** 2 > n: break if n % i == 0: r -= r // i while n % i == 0: n //= i if n > 1: r -= r // n return r MOD = 10 ** 9 + 7 ans = 0 for i ...
N, K = map(int, input().split()) def func(n): r = n for i in range(2, n + 1): if i ** 2 > n: break if n % i == 0: r -= r // i while n % i == 0: n //= i if n > 1: r -= r // n return r MOD = 10 ** 9 + 7 ans = 0 for i ...
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
122
#include <math.h> #include <stdio.h> int mod = 1000000007; int fanc(long long a, int n) { return n ? (fanc((a * a) % mod, n / 2) * (n % 2 ? a : 1)) % mod : 1; } int main(void) { int a, b, N, K, count; long long sum; long long del[100001]; sum = 0; scanf("%d %d", &K, &N); for (a = N; 0 < a; a--) { cou...
#include <math.h> #include <stdio.h> int mod = 1000000007; int fanc(long long a, int n) { return n ? (fanc((a * a) % mod, n / 2) * (n % 2 ? a : 1)) % mod : 1; } int main(void) { int a, b, N, K, count; long long sum; long long del[100001]; sum = 0; scanf("%d %d", &K, &N); for (a = N; 0 < a; a--) { cou...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
0
201
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << '\n'; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << '\n'; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
[["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]]
1
705
#include <stdio.h> int main() { int a, b, c; int t; scanf("%d", &a); scanf("%d", &b); scanf("%d", &c); t = a; a = b; b = t; t = a; a = c; c = t; printf("%d", a); printf("%d", b); printf("%d", c); return 0; }
#include <stdio.h> int main() { int a, b, c; int t; scanf("%d", &a); scanf("%d", &b); scanf("%d", &c); t = a; a = b; b = t; t = a; a = c; c = t; printf("%d ", a); printf("%d ", b); printf("%d ", c); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
102
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { int A, B, C; cin >> A >> B >> C; cout << C << "" << A << "" << B << endl; }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { int A, B, C; cin >> A >> B >> C; cout << C << " " << A << " " << B << endl; }
[["+", 31, 16, 31, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 16, 31, 16, 31, 16, 12, 5, 0, 6]]
1
57
#include <stdio.h> int main(void) { int a, b, c, x, y, z; scanf("%d%d%d", &a, &b, &c); x = a; y = b; z = c; a = y; b = x; x = a; y = b; a = z; c = x; printf("%d %d %d", &a, &b, &c); return 0; }
#include <stdio.h> int main(void) { int a, b, c, x, y, z; scanf("%d%d%d", &a, &b, &c); x = a; y = b; z = c; a = y; b = x; x = a; y = b; a = z; c = x; printf("%d %d %d", a, b, c); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
93
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } void solve() { int x, y, z; scanf("%d%d%d", &x, &y, &z); printf("%d%d%d", z, x, y)...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } void solve() { int x, y, z; scanf("%d%d%d", &x, &y, &z); printf("%d %d %d", z, x, ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
120
puts `dd`.split.map(&:to_i).rotate(1)*" "
puts (`dd`.split.map &:to_i).rotate(2)*" "
[["+", 3, 4, 0, 738, 31, 652, 486, 739, 0, 24], ["-", 0, 738, 31, 652, 486, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 738, 31, 652, 3, 4, 0, 612], ["+", 3, 4, 0, 738, 31, 652, 3, 4, 0, 612]]
4
21
A,B,C=map(int,input().split()) print (int(C,A,B).split)
A,B,C=map(int,input().split()) print (C,A,B)
[["-", 0, 652, 3, 4, 0, 319, 500, 652, 63, 22], ["-", 3, 4, 0, 319, 500, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 319, 500, 652, 3, 4, 0, 25], ["-", 0, 1, 0, 652, 3, 4, 0, 319, 0, 131], ["-", 0, 1, 0, 652, 3, 4, 0, 319, 319, 22]]
5
31
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); int Z = sc.nextInt(); int A; A = X; X = Y; Y = A; int B; B = X; X = Z; Z = B; System.out.println...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); int Z = sc.nextInt(); int A; A = X; X = Y; Y = A; int B; B = X; X = Z; Z = B; System.out.println...
[["+", 31, 16, 31, 16, 31, 16, 12, 5, 0, 491], ["+", 3, 4, 0, 16, 31, 16, 12, 5, 0, 491]]
3
111