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 |
|---|---|---|---|---|
/*Author - Shubham Gupta (@shubham107)*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define forn(i, n) for (int i = 0; i < n; i++)
#define rforn(... | /*Author - Shubham Gupta (@shubham107)*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define forn(i, n) for (int i = 0; i < n; i++)
#define rforn(... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 350 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define repr... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define repr... | [["-", 341, 342, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 17, 33]] | 1 | 285 |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl '\n'
#define pb push_back
#define PI 3.14159265
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
sor... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define endl '\n'
#define pb push_back
#define PI 3.14159265
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
sor... | [["-", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 108], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 1 | 236 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a.rbegin(), a.rend());
ll sum = 0;
for (int i = 0; i < n - 1; i++)
sum += a[i];
cout << sum... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
sort(a.rbegin(), a.rend());
ll sum = 0;
for (int i = 1; i < n; i++)
sum += a[i / 2];
cout << sum... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 85], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 120 |
from heapq import heapify, heappop, heappush
N,*A=map(int, open(0).read().split())
A=sorted(A, reverse=True)
L=[0]*N
R=[0]*N
ans=0
L[0]=0
R[0]=0
H=[(A[0],0,0)]
heapify(H)
for i in range(1,N):
a=A[i]
p,pl,pr=heappop(H)
ans+=p
L[pr]=i
R[pl]=i
L[i]=pl
R[i]=pr
heappush(H,(min(A[pl],a),pl,i))... | from heapq import heapify, heappop, heappush
N,*A=map(int, open(0).read().split())
A=sorted(A, reverse=True)
L=[0]*N
R=[0]*N
ans=0
L[0]=0
R[0]=0
H=[(-A[0],0,0)]
heapify(H)
for i in range(1,N):
a=A[i]
p,pl,pr=heappop(H)
ans+=-p
L[pr]=i
R[pl]=i
L[i]=pl
R[i]=pr
heappush(H,(-min(A[pl],a),pl,... | [["+", 0, 662, 12, 634, 0, 660, 0, 664, 17, 33], ["+", 8, 196, 0, 1, 0, 677, 12, 664, 17, 33], ["+", 0, 652, 3, 4, 0, 660, 0, 664, 17, 33]] | 5 | 184 |
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = v... | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = v... | [["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 46]] | 1 | 782 |
n = int(input())-2
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = A[0]
for i in range(n//2):
ans += 2*A[i+1]
if n%2 != 0:
ans += A[n//2]
print(ans) | n = int(input())-2
A = list(map(int,input().split()))
A.sort(reverse=True)
ans = A[0]
for i in range(n//2):
ans += 2*A[i+1]
if n%2 != 0:
ans += A[n//2+1]
print(ans) | [["+", 0, 1, 0, 677, 12, 206, 206, 657, 17, 72], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]] | 5 | 80 |
#include <algorithm>
#include <cassert>
#include <iostream>
#include <utility>
#include <vector>
template <unsigned int modulus> struct modInt {
static_assert(modulus > 0, "modulus must be a positive integer.");
int val; // 値本体
// コンストラクタ
constexpr modInt() : val(0) {}
template <class T> constexpr modInt(T ... | #include <algorithm>
#include <cassert>
#include <iostream>
#include <utility>
#include <vector>
template <unsigned int modulus> struct modInt {
static_assert(modulus > 0, "modulus must be a positive integer.");
int val; // 値本体
// コンストラクタ
constexpr modInt() : val(0) {}
template <class T> constexpr modInt(T ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 15, 16, 31, 16, 17, 72], ["-", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 85], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 817 |
#include <bits/stdc++.h>
using namespace std;
int main() {
size_t N;
cin >> N;
vector<long long> A(N);
for (long long &a : A) {
cin >> a;
}
sort(A.begin(), A.end());
long long ans = 0;
for (size_t i = 1; i < N; i++) {
ans += A[i];
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
size_t N;
cin >> N;
vector<long long> A(N);
for (long long &a : A) {
cin >> a;
}
sort(A.rbegin(), A.rend());
// 1 2 3 4 5
// 5: 0
// 5 4: 5
// 5 3 4: 4
// 5 3 4 2: 4
// 5 3 1 4 2: 3
// 0 1 2 3 4 5
// 5: 0
// 5 4: 5
// 5 3... | [["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 85], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 94 |
import sys
sys.setrecursionlimit(10 ** 7)
#import bisect
#import numpy as np
# from collections import deque
from collections import deque
# map(int, sys.stdin.read().split())
import itertools
import heapq
def input():
return sys.stdin.readline().rstrip()
def main():
N = int(input())
A = list(map(lambda ... | import sys
sys.setrecursionlimit(10 ** 7)
#import bisect
#import numpy as np
# from collections import deque
from collections import deque
# map(int, sys.stdin.read().split())
import itertools
import heapq
def input():
return sys.stdin.readline().rstrip()
def main():
N = int(input())
A = list(map(lambda ... | [["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 165 |
#include <bits/stdc++.h>
#ifdef DEBUG
#define PRINT(x) \
cout << "func " << __func__ << ": line " << __LINE__ << ": " << #x << " = " \
<< (x) << endl;
#define PRINTA(a, first, last) \
cout << "func... | #include <bits/stdc++.h>
#ifdef DEBUG
#define PRINT(x) \
cout << "func " << __func__ << ": line " << __LINE__ << ": " << #x << " = " \
<< (x) << endl;
#define PRINTA(a, first, last) \
cout << "func... | [["-", 12, 69, 341, 342, 0, 16, 31, 23, 0, 24], ["-", 341, 342, 0, 16, 31, 23, 0, 16, 17, 72], ["-", 341, 342, 0, 16, 31, 23, 0, 16, 12, 13], ["-", 12, 69, 341, 342, 0, 16, 31, 23, 0, 25]] | 1 | 393 |
#include <bits/stdc++.h>
#define fo(i, a, b) for (int i = a; i <= b; i++)
#define fod(i, a, b) for (int i = a; i >= b; i--)
#define me0(a) memset(a, 0, sizeof(a))
#define me1(a) memset(a, -1, sizeof(a))
#define op freopen("in.txt", "r", stdin)
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace ... | #include <bits/stdc++.h>
#define fo(i, a, b) for (int i = a; i <= b; i++)
#define fod(i, a, b) for (int i = a; i >= b; i--)
#define me0(a) memset(a, 0, sizeof(a))
#define me1(a) memset(a, -1, sizeof(a))
#define op freopen("in.txt", "r", stdin)
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace ... | [["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 47], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 17, 18]] | 1 | 446 |
/*
-------------- | /
| | /
| | /
| * |/ | | ------ *
| | | | / \
| | |\ | | | |\ |
\ ... | /*
-------------- | /
| | /
| | /
| * |/ | | ------ *
| | | | / \
| | |\ | | | |\ |
\ ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 209 |
N = int(input())
A = list(map(int,input().split()))
A.sort()
print(sum(A[N//2:])*2-A[-1]-(N%2)*A[0]) | N = int(input())
A = list(map(int,input().split()))
A.sort()
print(sum(A[N//2:])*2-A[-1]-(N%2)*A[N//2]) | [["-", 3, 4, 0, 657, 12, 657, 12, 206, 206, 612], ["+", 0, 657, 12, 657, 12, 206, 206, 657, 31, 22], ["+", 0, 657, 12, 657, 12, 206, 206, 657, 17, 676], ["+", 0, 657, 12, 657, 12, 206, 206, 657, 12, 612]] | 5 | 62 |
#include <algorithm>
#include <chrono>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <time.h>
#include <tuple>
#include <vector>
#ifdef _MSC_VER
#include <intrin... | #include <algorithm>
#include <chrono>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <time.h>
#include <tuple>
#include <vector>
#ifdef _MSC_VER
#include <intrin... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 147], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 146], ["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]] | 1 | 277 |
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
ans = sum(A[:N // 2]) * 2 - A[0]
if N % 2 == 1:
ans += A[N % 2]
print(ans) | N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
ans = sum(A[:N // 2]) * 2 - A[0]
if N % 2 == 1:
ans += A[N // 2]
print(ans) | [["-", 0, 1, 0, 677, 12, 206, 206, 657, 17, 109], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 17, 676]] | 5 | 71 |
N = int(input())
A_s = list(map(int, input().split()))
A_s = list(reversed(sorted(A_s)))
answer = 0
for i in range(N-1):
answer += A_s[i+1//2]
print (answer) | N = int(input())
A_s = list(map(int, input().split()))
A_s = list(reversed(sorted(A_s)))
answer = 0
for i in range(N-1):
answer += A_s[int(i+1)//2]
print (answer) | [["+", 0, 677, 12, 206, 206, 657, 31, 652, 63, 22], ["+", 12, 206, 206, 657, 31, 652, 3, 4, 0, 24], ["+", 12, 206, 206, 657, 31, 652, 3, 4, 0, 25]] | 5 | 64 |
#include <bits/stdc++.h>
using namespace std;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
using ll = long long;
using P = pair<int, int>;
const i... | #include <bits/stdc++.h>
using namespace std;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
using ll = long long;
using P = pair<int, int>;
const i... | [["+", 12, 69, 341, 342, 0, 16, 31, 23, 0, 24], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 12, 69, 341, 342, 0, 16, 31, 23, 0, 25], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 85], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 244 |
// +build ignore
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
)
func solve(sc *scanner, wr *bufio.Writer) int {
N := sc.i()
ans := map[int]int{}
nmax := 10050
for x := 1; x*x <= 105; x++ {
for y := 1; (x*x + y*y + x*y) <= 105; y++ {
for z := 1; x*x+y*y+z*z+x*y+y*z+x*z <= 105; z++ {
v :=... | // +build ignore
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
)
func solve(sc *scanner, wr *bufio.Writer) int {
N := sc.i()
ans := map[int]int{}
nmax := 10050
for x := 1; x*x <= nmax; x++ {
for y := 1; (x*x + y*y + x*y) <= nmax; y++ {
for z := 1; x*x+y*y+z*z+x*y+y*z+x*z <= nmax; z++ {
v... | [["-", 8, 196, 0, 7, 0, 430, 15, 16, 12, 433], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 12, 22]] | 7 | 587 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
N = int(input())
ans = [0] * (6 * 10**4 + 10)
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
ans[x**2 + y**2 + z**2 + x * y + y * z + x * z] += 1
for i in range(N):
print(an... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def main():
N = int(input())
ans = [0] * (6 * 10**4 + 10)
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
ans[x**2 + y**2 + z**2 + x * y + y * z + x * z - 1] += 1
for i in range(N):
prin... | [["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 113 |
import collections
import sys
A = []
n = int(input())
for i in range(1,35):
for j in range(1,35):
for k in range(1,35):
A.append(i**2+j**2+k**2+i*j+j*k+k*i)
c = collections.Counter(A)
for x in range(1,n+1):
print(c[x])
sys.exit() | import collections
import sys
A = []
n = int(input())
for i in range(1,100):
for j in range(1,100):
for k in range(1,100):
A.append(i**2+j**2+k**2+i*j+j*k+k*i)
c = collections.Counter(A)
for x in range(1,n+1):
print(c[x])
sys.exit()
| [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 106 |
N = int(input())
ans = [0 for _ in range(N+1)]
for x in range(1, 101):
for y in range(x, 101):
for z in range(y, 101):
v = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
if v < N:
if x == y == z:
ans[v] += 1
elif x == y or x == z... | N = int(input())
ans = [0 for _ in range(N+1)]
for x in range(1, 101):
for y in range(x, 101):
for z in range(y, 101):
v = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
if v < N+1:
if x == y == z:
ans[v] += 1
elif x == y or x ==... | [["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 141 |
#include <bits/stdc++.h>
using namespace std;
int i, n, k, j, u;
int a[1010];
int main() {
cin >> n;
for (i = 1; i < sqrt(n); i++) {
for (j = 1; j < sqrt(n); j++) {
for (k = 1; k < sqrt(n); k++) {
u = pow(i, 2) + pow(j, 2) + pow(k, 2) + i * j + i * k + j * k;
if (u <= n)
a[u]++;
... | #include <bits/stdc++.h>
using namespace std;
int i, n, k, j, u;
int a[10010];
int main() {
cin >> n;
for (i = 1; i < sqrt(n); i++) {
for (j = 1; j < sqrt(n); j++) {
for (k = 1; k < sqrt(n); k++) {
u = pow(i, 2) + pow(j, 2) + pow(k, 2) + i * j + i * k + j * k;
if (u <= n)
a[u]++;... | [["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13]] | 1 | 159 |
#include <bits/stdc++.h>
#define MAX 10001
using namespace std;
using ll = long long;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int d[MAX];
for (int i = 1; i <= 100; ++i) {
for (int j = 1; j <= 100; ++j) {
for (int k = 1; k <= 100; ++k) {
int v = i * i +... | #include <bits/stdc++.h>
#define MAX 10001
using namespace std;
using ll = long long;
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int d[MAX] = {};
for (int i = 1; i <= 100; ++i) {
for (int j = 1; j <= 100; ++j) {
for (int k = 1; k <= 100; ++k) {
int v = i ... | [["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46]] | 1 | 167 |
#include <bits/stdc++.h>
using namespace std;
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
#define ft first
#define sd second
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin, (x).rend()
typ... | #include <bits/stdc++.h>
using namespace std;
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'
#define ft first
#define sd second
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin, (x).rend()
typ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 250 |
#C
n = int(input())
f = [0 for _ in range(10**5)]
for i in range(1,60):
for j in range(1,60):
for k in range(1,60):
f[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1
for l in range(n):
print(f[l+1]) | #C
n = int(input())
f = [0 for _ in range(10**5)]
for i in range(1,105):
for j in range(1,105):
for k in range(1,105):
f[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1
for l in range(n):
print(f[l+1]) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 98 |
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
vector<int> result(N + 1);
for (int x = 1; x < 101; x++) {
for (int y = 1; y < 101; y++) {
for (int z = 1; z < 101; z++) {
int n = x * x +... | #include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
vector<int> result(N + 1);
for (int x = 1; x < 101; x++) {
for (int y = 1; y < 101; y++) {
for (int z = 1; z < 101; z++) {
int n = x * x +... | [["-", 0, 1, 0, 27, 28, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 27, 28, 69, 341, 342, 0, 22]] | 1 | 160 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ans(n + 1);
for (int i = 1; i <= 100; i++) {
for (int j = i; j <= 100; j++) {
for (int k = j; k <= 100; k++) {
int x = (i * i) + (j * j) + (k * k) + (i * j) + (j * k) + (k * i);
if (x > n)
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ans(n + 1);
for (int i = 1; i <= 100; i++) {
for (int j = 1; j <= 100; j++) {
for (int k = 1; k <= 100; k++) {
int x = (i * i) + (j * j) + (k * k) + (i * j) + (j * k) + (k * i);
if (x > n)
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 156 |
/* written by : vipin kumar */
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <unordered_set>
using namespace std;
#include <vector>
#define int long long int
#define mod 1000000007
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
... | /* written by : vipin kumar */
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <unordered_set>
using namespace std;
#include <vector>
#define int long long int
#define mod 1000000007
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
... | [["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 20,092 |
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma region Macros
/***
* @author uesugi
* @file AtCoder用テンプレート
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
#define _OVERLOAD3(_1, _2, _3, name, ...) name
#define _REP(i, n) REPI(... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma region Macros
/***
* @author uesugi
* @file AtCoder用テンプレート
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
#define _OVERLOAD3(_1, _2, _3, name, ...) name
#define _REP(i, n) REPI(... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 17, 33], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13]] | 1 | 20,538 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, k;
cin >> n;
vector<int> v(n, 0);
for (int x = 1; x < 101; x++) {
for (int y = 1; y < 101; y++) {
for (int z = 1; z < 101; z++) {
k = (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (x * z);
if ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, k;
cin >> n;
vector<int> v(n, 0);
for (int x = 1; x < 101; x++) {
for (int y = 1; y < 101; y++) {
for (int z = 1; z < 101; z++) {
k = (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (x * z);
if ... | [["+", 0, 27, 28, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 12, 13]] | 1 | 153 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vec vector<ll>
#define fl(i, from, to) for (ll i = from; i <= to; i++)
#define um unordered_map<ll, ll>
#define pa pair<ll, ll>
#define pb push_back
#define ff first
#define ss second
#define mod 1000000004
#define start ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vec vector<ll>
#define fl(i, from, to) for (ll i = from; i <= to; i++)
#define um unordered_map<ll, ll>
#define pa pair<ll, ll>
#define pb push_back
#define ff first
#define ss second
#define mod 1000000004
#define start ... | [["-", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13]] | 1 | 170 |
ans = [0 for _ in range(10001)]
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
w = x*x + y*y + z*z + x*y + y*z + z*x
if w <= 10000:
ans[w] += 1
print(*ans[1:int(input())], sep="\n") | ans = [0 for _ in range(10001)]
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
w = x*x + y*y + z*z + x*y + y*z + z*x
if w <= 10000:
ans[w] += 1
print(*ans[1:int(input())+1], sep="\n") | [["+", 3, 4, 0, 206, 206, 663, 0, 657, 17, 72], ["+", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]] | 5 | 99 |
N = int(input())
ans = [0]*10050
for i in range(1,105):
for j in range(1,105):
for k in range(1,105):
v = i**2 + j**2 + k**2 + i*j + j*k + k*i
if v < 10050:
ans[v] += 1
for i in range(N+1):
print(ans[i+1])
| N = int(input())
ans = [0]*10050
for i in range(1,105):
for j in range(1,105):
for k in range(1,105):
v = i**2 + j**2 + k**2 + i*j + j*k + k*i
if v < 10050:
ans[v] += 1
for i in range(N):
print(ans[i+1]) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 100 |
ans = [0 for i in range(10050)]
for i in range(1, 105):
for j in range(1, 105):
for k in range(1, 105):
v = i**2 + j**2 + k**2 + i*j + j*k + i*k
if v < 10050:
ans[v] +1
n = int(input())
for i in range(n):
print(ans[i+1])
| ans = [0 for i in range(10050)]
for i in range(1, 105):
for j in range(1, 105):
for k in range(1, 105):
v = i**2 + j**2 + k**2 + i*j + j*k + i*k
if v < 10050:
ans[v]+=1
n = int(input())
for i in range(n):
print(ans[i+1])
| [["-", 0, 57, 64, 196, 0, 1, 0, 657, 17, 72], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 17, 107]] | 5 | 103 |
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
var N int
fmt.Scan(&N)
ans := make([]int, 10001)
for x := 1; x <= 100; x++ {
for y := 1; y <= 100; y++ {
for z := 1; z <= 100; z++ {
tmp := x*x + y*y + z*z + x*y + y*z + z*x
if tmp < N {
ans[tmp]++
}
}
}
}
w := bufio.NewWrite... | package main
import (
"bufio"
"fmt"
"os"
)
func main() {
var N int
fmt.Scan(&N)
ans := make([]int, 10001)
for x := 1; x <= 100; x++ {
for y := 1; y <= 100; y++ {
for z := 1; z <= 100; z++ {
tmp := x*x + y*y + z*z + x*y + y*z + z*x
if tmp <= N {
ans[tmp]++
}
}
}
}
w := bufio.NewWrit... | [["-", 0, 7, 8, 196, 0, 57, 15, 16, 17, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 16, 17, 19]] | 7 | 173 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long long ll;
typedef long double ld;
int main() {
int t = 1;
// cin>>t;
while (t--) {
int n;
cin >> n;
int a[n + 1] = {0};
for (int i = 1; i <= 100; i++) {
for (int j = 1; j <= 100; j++) {
for (int k ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long long ll;
typedef long double ld;
int main() {
int t = 1;
// cin>>t;
while (t--) {
int n;
cin >> n;
int a[n + 1] = {0};
for (int i = 1; i <= 100; i++) {
for (int j = 1; j <= 100; j++) {
for (int k ... | [["-", 64, 1, 0, 27, 28, 69, 341, 342, 0, 22], ["+", 64, 1, 0, 27, 28, 69, 341, 342, 0, 22]] | 1 | 175 |
#include <bits/stdc++.h>
using namespace std;
long f(long x, long y, long z) {
return x * x + y * y + z * z + x * y + y * z + z * x;
}
int main() {
long n;
cin >> n;
vector<long> ans(n + 3, 0);
bool xflag = false, yflag = false;
for (long x = 1;; x++) {
for (long y = x;; y++) {
for (long z = y;... | #include <bits/stdc++.h>
using namespace std;
long f(long x, long y, long z) {
return x * x + y * y + z * z + x * y + y * z + z * x;
}
int main() {
long n;
cin >> n;
vector<long> ans(n + 3, 0);
bool xflag = false, yflag = false;
for (long x = 1;; x++) {
for (long y = x;; y++) {
for (long z = y;... | [["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 98]] | 1 | 259 |
import numpy as np
n = int(input())
res = [0]*(n+1)
for i in range(1,100):
for j in range(1,100):
for k in range(1,100):
x = i*i + j*j + k*k + i*j + j*k + k*i
if x <= n:
res[x] += 1
for i in range(1,n):
print(res[i])
| import numpy as np
n = int(input())
res = [0]*(n+1)
for i in range(1,101):
for j in range(1,101):
for k in range(1,101):
x = i*i + j*j + k*k + i*j + j*k + k*i
if x <= n:
res[x] += 1
for i in range(1,n+1):
print(res[i])
| [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 106 |
#include <cmath>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int n, k, m, d;
cin >> n;
k = 2 * n / 3;
m = sqrt(k);
int a[n + 1] = {0};
if (m == 0) {
cout << "0" << endl;
return 0;
}
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= m; j++) {
for (int l = 1... | #include <cmath>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int n, k, m, d;
cin >> n;
k = 2 * n / 3;
m = sqrt(k);
int a[n + 1] = {0};
if (m == 0) {
cout << "0" << endl;
return 0;
}
for (int i = 1; i <= 105; i++) {
for (int j = 1; j <= 105; j++) {
for (int l... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 224 |
N = int(input())
ans = [0]*(N+1)
i = 102
for x in range(1,i):
for y in range(1,i):
for z in range(1,i):
total = (x + y + z)**2 - (x*y + y*z + x*z)
if total <= N+1:
ans[total] += 1
for i in range(1,N+1):
print(ans[i]) | N = int(input())
ans = [0]*(N+1)
i = 102
for x in range(1,i):
for y in range(1,i):
for z in range(1,i):
total = (x + y + z)**2 - (x*y + y*z + x*z)
if total <= N:
ans[total] += 1
for i in range(1,N+1):
print(ans[i]) | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 109 |
n = int(input())
ANS = [0] * (n)
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
tmp = (x + y + z)**2 - z*(x + y) - (x*y)
if tmp > n: continue
ANS[tmp] += 1
for ans in ANS[1:]:
print(ans)
| n = int(input())
ANS = [0] * (n+1)
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
tmp = (x + y + z)**2 - z*(x + y) - (x*y)
if tmp > n: continue
ANS[tmp] += 1
for ans in ANS[1:]:
print(ans) | [["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612]] | 5 | 97 |
#include <bits/stdc++.h>
using namespace std;
const int N = 10010;
int n;
int ans[N];
int main() {
cin >> n;
int ceil = sqrt(n / 2) + 1;
for (int x = 1; x <= ceil; x++)
for (int y = 1; y <= ceil; y++)
for (int z = 1; z <= ceil; z++) {
int tmp = x * x + y * y + z * z + x * y + x * z + y * z;
... | #include <bits/stdc++.h>
using namespace std;
const int N = 10010;
int n;
int ans[N];
int main() {
cin >> n;
int ceil = sqrt(n);
for (int x = 1; x <= ceil; x++)
for (int y = 1; y <= ceil; y++)
for (int z = 1; z <= ceil; z++) {
int tmp = x * x + y * y + z * z + x * y + x * z + y * z;
... | [["-", 51, 16, 31, 2, 3, 4, 0, 16, 17, 85], ["-", 51, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 152 |
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
int N;
cin >> N;
int x, y, z;
vector<int> vec(N);
for (int x = 1; x <= 100; x++) {
for (int y = 1; y <= 100; y++) {
for (int z = 1; z <= 100; z++) {
int a = x * x + y * y + z * z + x * y +... | #include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
int N;
cin >> N;
int x, y, z;
vector<int> vec(N + 1);
for (int x = 1; x <= 100; x++) {
for (int y = 1; y <= 100; y++) {
for (int z = 1; z <= 100; z++) {
int a = x * x + y * y + z * z + x *... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 153 |
N = int(input())
f = {}
for x in range(1, 110):
for y in range(1, 110):
for z in range(1, 110):
t = x*x+y*y+z*z+x*y+y*z+z*x
f[t] = (f[t]+1 if t in f.keys() else 1)
for i in range(i,N+1):
print(f[i] if i in f.keys() else 0) | N = int(input())
f = {}
for x in range(1, 110):
for y in range(1, 110):
for z in range(1, 110):
t = x*x+y*y+z*z+x*y+y*z+z*x
f[t] = (f[t]+1 if t in f.keys() else 1)
for i in range(1,N+1):
print(f[i] if i in f.keys() else 0) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 119 |
nn = gets.chomp.to_i
count = Array.new(nn + 1, 0)
(1..22).each do |x|
(1..22).each do |y|
(1..22).each do |z|
m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
count[m] ||= 0
count[m] += 1
end
end
end
(1..nn).each do |n|
puts count[n]
end
| nn = gets.chomp.to_i
count = Array.new(nn + 1, 0)
(1..100).each do |x|
(1..100).each do |y|
(1..100).each do |z|
m = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
count[m] ||= 0
count[m] += 1
end
end
end
(1..nn).each do |n|
puts count[n]
end | [["-", 0, 493, 0, 652, 486, 739, 0, 475, 444, 612], ["+", 0, 493, 0, 652, 486, 739, 0, 475, 444, 612], ["-", 8, 736, 0, 652, 486, 739, 0, 475, 444, 612], ["+", 8, 736, 0, 652, 486, 739, 0, 475, 444, 612]] | 4 | 109 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
// memo fixed setprecision(20);
using vvll = vector<vector<ll>>;
ll mod = 1e9 + 7;
/*"itob" int to "N"base */ template <typename TypeInt>
string itob(const TypeInt v, int base) {
static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
// memo fixed setprecision(20);
using vvll = vector<vector<ll>>;
ll mod = 1e9 + 7;
/*"itob" int to "N"base */ template <typename TypeInt>
string itob(const TypeInt v, int base) {
static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, ... | 1 | 613 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) rep2(i, 0, n)
#define INF (1LL << 60)
vector<ll> a;
ll n;
ll solve(ll x, ll y, ll z) {
ll sum = (x * x + y * y + z * z + x * y + y * z + z * x);
if (sum > n)
return 0;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep2(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) rep2(i, 0, n)
#define INF (1LL << 60)
vector<ll> a;
ll n;
ll solve(ll x, ll y, ll z) {
ll sum = (x * x + y * y + z * z + x * y + y * z + z * x);
if (sum > n)
return 0;
... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["-", 0, 7, 15, 16, 31, 16, 31, 16, 31, 22], ["-", 0, 7, 15, 16, 31, 16, 31, 16, 17, 48]] | 1 | 263 |
#include <stdio.h>
int main(void) {
long long x, y, z, N;
long long tmp, count[1000];
scanf("%lld", &N);
for (int i = 0; i < N; i++)
count[i] = 0;
// z >= y >= x とする
for (z = 1; z < 100; z++) {
for (y = 1; y <= z; y++) {
for (x = 1; x <= y; x++) {
tmp = x * x + y * y + z * z + x ... | #include <stdio.h>
int main(void) {
long long x, y, z, N;
long long tmp, count[10000];
scanf("%lld", &N);
for (int i = 0; i < N; i++)
count[i] = 0;
// z >= y >= x とする
for (z = 1; z < 100; z++) {
for (y = 1; y <= z; y++) {
for (x = 1; x <= y; x++) {
tmp = x * x + y * y + z * z + x... | [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13]] | 0 | 229 |
import math
N = int(input())
ans = [0] * (N + 1)
for i in range(1, int(math.sqrt(N)) + 1):
for j in range(1, int(math.sqrt(N)) + 1):
for k in range(1, int(math.sqrt(N)) + 1):
v = i * i + j * j + k * k + i * j + j * k + k * i
if v < N:
ans[v] += 1
for i in range(1,... | import math
N = int(input())
ans = [0] * (N + 1)
for i in range(1, int(math.sqrt(N)) + 1):
for j in range(1, int(math.sqrt(N)) + 1):
for k in range(1, int(math.sqrt(N)) + 1):
v = i * i + j * j + k * k + i * j + j * k + k * i
if v <= N:
ans[v] += 1
for i in range(1... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 136 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include... | [["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]] | 1 | 450 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memse... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memse... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 233 |
N = int(input())
from collections import defaultdict
ans = defaultdict(int)
for a in range(101):
for b in range(101):
for c in range(101):
ans[a**2 + b**2 + c**2 + a*b + a*c + b*c] += 1
for n in range(1,N+1):
print(ans[n]) | N = int(input())
from collections import defaultdict
ans = defaultdict(int)
for a in range(1,101):
for b in range(1,101):
for c in range(1,101):
ans[a**2 + b**2 + c**2 + a*b + a*c + b*c] += 1
for n in range(1,N+1):
print(ans[n])
| [["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21]] | 5 | 89 |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n + 1, 0);
for (int i = 1; i < 101; i++) {
for (int j = 1; j < 101; j++) {
for (int k = 1; k < 101; k++) {
int ans = i * i + j * j + k * k + i * j + j * k + k * i;
if (ans > n)
... | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> arr(n + 1, 0);
for (int i = 1; i < 101; i++) {
for (int j = 1; j < 101; j++) {
for (int k = 1; k < 101; k++) {
int ans = i * i + j * j + k * k + i * j + j * k + k * i;
if (ans > n)
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 146 |
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;
const vector<LLONG> Comp(const LLONG n) {
vector<LLONG> ret(n... | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;
const vector<LLONG> Comp(const LLONG n) {
vector<LLONG> ret(n... | [["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 21], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 27, 28, 69, 341, 342, 0, 16, 31, 22], ["+", 0, 27, 28, 69, 341, 342, 0, 16, 31, 22]] | 1 | 206 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
int ans = 0;
for (int j = 1; j <= 70; j++) {
for (int k = 1; k <= 70; k++) {
int rest = i - j * j - k * k - j * k;
int a = -1 * (k + j) + sqrt((k + j) * (k + j) + 4 * rest);
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
int ans = 0;
for (int j = 1; j <= 100; j++) {
for (int k = 1; k <= 100; k++) {
int rest = i - j * j - k * k - j * k;
int a = -1 * (k + j) + sqrt((k + j) * (k + j) + 4 * rest);... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 266 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < (N); i++)
int main() {
int N;
cin >> N;
vector<int> ans(N);
for (int x = 1; x <= ceil(sqrt(N)); x++) {
for (int y = 1; y <= ceil(sqrt(N)); y++) {
for (int z = 1; z <= ceil(sqrt(N)); z++) {
int n = pow(x + y,... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < (N); i++)
int main() {
int N;
cin >> N;
vector<int> ans(60001);
for (int x = 1; x <= ceil(sqrt(N)); x++) {
for (int y = 1; y <= ceil(sqrt(N)); y++) {
for (int z = 1; z <= ceil(sqrt(N)); z++) {
int n = pow(x ... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]] | 1 | 164 |
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0), ios::sync_with_stdio(false);
int n;
cin >> n;
unordered_map<int, int> m;
for (int x = 1; x < 100; ++x) {
for (int y = x; y < 100; ++y) {
for (int z = y; z < 100; ++z) {
int sum = x * x + y * y + z * z + x * y + y * z + z... | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0), ios::sync_with_stdio(false);
int n;
cin >> n;
unordered_map<int, int> m;
for (int x = 1; x < 100; ++x) {
for (int y = x; y < 100; ++y) {
for (int z = y; z < 100; ++z) {
int sum = x * x + y * y + z * z + x * y + y * z + z... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 75, 76, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 107]] | 1 | 195 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int, int>;
int main(void) {
int N;
cin >> N;
vector<int> ans(N + 1);
for (int x = 1; x <= 101; x++) {
for (int y = 1; y <= 101; y++) {
for (int z = 1; z <= 101; z++) {
int tmp = x * x + y * y + z * z + x * y + ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int, int>;
int main(void) {
int N;
cin >> N;
vector<int> ans(200000);
for (int x = 1; x <= 101; x++) {
for (int y = 1; y <= 101; y++) {
for (int z = 1; z <= 101; z++) {
int tmp = x * x + y * y + z * z + x * y +... | [["-", 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], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]] | 1 | 155 |
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
f = [0] * (N+1)
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
tmp = x*x + y*y + z*z + x*y + y*z + z*x - 1
... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
f = [0] * (N+1)
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
tmp = x*x + y*y + z*z + x*y + y*z + z*x
if... | [["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 3, 4, 0, 652, 3, 4, 0, 206, 0, 70], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 102], ["+", 3, 4, 0, 652, 3, 4, 0, 206, 0, 73]] | 5 | 142 |
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
f = [0] * (N+1)
for x in range(1,50):
for y in range(1,50):
for z in range(1,50):
tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
if... | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
def main():
N = int(readline())
f = [0] * (N+1)
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
... | [["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 143 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define sre... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define sre... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 812 |
import sys
import collections
n = int(sys.stdin.readline().rstrip("\n"))
l = []
for a in range(1,43):
for b in range(1,43):
for c in range(1,43):
l.append(a**2+b**2+c**2+a*b+b*c+c*a)
c = collections.Counter(l)
for i in range(1,n+1):
print(c[i]) | import sys
import collections
n = int(sys.stdin.readline().rstrip("\n"))
l = []
for a in range(1,100):
for b in range(1,100):
for c in range(1,100):
l.append(a**2+b**2+c**2+a*b+b*c+c*a)
c = collections.Counter(l)
for i in range(1,n+1):
print(c[i]) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 112 |
// cd Desktop/Prog_Contest
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define rep(i, n) for (i = 0; i < (n); i++)
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
int keisan(int x, int y, int z) {
return (x + y) * (x + y) + (y + z) * (y + z) + (z + x) * (z... | // cd Desktop/Prog_Contest
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define rep(i, n) for (i = 0; i < (n); i++)
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
int keisan(int x, int y, int z) {
return (x + y) * (x + y) + (y + z) * (y + z) + (z + x) * (z... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 75, 76, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 57, 64, 1, 0, 11, 17, 107]] | 0 | 312 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end())
template <class T> void printArray(vector<T> arr) {
for (T a : arr)
cout << a << " ";
cout << '\n';
}
void printVerdict(bool verdict) { cout ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end())
template <class T> void printArray(vector<T> arr) {
for (T a : arr)
cout << a << " ";
cout << '\n';
}
void printVerdict(bool verdict) { cout ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 288 |
import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
N = int(input())
ans = [0] * (1000 + 1)
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
if x * x + y * y + z * z + x * y + y * z + z * x >= 1001:
... | import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
N = int(input())
ans = [0] * (10000 + 1)
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
if x * x + y * y + z * z + x * y + y * z + z * x >= 10001:
... | [["-", 0, 662, 12, 657, 12, 23, 0, 657, 31, 612], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 31, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]] | 5 | 156 |
#include <bits/stdc++.h>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(); \
cout.tie();
#define MAXX 30... | #include <bits/stdc++.h>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(); \
cout.tie();
#define MAXX 50... | [["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 43, 49, 50, 49, 80, 81, 16, 31, 22], ["-", 0, 43, 49, 50, 49, 80, 81, 16, 17, 72], ["-", 0, 43, 49, 50, 49, 80, 81, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 22]] | 1 | 156 |
import math
n = int(input())
ans = [0 for _ in range(10001)]
for i in range(1,math.ceil(math.sqrt(n))):
for j in range(1,math.ceil(math.sqrt(n))):
for k in range(1,math.ceil(math.sqrt(n))):
v = i**2 + j**2 + k**2 + i*j + j*k + k*i
if(v < 10001):
ans[v] += 1
for i ... | import math
n = int(input())
ans = [0 for _ in range(10001)]
for i in range(1,math.ceil(math.sqrt(n))):
for j in range(1,math.ceil(math.sqrt(n))):
for k in range(1,math.ceil(math.sqrt(n))):
v = i**2 + j**2 + k**2 + i*j + j*k + k*i
if(v < 10001):
ans[v] += 1
for i ... | [["+", 0, 652, 3, 4, 0, 206, 206, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 206, 206, 657, 12, 612]] | 5 | 135 |
n = int(input())
ans = [0 for i in range(1001)]
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
if x*x + y*y + z*z + x*y + x*z + y*z < n:
ans[x*x + y*y + z*z + x*y + x*z + y*z] += 1
else:
break
for i in range(1,n+1):
print(ans[i]... | n = int(input())
ans = [0 for i in range(10001)]
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
if x*x + y*y + z*z + x*y + x*z + y*z <= 10000:
ans[x*x + y*y + z*z + x*y + x*z + y*z] += 1
else:
break
for i in range(1,n+1):
print(... | [["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]] | 5 | 127 |
import itertools
N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5)+1)),repeat=3):
val = x*x + y*y + z*z + x*y + y*z + z*x
if val <= N-1:
lst[val-1] += 1
print(*lst,sep="\n")
| import itertools
N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
val = x*x + y*y + z*z + x*y + y*z + z*x
if val <= N:
lst[val-1] += 1
print(*lst,sep="\n") | [["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 3, 4, 0, 652, 3, 4, 0, 657, 12, 612], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 33], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 101 |
import math
from queue import PriorityQueue
from sys import stdin,stdout
from collections import defaultdict
def solve():
n=int(input())
ans=[0 for _ in range(20005)]
for i in range(1,101):
for j in range(1,101):
for k in range(1,101):
v=i*i+j*j+k*k+i*j+k*j+k*i
ans[v]+=1
for i in range(n):
print(ans... | import math
from queue import PriorityQueue
from sys import stdin,stdout
from collections import defaultdict
def solve():
n=int(input())
ans=[0 for _ in range(200050)]
for i in range(1,101):
for j in range(1,101):
for k in range(1,101):
v=i*i+j*j+k*k+i*j+k*j+k*i
... | [["-", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612]] | 5 | 130 |
n = int(input())
memo = [0]*1010
for i in range(1, 101):
for j in range(1, 101):
for k in range(1, 101):
z = i**2+j**2+k**2+i*j+j*k+k*i
if z <= n:
memo[z] += 1
for i in range(1, n+1):
print(memo[i]) | n = int(input())
memo = [0]*10010
for i in range(1, 101):
for j in range(1, 101):
for k in range(1, 101):
z = i**2+j**2+k**2+i*j+j*k+k*i
if z <= n:
memo[z] += 1
for i in range(1, n+1):
print(memo[i]) | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 100 |
n = int(input())
a = list(map(int, input().split()))
a=sorted(a,reverse=True)
ans=0
for i in range(n-1):
if i<n//2+1:
ans+=a[i]
else:
ans+=a[i-n//2]
print(ans)
| n = int(input())
a = list(map(int, input().split()))
a=sorted(a,reverse=True)
ans=0
for i in range(n-1):
if i<n//2:
ans+=a[i]
else:
ans+=a[i-n//2+1]
print(ans) | [["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 17, 72], ["+", 0, 1, 0, 677, 12, 206, 206, 657, 12, 612]] | 5 | 79 |
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)... | import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)... | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612], ["-", 8, 196, 0, 57, 75, 665, 15, 666, 0, 612], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 0, 612]] | 5 | 111 |
#include <bits/stdc++.h>
#include <type_traits>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (in... | #include <bits/stdc++.h>
#include <type_traits>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (in... | [["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 1 | 493 |
/*
// // //\\\\\\\\\
\\ // \\ \\
// // // \\
\\ // \\ \\
// // ... | /*
// // //\\\\\\\\\
\\ // \\ \\
// // // \\
\\ // \\ \\
// // ... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 75, 76, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 566 |
#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> a;
long long solve();
int main() {
cin >> n;
a.resize(n);
for (auto &p : a)
cin >> p;
sort(a.begin(), a.end());
cout << solve() << endl;
return 0;
}
long long solve() {
long long id = n - 2, x = n - 2, res = a[n - 1];
w... | #include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> a;
long long solve();
int main() {
cin >> n;
a.resize(n);
for (auto &p : a)
cin >> p;
sort(a.begin(), a.end());
cout << solve() << endl;
return 0;
}
long long solve() {
long long id = n - 2, x = n - 2, res = a[n - 1];
w... | [["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 1 | 140 |
#include <bits/stdc++.h>
#define MAX (ll)(1e3 + 7)
#define INF (ll)(1e18)
#define MOD (ll)(1e9 + 7)
using namespace std;
using ll = long long;
using cd = complex<double>;
int main() {
ll n;
cin >> n;
ll ar[n];
for (ll i = 0; i < n; i++) {
cin >> ar[i];
}
sort(ar, ar + n);
ll ss = ar[n - 1], c = 1, r... | #include <bits/stdc++.h>
#define MAX (ll)(1e3 + 7)
#define INF (ll)(1e18)
#define MOD (ll)(1e9 + 7)
using namespace std;
using ll = long long;
using cd = complex<double>;
int main() {
ll n;
cin >> n;
ll ar[n];
for (ll i = 0; i < n; i++) {
cin >> ar[i];
}
sort(ar, ar + n);
ll ss = ar[n - 1], c = 0, r... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13]] | 1 | 141 |
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <=... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <=... | [["+", 0, 52, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]] | 1 | 296 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define vi vector<long long>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
usin... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define vi vector<long long>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
usin... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 1,227 |
import heapq
n = int(input())
data = list(map(int, input().split()))
data.sort(reverse=True)
q = []
heapq.heappush(q, data[1])
heapq.heappush(q, data[1])
result = data[0]
for i in range(2, n):
result += heapq.heappop(q)
heapq.heappush(q, data[i])
heapq.heappush(q, data[i])
print(result) | import heapq
n = int(input())
data = list(map(int, input().split()))
data.sort(reverse=True)
q = []
heapq.heappush(q, -data[1])
heapq.heappush(q, -data[1])
result = data[0]
for i in range(2, n):
result += -heapq.heappop(q)
heapq.heappush(q, -data[i])
heapq.heappush(q, -data[i])
print(result) | [["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["+", 8, 196, 0, 1, 0, 677, 12, 664, 17, 33]] | 5 | 111 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
Arrays.sort(arr);
long ans = 0;
PriorityQueue<Pair> queue = ... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = sc.nextInt();
}
Arrays.sort(arr);
long ans = 0;
PriorityQueue<Pair> queue = ... | [["+", 8, 196, 0, 37, 0, 16, 31, 492, 500, 22], ["+", 8, 196, 0, 37, 0, 16, 31, 492, 0, 131], ["-", 8, 196, 0, 37, 0, 16, 12, 492, 500, 22], ["-", 8, 196, 0, 37, 0, 16, 12, 492, 0, 131]] | 3 | 318 |
/**
* Dont raise your voice, improve your argument.
* --Desmond Tutu
*/
#include <bits/stdc++.h>
using namespace std;
const bool ready = []() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(12);
return true;
}();
const double PI = acos(-1);
using ll = long long;
#define int l... | /**
* Dont raise your voice, improve your argument.
* --Desmond Tutu
*/
#include <bits/stdc++.h>
using namespace std;
const bool ready = []() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout << fixed << setprecision(12);
return true;
}();
const double PI = acos(-1);
using ll = long long;
#define int l... | [["+", 0, 2, 3, 4, 0, 83, 0, 91, 17, 33], ["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 110]] | 1 | 461 |
from heapq import *
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
r = 0
Q = [A[0]]
for v in A[1:]:
c = heappop(Q)
r += c
heappush(Q, v)
heappush(Q, v)
print(r)
| from heapq import *
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
r = 0
Q = [-A[0]]
for v in A[1:]:
c = -heappop(Q)
r += c
heappush(Q, -v)
heappush(Q, -v)
print(r)
| [["+", 0, 1, 0, 662, 12, 634, 0, 664, 17, 33], ["+", 8, 196, 0, 1, 0, 662, 12, 664, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33]] | 5 | 82 |
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
if n%2==0:
print(a[0]+2*sum(a[1:n//2]))
else:
temp=n//2+1
print(a[0]+2*sum(a[1:temp-1])+a[temp]) | n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
if n%2==0:
print(a[0]+2*sum(a[1:n//2]))
else:
temp=n//2+1
print(a[0]+2*sum(a[1:temp-1])+a[temp-1]) | [["+", 3, 4, 0, 657, 12, 206, 206, 657, 17, 33], ["+", 3, 4, 0, 657, 12, 206, 206, 657, 12, 612]] | 5 | 96 |
n=int(input())
l=list(map(int,input().split()))
l.sort()
ct = 0
j=n-1
a=0
for i in range(n-1):
if((j==n-1 and ct==1) or (ct==2)):
j-=1
a+=l[j]
ct+=1
print(a) | n=int(input())
l=list(map(int,input().split()))
l.sort()
ct = 0
j=n-1
a=0
for i in range(n-1):
if((j==n-1 and ct==1) or (ct==2)):
j-=1
ct=0
a+=l[j]
ct+=1
print(a) | [["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]] | 5 | 88 |
#include "bits/stdc++.h"
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
... | #include "bits/stdc++.h"
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
... | [["-", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 22], ["-", 0, 11, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 22]] | 1 | 373 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long comfort = 0;
long long n;
cin >> n;
vector<long long> v(n);
for (long long i = 0; i < n; i++)
cin >> v[i];
sort(v.begin(), v.end(), greater<long long>());
priority_queue<pair<long long, long long>> q;
q.push(make_pair(v[0], v[0]))... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long comfort = 0;
long long n;
cin >> n;
vector<long long> v(n);
for (long long i = 0; i < n; i++)
cin >> v[i];
sort(v.begin(), v.end(), greater<long long>());
priority_queue<pair<long long, long long>> q;
q.push(make_pair(v[0], v[0]))... | [["-", 3, 4, 0, 23, 0, 41, 15, 16, 17, 47], ["+", 3, 4, 0, 23, 0, 41, 15, 16, 17, 18]] | 1 | 264 |
/*
NAME : RISHABH SINGH
INSTITUTION : DELHI TECHNOLOGICAL UNIVERSITY
*/
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define pii pair<int, int>
#define bi __builtin_inf()
#define ll long ... | /*
NAME : RISHABH SINGH
INSTITUTION : DELHI TECHNOLOGICAL UNIVERSITY
*/
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define pii pair<int, int>
#define bi __builtin_inf()
#define ll long ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 423 |
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
result = 0
for i in range(N):
result += A[(i + 1) // 2]
print(result)
| N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
result = 0
for i in range(N - 1):
result += A[(i + 1) // 2]
print(result)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 60 |
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
struct __INIT {
__INIT() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
}
} __init;
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
constexpr int MOD = 1000000007;
/... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
struct __INIT {
__INIT() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
}
} __init;
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
constexpr int MOD = 1000000007;
/... | [["-", 0, 11, 12, 69, 341, 342, 0, 16, 17, 109], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 85]] | 1 | 264 |
#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define pb push_back
using namespace std;
using ll = long long;
using pii = pair<int, int... | #include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define pb push_back
using namespace std;
using ll = long long;
using pii = pair<int, int... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 273 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
#define f first
#define s second
#define FOR(i, s, e) for (ll i = s; i <= ll(e); ++i)
#define DEC(i, s, e) for (ll i = s; i >= ll(e); --i)
#define pb push_back
#define all(x) (x).... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
#define f first
#define s second
#define FOR(i, s, e) for (ll i = s; i <= ll(e); ++i)
#define DEC(i, s, e) for (ll i = s; i >= ll(e); --i)
#define pb push_back
#define all(x) (x).... | [["-", 0, 2, 3, 4, 0, 69, 341, 342, 0, 13], ["+", 0, 2, 3, 4, 0, 69, 341, 342, 0, 22]] | 1 | 237 |
from math import ceil
from collections import defaultdict as dd
import sys
input=sys.stdin.readline
#t=int(input())
#while t:
n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)
ans=l[0]
ii=1
cou=0
for i in range(2,n):
if(cou==2):
ii+=1
cou=0
ans+=l[ii]
print(ans)
| from math import ceil
from collections import defaultdict as dd
import sys
input=sys.stdin.readline
#t=int(input())
#while t:
n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)
ans=l[0]
ii=1
cou=0
for i in range(2,n):
if(cou==2):
ii+=1
cou=0
ans+=l[ii]
cou+=1
print(ans)
| [["+", 0, 7, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 12, 612]] | 5 | 99 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<vpll> vvpl... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
typedef vector<vpll> vvpl... | [["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]] | 1 | 276 |
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> A(N);
for (int i = 0; i < N; i++)
cin >> A[i];
sort(A.begin(), A.end(), greater<long long>());
long long ans = 0;
for (int i = 0; i < N - 1; i++)
ans += A[i];
cout << ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> A(N);
for (int i = 0; i < N; i++)
cin >> A[i];
sort(A.begin(), A.end(), greater<long long>());
long long ans = 0;
for (int i = 0; i < N - 1; i++)
ans += A[(i + 1) / 2];
... | [["+", 12, 69, 341, 342, 0, 16, 31, 23, 0, 24], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 341, 342, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 12, 69, 341, 342, 0, 16, 31, 23, 0, 25], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 85], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 112 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
struct edge {
ll s, t, x;
};
typedef pair<int, int> P;
typedef pair<ll, P> event;
const ll MAX = 510000;
const ll MOD = 1000000007;
#define INF (ll)1000000000000
int main() {
int N;
cin >> N;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
struct edge {
ll s, t, x;
};
typedef pair<int, int> P;
typedef pair<ll, P> event;
const ll MAX = 510000;
const ll MOD = 1000000007;
#define INF (ll)1000000000000
int main() {
int N;
cin >> N;
... | [["-", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13], ["+", 3, 4, 0, 69, 341, 342, 0, 16, 12, 13]] | 1 | 229 |
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for (int i = (l); i < (r); ++i)
#define decID(i, l, r) for (int i = (r)-1; i >= (l); --i)
#define incII(i, l, r) for (int i = (l); i <= (r); ++i)
#define decII(i, l, r) for (int i = (r); i >= (l); --i)
#define inc(i, n) incID... | #include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for (int i = (l); i < (r); ++i)
#define decID(i, l, r) for (int i = (r)-1; i >= (l); --i)
#define incII(i, l, r) for (int i = (l); i <= (r); ++i)
#define decII(i, l, r) for (int i = (r); i >= (l); --i)
#define inc(i, n) incID... | [["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 17, 85], ["+", 0, 11, 12, 69, 341, 342, 0, 16, 12, 13]] | 1 | 563 |
from math import ceil
N = int(input())
A = [int(i) for i in input().split()]
A.sort(reverse=True)
c = 0
for i in range((N+1)//2):
c += A[i]*2
print(c - A[0] - A[(N+1)//2]*(N&1)) | from math import ceil
N = int(input())
A = [int(i) for i in input().split()]
A.sort(reverse=True)
c = 0
for i in range((N+1)//2):
c += A[i]*2
print(c - A[0] - A[(N-1)//2]*((N)&1)) | [["-", 31, 206, 206, 657, 31, 23, 0, 657, 17, 72], ["+", 31, 206, 206, 657, 31, 23, 0, 657, 17, 33], ["+", 3, 4, 0, 657, 12, 657, 12, 23, 0, 24], ["+", 12, 657, 12, 23, 0, 657, 31, 23, 0, 25]] | 5 | 89 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<db, db> pd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<db, db> pd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<... | [["+", 0, 7, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]] | 1 | 1,558 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.