problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02730 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
string s, a, b;
int n, mid;
bool pal(string a) {
string b = a;
reverse(b.begin(), b.end());
if (b == a)
return true;
else
return false;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);... | #include <bits/stdc++.h>
using namespace std;
string s, a, b;
int n, mid;
bool pal(string a) {
string b = a;
reverse(b.begin(), b.end());
if (b == a)
return true;
else
return false;
}
int main() {
cin >> s;
n = s.length();
mid = n / 2;
a = s.substr(0, mid);
b = s.substr(mid + 1);
if (pa... | delete | 16 | 22 | 16 | 16 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 1) > this->size() (which is 0)
|
p02730 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define endl "\n"
#define MohamedMotaz \
ios::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define endl "\n"
#define MohamedMotaz \
ios::sync_with_stdio(0); \
cin.tie(0); ... | replace | 111 | 113 | 111 | 112 | 0 | |
p02730 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
bool ispal(string s) {
int n = s.length();
for (int i = 0; i < n / 2; i++) {
if (s[i] != s[n - 1 - i])
... | #include <algorithm>
#include <climits>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
bool ispal(string s) {
int n = s.length();
for (int i = 0; i < n / 2; i++) {
if (s[i] != s[n - 1 - i])
... | replace | 24 | 25 | 24 | 25 | 0 | |
p02730 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
bool isPalin(string S) {
for (int i = 0; i < S.length(); i++) {
if (S[i] != S[S.length() - i - 1]) {
return false;
}
}
return true;
}
int main(void) {
string S;
cin >> S;
int N = S.length();
bool strongPalindrome = true;
// 1st condition
... | #include <bits/stdc++.h>
using namespace std;
bool isPalin(string S) {
for (int i = 0; i < S.length(); i++) {
if (S[i] != S[S.length() - i - 1]) {
return false;
}
}
return true;
}
int main(void) {
string S;
cin >> S;
int N = S.length();
bool strongPalindrome = true;
// 1st condition
... | replace | 33 | 34 | 33 | 34 | 0 | |
p02730 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define loop for (int i = 0; i < n; i++)
using namespace std;
string reverese(string n) {
string st = "";
for (int i = n.length() - 1; i >= 0; i--)
st += n[i];
return st;
}
int main() {
string k;
cin >> k;
int flag = 1;
int n = k.length();
if (n % 2 ... | #include <bits/stdc++.h>
#define ll long long int
#define loop for (int i = 0; i < n; i++)
using namespace std;
string reverese(string n) {
string st = "";
for (int i = n.length() - 1; i >= 0; i--)
st += n[i];
return st;
}
int main() {
string k;
cin >> k;
int flag = 1;
int n = k.length();
if ((k.sub... | replace | 15 | 21 | 15 | 20 | 0 | |
p02730 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
bool KBjudge(string x) {
string x_ = x;
reverse(x.begin(), x.end());
return (x_ == x);
}
int main() {
string S;
cin >> S;
int N = S.size();
if (KBjudge(S.substr(0, S.size()))) {
if (KBjudge(S.substr(0, (N - 1) / 2))) {
if (KBjudge(S.substr((N + ... | #include <bits/stdc++.h>
using namespace std;
bool KBjudge(string x) {
string x_ = x;
reverse(x.begin(), x.end());
return (x_ == x);
}
int main() {
string S;
cin >> S;
int N = S.size();
if (KBjudge(S.substr(0, S.size()))) {
if (KBjudge(S.substr(0, (N - 1) / 2))) {
if (KBjudge(S.substr((N + ... | replace | 18 | 19 | 18 | 19 | 0 | |
p02730 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fori(x) for (int i = 0; i < x; ++i)
#define forj(x) for (int j = 0; j < x; ++j)
int main() {
string s;
cin >> s;
for (int i = 0; i < s.length() / 2; ++i) {
if (s[i] != s[s.length() - i - 1]) {
cout << "No";
return 0;
}
}
int n = s.le... | #include <bits/stdc++.h>
using namespace std;
#define fori(x) for (int i = 0; i < x; ++i)
#define forj(x) for (int j = 0; j < x; ++j)
int main() {
string s;
cin >> s;
for (int i = 0; i < s.length() / 2; ++i) {
if (s[i] != s[s.length() - i - 1]) {
cout << "No";
return 0;
}
}
if (s.length... | insert | 15 | 15 | 15 | 19 | 0 | |
p02730 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N;
N = S.size();
int res = 0;
int check = 0;
for (int i = 0; i < N; i++) {
if (S.at(i) == S.at(N - 1 - i)) {
check = check + 0;
} else {
check = check + 1;
}
}
if (check == 0) {
res = res + ... | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int N;
N = S.size();
int res = 0;
int check = 0;
for (int i = 0; i < N; i++) {
if (S.at(i) == S.at(N - 1 - i)) {
check = check + 0;
} else {
check = check + 1;
}
}
if (check == 0) {
res = res + ... | replace | 34 | 36 | 34 | 36 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 7) >= this->size() (which is 7)
|
p02730 | C++ | Runtime Error | #include <algorithm>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define rep(i, a, n) fo... | #include <algorithm>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
#define rep(i, a, n) fo... | replace | 191 | 192 | 191 | 192 | 0 | |
p02731 | C++ | Runtime Error | //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//* vamsicool007 You are never wrong to do the right thing vamsicool007 *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#include <bits/stdc++.h>
using namespace std;
#define flash ... | //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//* vamsicool007 You are never wrong to do the right thing vamsicool007 *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#include <bits/stdc++.h>
using namespace std;
#define flash ... | replace | 99 | 100 | 99 | 100 | 0 | |
p02731 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int L;
cin >> L;
vector<double> p;
for (int i = 1; i < L - 1; i++) {
p.push_back((double)i * (L - i) * (L - i) / 4);
}
sort(p.begin(), p.end());
reverse(p.begin(), p.end());
cout << p.at(0) << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int L;
cin >> L;
cout << fixed << setprecision(10) << (double)L * L * L / 27 << endl;
return 0;
}
| replace | 5 | 12 | 5 | 6 | 0 | |
p02731 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mod 1e9 + 7;
#define INF 1e9 + 9;
#define ps(x, y) fixed << setprecision(y) << x
#define PI 3.14159265358979323846264338327950 L
typedef long long ll;
typedef unsigned long long ull;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ... | #include <bits/stdc++.h>
using namespace std;
#define mod 1e9 + 7;
#define INF 1e9 + 9;
#define ps(x, y) fixed << setprecision(y) << x
#define PI 3.14159265358979323846264338327950 L
typedef long long ll;
typedef unsigned long long ull;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ... | replace | 14 | 16 | 14 | 16 | 0 | |
p02731 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int l;
int ans = 0;
for (int i = 1; i <= l; i++) {
int a = i;
for (int j = 1; j <= l; j++) {
int b = j;
int c = l - a - b;
if (c > 0) {
ans = max(ans, a * b * c);
}
}
}
cout << ans << "\n";
... | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
double l;
cin >> l;
double m = l / 3;
double ans = m * m * m;
printf("%.12f\n", ans);
return 0;
} | replace | 5 | 18 | 5 | 10 | TLE | |
p02731 | C++ | Runtime Error | // AnkitCode99 here....
// every ups and downs matter!
#include <bits/stdc++.h>
#define endl "\n"
typedef long long int ll;
#define MOD 1000000007
#define pll pair<ll, ll>
#define pb push_back
// max xor btw range of two numbers..
#define max_XOR(a, b) (1 << int(log2(a ^ b) + 1)) - 1
#define vl vector<ll>
#define inf... | // AnkitCode99 here....
// every ups and downs matter!
#include <bits/stdc++.h>
#define endl "\n"
typedef long long int ll;
#define MOD 1000000007
#define pll pair<ll, ll>
#define pb push_back
// max xor btw range of two numbers..
#define max_XOR(a, b) (1 << int(log2(a ^ b) + 1)) - 1
#define vl vector<ll>
#define inf... | delete | 31 | 36 | 31 | 31 | 0 | |
p02731 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
double l;
cin >> l;
double maxi = 0;
for (double i = 0; i <= l / 3; i += 0.001) {
for (double j = 0; j <= (l - i) / 2; j += 0.001) {
maxi = max(maxi, i * j * (l - i - j));
}
}
cout << maxi << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
double l;
cin >> l;
printf("%.12f\n", pow(l / 3, 3.0));
} | replace | 6 | 13 | 6 | 7 | TLE | |
p02731 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | delete | 115 | 121 | 115 | 115 | 0 | Time elapsed: 0.000317968s
|
p02731 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define double /*long*/ double
#define endl '\n'
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vppll vector<pair<pll, pll>>
#define mp make_pair
#define pb push_back
#define mapll map<ll, ll>
#define fir first
#define sec second
#defin... | #include <bits/stdc++.h>
#define ll long long int
#define double /*long*/ double
#define endl '\n'
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vppll vector<pair<pll, pll>>
#define mp make_pair
#define pb push_back
#define mapll map<ll, ll>
#define fir first
#define sec second
#defin... | replace | 55 | 60 | 55 | 56 | 0 | |
p02731 | Python | Runtime Error | f = int(input()) / 3.0
print("{.9f}".format(f * f * f))
| f = int(input()) / 3.0
print("{:.9f}".format(f * f * f))
| replace | 1 | 2 | 1 | 2 | AttributeError: 'float' object has no attribute '9f' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02731/Python/s178614375.py", line 2, in <module>
print("{.9f}".format(f * f * f))
AttributeError: 'float' object has no attribute '9f'
|
p02731 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 101010
#define mod 1000000007
#define pi 3.141592653589793238
#define sin(s) scanf("%lld", &s);
#define sout(s) printf("%lld\n", s);
#define in(s) cin >> s
#define in2(a, b) cin >> a >> b
#define in3(... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 101010
#define mod 1000000007
#define pi 3.141592653589793238
#define sin(s) scanf("%lld", &s);
#define sout(s) printf("%lld\n", s);
#define in(s) cin >> s
#define in2(a, b) cin >> a >> b
#define in3(... | delete | 32 | 35 | 32 | 32 | 0 | Time elapsed:- 0.000206
|
p02731 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define umap unordered_map
#define all(v) v.begin(), v.end()
#define st first
#define nd second
#define ln '\n'
#define MAX 1000000009
#define MOD 1000000007
#define N 105
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef vect... | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define umap unordered_map
#define all(v) v.begin(), v.end()
#define st first
#define nd second
#define ln '\n'
#define MAX 1000000009
#define MOD 1000000007
#define N 105
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef vect... | replace | 18 | 20 | 18 | 20 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long
const int INF = 1e18L + 5;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
map<int, int> mp;
... | #include <bits/stdc++.h>
#define int long long
const int INF = 1e18L + 5;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
map<int, int> mp;
... | replace | 22 | 31 | 22 | 29 | TLE | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef pair<ll, ll> P;
const int MAXN = 1e5 + 7;
const int LOG = 20;
const int INF = 0x3f3f3f3f;
int a[MAXN], cnt[MAXN], sum[MAXN], b[MAXN];
void solve() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
b[i] =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef pair<ll, ll> P;
const int MAXN = 2e5 + 7;
const int LOG = 20;
const int INF = 0x3f3f3f3f;
int a[MAXN], cnt[MAXN], sum[MAXN], b[MAXN];
void solve() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
b[i] =... | replace | 5 | 6 | 5 | 6 | 0 | |
p02732 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx")
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
using namespace std;
typedef long long in... | #pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx")
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
using namespace std;
typedef long long in... | replace | 30 | 31 | 30 | 31 | -6 | free(): invalid size
|
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int64_t ncr2(int64_t n);
int main(void) {
int64_t N;
int64_t total = 0;
cin >> N;
vector<int64_t> A(N);
vector<int64_t> B(100001, 0);
for (int64_t i = 0; i < N; i++) {
cin >> A[i];
B[A[i] - 1]++;
}
for (int64_t i = 0; i < B.size(); i++) {
tot... | #include <bits/stdc++.h>
using namespace std;
int64_t ncr2(int64_t n);
int main(void) {
int64_t N;
int64_t total = 0;
cin >> N;
vector<int64_t> A(N);
vector<int64_t> B(200001, 0);
for (int64_t i = 0; i < N; i++) {
cin >> A[i];
B[A[i] - 1]++;
}
for (int64_t i = 0; i < B.size(); i++) {
tot... | replace | 10 | 11 | 10 | 11 | 0 | |
p02732 | Python | Time Limit Exceeded | from collections import defaultdict
def num_combinations(_n):
return _n * (_n - 1) // 2
if __name__ == "__main__":
n = int(input())
xs = [int(s) for s in input().split()]
freq = defaultdict(int)
for n in xs:
freq[n] += 1
res = 0
for k in range(len(xs)):
res = 0
... | from collections import defaultdict
def num_combinations(_n):
return _n * (_n - 1) // 2
if __name__ == "__main__":
n = int(input())
xs = [int(s) for s in input().split()]
freq = defaultdict(int)
for n in xs:
freq[n] += 1
total = sum([num_combinations(n) for n in freq.values()])
... | replace | 15 | 22 | 15 | 18 | TLE | |
p02732 | Python | Runtime Error | import collections
import math
url = "https://atcoder.jp//contests/abc159/tasks/abc159_d"
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def main():
input()
t = list(map(int, input().split()))
col = collections.Counter(t)
com = {}
al = ... | import collections
import math
url = "https://atcoder.jp//contests/abc159/tasks/abc159_d"
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def main():
input()
t = list(map(int, input().split()))
col = collections.Counter(t)
com = {}
al = ... | replace | 17 | 18 | 17 | 21 | 0 | |
p02732 | Python | Time Limit Exceeded | from collections import Counter
def choose(n: int) -> int:
if n < 2:
return 0
else:
return (n * (n - 1)) // 2
N = int(input())
A = list(map(int, input().split()))
for k in range(N):
c = Counter(A[:k] + A[k + 1 :])
print(sum(map(choose, c.values())))
| from collections import Counter
def choose(n: int) -> int:
if n < 2:
return 0
else:
return (n * (n - 1)) // 2
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
d = {key: choose(value) for key, value in c.items()}
if len(d) > 1:
sum_d = sum(d.values())
for a in A:
... | replace | 12 | 16 | 12 | 22 | TLE | |
p02732 | Python | Runtime Error | from collections import Counter
from scipy.special import comb
import numpy as np
N = int(input())
A = list(map(int, input().split()))
total = 0
answers = np.array([0] * (N + 1))
for number, appearance in Counter(A).items():
flat = comb(appearance, 2, exact=True)
minus_one = comb(appearance - 1, 2, exact=True... | from collections import Counter
from scipy.misc import comb
import numpy as np
N = int(input())
A = list(map(int, input().split()))
total = 0
answers = np.array([0] * (N + 1))
for number, appearance in Counter(A).items():
flat = comb(appearance, 2, exact=True)
minus_one = comb(appearance - 1, 2, exact=True)
... | replace | 1 | 2 | 1 | 2 | ModuleNotFoundError: No module named 'scipy' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02732/Python/s996070439.py", line 3, in <module>
from scipy.special import comb
ModuleNotFoundError: No module named 'scipy'
|
p02732 | Python | Runtime Error | N = int(input())
A = [int(a) for a in input().split()]
cnt = {}
total = 0
for a in A:
if a not in cnt:
cnt[a] = 0
cnt[a] += 1
for i in cnt.values():
total += i * (i - 1) // 2
for i in range(N):
print(total - (cnt[i] - 1))
| N = int(input())
A = [int(a) for a in input().split()]
cnt = {}
total = 0
for a in A:
if a not in cnt:
cnt[a] = 0
cnt[a] += 1
for i in cnt.values():
total += i * (i - 1) // 2
for a in A:
print(total - (cnt[a] - 1))
| replace | 13 | 15 | 13 | 15 | KeyError: 0 | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02732/Python/s071344434.py", line 15, in <module>
print(total - (cnt[i] - 1))
KeyError: 0
|
p02732 | Python | Time Limit Exceeded | N = int(input())
A = list(map(int, input().split()))
dictA = {}
for x in A:
dictA[x] = 0
for x1 in A:
dictA[x1] += 1
for x2 in A:
dictB = dictA.copy()
combisum = 0
dictB[x2] -= 1
for x3 in dictB.values():
combisum += x3 * (x3 - 1) // 2
print(combisum)
| N = int(input())
A = list(map(int, input().split()))
dictA = {}
for x in A:
dictA[x] = 0
for x1 in A:
dictA[x1] += 1
combisum = 0
for y in dictA.values():
combisum += y * (y - 1) // 2
for z in range(N):
print(combisum - dictA[A[z]] + 1)
| replace | 8 | 15 | 8 | 14 | TLE | |
p02732 | Python | Runtime Error | N = int(input())
A = list(map(int, input().split()))
m = [0] * N
for i in range(N):
m[A[i]] += 1
ans = 0
for i in range(len(m)):
ans += m[i] * (m[i] - 1) // 2
for i in range(N):
print(ans - m[A[i]] + 1)
| N = int(input())
A = list(map(int, input().split()))
m = [0] * (N + 1)
for i in range(N):
m[A[i]] += 1
ans = 0
for i in range(len(m)):
ans += m[i] * (m[i] - 1) // 2
for i in range(N):
print(ans - m[A[i]] + 1)
| replace | 3 | 4 | 3 | 4 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, x, n) for (int i = x; i < n; i++)
#define mod 1000000007 // 10^9+7
#define INF 1000000000000 // 10^12
#define F first
#define S second
#define P pair<int, int>
#define all(vec) vec.begin()... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, x, n) for (int i = x; i < n; i++)
#define mod 1000000007 // 10^9+7
#define INF 1000000000000 // 10^12
#define F first
#define S second
#define P pair<int, int>
#define all(vec) vec.begin()... | replace | 22 | 28 | 22 | 30 | TLE | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
vector<long long> Acnt(N + 1, 0);
for (auto x : A) {
Acnt.at(x) = count(A.begin(), A.end(), x);
}
long long s = 0;
for (int i = 1; i < N + ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<long long> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
vector<long long> Acnt(N + 1, 0);
for (auto x : A) {
Acnt.at(x)++;
}
long long s = 0;
for (int i = 1; i < N + 1; i++) {
if (Acnt.at(i) ... | replace | 15 | 16 | 15 | 16 | TLE | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pp;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
tree_order_statistics_node_updat... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pp;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
tree_order_statistics_node_updat... | replace | 23 | 24 | 23 | 24 | 0 | |
p02732 | C++ | Runtime Error | #include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stdint.h>
#include <vector>
using namespace std;
#define int long long
#define INF 1001001001
int arr[200001];
int nChoosek(int n, int k) {
if (k > n)
return 0;
if (k * 2 > n)
k = n - k;
if (k == 0)
return 1;
int ... | #include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stdint.h>
#include <vector>
using namespace std;
#define int long long
#define INF 1001001001
int arr[200001];
int nChoosek(int n, int k) {
if (k > n)
return 0;
if (k * 2 > n)
k = n - k;
if (k == 0)
return 1;
int ... | replace | 34 | 35 | 34 | 35 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define int long long
#define sz(v) (int)(v).size()
#define mod 1000000007 // ((a- b)% mod+ mod)% mod
const int N = 100001;
int freq[N];
void solve() {
int n;
cin >> n;
vector<int> v(n);
for (auto &i : v) {
cin >> i;
f... | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define int long long
#define sz(v) (int)(v).size()
#define mod 1000000007 // ((a- b)% mod+ mod)% mod
const int N = 200001;
int freq[N];
void solve() {
int n;
cin >> n;
vector<int> v(n);
for (auto &i : v) {
cin >> i;
f... | replace | 7 | 8 | 7 | 8 | 0 | |
p02732 | C++ | Runtime Error | #pragma comment(linker, "/stack:16777216")
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <functional>
#include <iomanip>
#include <iost... | #pragma comment(linker, "/stack:16777216")
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <functional>
#include <iomanip>
#include <iost... | replace | 83 | 85 | 83 | 85 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T> inline void chkmax(T &x, T y)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
template <typename T> inline void chkmax(T &x, T y)... | replace | 31 | 32 | 31 | 32 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
#define pll pair<ll, ll>
#define ff first
#define snd second
#define pb push_back
#define vll vector<ll>
#define vpll vector<pll>
#define endl "\n"
#define MOD 1000000007
using namespace std;
ll const N = 1e5 + 1;
void solve() {
ll n;
cin >> n;
vll a(n);
map<ll,... | #include <bits/stdc++.h>
typedef long long ll;
#define pll pair<ll, ll>
#define ff first
#define snd second
#define pb push_back
#define vll vector<ll>
#define vpll vector<pll>
#define endl "\n"
#define MOD 1000000007
using namespace std;
ll const N = 2e5 + 5;
void solve() {
ll n;
cin >> n;
vll a(n);
map<ll,... | replace | 13 | 14 | 13 | 14 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#include <f... | #include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#include <f... | replace | 63 | 64 | 63 | 64 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
vector<vector<long long>> ball_type_num(pow(10, 5), vector<long long>(2, 0));
for (int i = 0; i < n; i++) {
... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
vector<vector<long long>> ball_type_num(2 * pow(10, 5),
vector<long lo... | replace | 15 | 16 | 15 | 17 | 0 | |
p02732 | C++ | Runtime Error | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;
const ll MOD = 1000000007;
const double pi = 3.141592653589793238;
#define K 2
#define LIMIT 20010
// a と b の最大公約数を返す関数
long long GCD(long long a, long long b) {
if (b == 0) {
return a;
} else {
... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;
const ll MOD = 1000000007;
const double pi = 3.141592653589793238;
#define K 2
#define LIMIT 200010
// a と b の最大公約数を返す関数
long long GCD(long long a, long long b) {
if (b == 0) {
return a;
} else {
... | replace | 10 | 11 | 10 | 11 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a[20005];
map<int, int> mp;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
mp[a[i]]++;
}
long long ans = 0;
for (int i = 1; i <= n; i++) {
ans += mp[i] * (mp[i] - 1) / 2;
}
// cout << "ans:" << ans << endl;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, a[200005];
map<long long, long long> mp;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
mp[a[i]]++;
}
long long ans = 0;
for (int i = 1; i <= n; i++) {
ans += mp[i] * (mp[i] - 1) / 2;
}
// cout << "ans:" << ans... | replace | 4 | 6 | 4 | 6 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define MODNum 1000000007
#define REP(type, i, a, b) for (type i = a; i < b; i++)
typedef long long ll;
using namespace std;
int main(void) {
ll N, ans;
scanf("%lld", &N);
vector<ll> A(N);
map<ll, ll> mp;
REP(ll, i, 0, N) {
scanf("%lld", &A.at(i));
mp[A.at(i)]++;
}
REP(l... | #include <bits/stdc++.h>
#define MODNum 1000000007
#define REP(type, i, a, b) for (type i = a; i < b; i++)
typedef long long ll;
using namespace std;
int main(void) {
ll N, ans;
scanf("%lld", &N);
vector<ll> A(N);
map<ll, ll> mp;
REP(ll, i, 0, N) {
scanf("%lld", &A.at(i));
mp[A.at(i)]++;
}
for (... | replace | 16 | 28 | 16 | 19 | TLE | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef pair<ll, ll> lli;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;
typedef vector<ll... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef pair<ll, ll> lli;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;
typedef vector<ll... | replace | 39 | 40 | 39 | 40 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int MAX_N = 100005;
ll A[MAX_N], B[MAX_N];
int main() {
int N;
cin >> N;
rep(i, N) {
cin >> A[i];
A[i]--;
B[A[i]]++;
}
ll ans = 0;
rep(i, N) { ans +=... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int MAX_N = 200005;
ll A[MAX_N], B[MAX_N];
int main() {
int N;
cin >> N;
rep(i, N) {
cin >> A[i];
A[i]--;
B[A[i]]++;
}
ll ans = 0;
rep(i, N) { ans +=... | replace | 5 | 6 | 5 | 6 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
/*
... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
/*
... | replace | 88 | 89 | 88 | 89 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define LOOP(type, i, a, b) for (type i = a; i < b; i++)
typedef long long ll;
using namespace std;
int main() {
ll N, sum;
scanf("%lld", &N);
vector<ll> A(N), count(N);
LOOP(ll, i, 1, N + 1) count[i] = 0;
LOOP(ll, i, 0, N) {
scanf("%lld", &A[i]);
count[A[i]]++;
}
sum ... | #include <bits/stdc++.h>
#define LOOP(type, i, a, b) for (type i = a; i < b; i++)
typedef long long ll;
using namespace std;
int main() {
ll N, sum;
scanf("%lld", &N);
vector<ll> A(N), count(N + 1);
LOOP(ll, i, 1, N + 1) count[i] = 0;
LOOP(ll, i, 0, N) {
scanf("%lld", &A[i]);
count[A[i]]++;
}
... | replace | 10 | 11 | 10 | 11 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
int n, ary[20000];
cin >> n;
vector<ll> cnt(n + 1);
rep(i, n) {
cin >> ary[i];
cnt[ary[i]]++;
}
ll tmp = 0;
rep(i, n + 1) { tmp += cnt[i] * (cnt[i] - 1) / 2; }
rep(i,... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main() {
int n, ary[(int)2e+5];
cin >> n;
vector<ll> cnt(n + 1);
rep(i, n) {
cin >> ary[i];
cnt[ary[i]]++;
}
ll tmp = 0;
rep(i, n + 1) { tmp += cnt[i] * (cnt[i] - 1) / 2; }
re... | replace | 6 | 7 | 6 | 7 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define MAX 100001
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
map<ll, ll> m;
map<ll, pair<ll, ll>> mpp;
ll arr[MAX];
ll n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> ... | #include <bits/stdc++.h>
#define MAX 1000000
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
map<ll, ll> m;
map<ll, pair<ll, ll>> mpp;
ll arr[MAX];
ll n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >>... | replace | 1 | 2 | 1 | 2 | 0 | |
p02732 | C++ | Runtime Error | /*<---------------------------CONCEPTS LEARNT------------------------------>
<-------------------------------------------------------------------------->
_ __ _ _____ _____ _____
___ _ _| |__ ___ / _|_ __ ___ __ _| | __ |___ |___ |___ |
/ __| | | | '_ \ / _ \ |_| '_... | /*<---------------------------CONCEPTS LEARNT------------------------------>
<-------------------------------------------------------------------------->
_ __ _ _____ _____ _____
___ _ _| |__ ___ / _|_ __ ___ __ _| | __ |___ |___ |___ |
/ __| | | | '_ \ / _ \ |_| '_... | replace | 34 | 35 | 34 | 35 | 0 | |
p02732 | C++ | Time Limit Exceeded | /*
--------DO NOT COPY I REQUEST YOU PLEASE--------
AUTHOR : Chandan Agrawal
College : Poornima College of Engg. jaipur, Raj
Mail : chandanagrawal23@gmail.com
___ _ _ __ _ _ ____ __ _ _
/ __)( )_( ) /__\ ( \( )( _ \ /__\ ( \( )
( (__ ) _ ( /(__)\ ) ( )(_) )/(__)\ ) (
\___)(_) (_)(__... | /*
--------DO NOT COPY I REQUEST YOU PLEASE--------
AUTHOR : Chandan Agrawal
College : Poornima College of Engg. jaipur, Raj
Mail : chandanagrawal23@gmail.com
___ _ _ __ _ _ ____ __ _ _
/ __)( )_( ) /__\ ( \( )( _ \ /__\ ( \( )
( (__ ) _ ( /(__)\ ) ( )(_) )/(__)\ ) (
\___)(_) (_)(__... | replace | 443 | 456 | 443 | 452 | TLE | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define fori(i, a, b, c) for (int i = (int)(a); i <= (int)(b); i += (int)(c))
#define ford(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define MOD 998244353
using namespace std;
typedef pair<int,... | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define fori(i, a, b, c) for (int i = (int)(a); i <= (int)(b); i += (int)(c))
#define ford(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define MOD 998244353
using namespace std;
typedef pair<int,... | replace | 19 | 20 | 19 | 20 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <string>
#define mem(x) memset(x, 0, sizeof(x))
#define sca(x) scanf("%lld", &x)
#define scaa(x, y) scanf("%lld%lld", &x, &y)
#define inf 0x7f7f7f7f
#define io ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#pragma GCC optimize(2)
using namespace std;
c... | #include <algorithm>
#include <bits/stdc++.h>
#include <string>
#define mem(x) memset(x, 0, sizeof(x))
#define sca(x) scanf("%lld", &x)
#define scaa(x, y) scanf("%lld%lld", &x, &y)
#define inf 0x7f7f7f7f
#define io ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#pragma GCC optimize(2)
using namespace std;
c... | replace | 18 | 20 | 18 | 20 | 0 | |
p02732 | C++ | Runtime Error | // Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) \
{ \
cerr << "\033[32;1m" << #x << " -... | // Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) \
{ \
cerr << "\033[32;1m" << #x << " -... | replace | 23 | 24 | 23 | 24 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 100001
int main() {
ll n;
cin >> n;
ll c[MAX] = {0};
ll a[n];
for (int i = 0; i < n; ++i) {
cin >> a[i];
c[a[i]]++;
}
ll s = 0;
for (int i = 1; i <= n; ++i) {
s = s + (c[i] * (c[i] - 1)) / 2;
}
for (int i = 0;... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 200001
int main() {
ll n;
cin >> n;
ll c[MAX] = {0};
ll a[n];
for (int i = 0; i < n; ++i) {
cin >> a[i];
c[a[i]]++;
}
ll s = 0;
for (int i = 1; i <= n; ++i) {
s = s + (c[i] * (c[i] - 1)) / 2;
}
for (int i = 0;... | replace | 3 | 4 | 3 | 4 | 0 | |
p02732 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("avx")
// #include<bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x... | #pragma GCC optimize("O3")
#pragma GCC target("avx")
// #include<bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x... | insert | 49 | 49 | 49 | 50 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define MAX_N 100000
using namespace std;
string s;
int n;
bool pal(int st, int dr) {
for (int i = st, j = dr; i < j; i++, j--) {
if (s[i] != s[j])
return 0;
}
return 1;
}
int a[MAX_N + 1];
int ap[MAX_N + 1];
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
... | #include <bits/stdc++.h>
#define MAX_N 200000
using namespace std;
string s;
int n;
bool pal(int st, int dr) {
for (int i = st, j = dr; i < j; i++, j--) {
if (s[i] != s[j])
return 0;
}
return 1;
}
int a[MAX_N + 1];
int ap[MAX_N + 1];
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pf printf
#define sc(x) scanf("%d", &x);
#define scs(x) scanf("%s", x);
#define scl(x) scanf("%lld", &x);
#define rep(i, s, e) for (int i = s; i <= e; ++i)
#define dep(i, s, e) for (int i = s; i >= e; --i)
typedef long long ll;
using namespace std;
ll a[100005], b[100005];
int main() {
... | #include <bits/stdc++.h>
#define pf printf
#define sc(x) scanf("%d", &x);
#define scs(x) scanf("%s", x);
#define scl(x) scanf("%lld", &x);
#define rep(i, s, e) for (int i = s; i <= e; ++i)
#define dep(i, s, e) for (int i = s; i >= e; --i)
typedef long long ll;
using namespace std;
ll a[200005], b[200005];
int main() {
... | replace | 9 | 10 | 9 | 10 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define double /*long*/ double
#define endl '\n'
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vppll vector<pair<pll, pll>>
#define mp make_pair
#define pb push_back
#define mapll map<ll, ll>
#define fir first
#define sec second
#defin... | #include <bits/stdc++.h>
#define ll long long int
#define double /*long*/ double
#define endl '\n'
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define vppll vector<pair<pll, pll>>
#define mp make_pair
#define pb push_back
#define mapll map<ll, ll>
#define fir first
#define sec second
#defin... | replace | 55 | 60 | 55 | 56 | 0 | |
p02732 | C++ | Runtime Error | #define _GLIBCXX_DEBUG // TLEの原因になるので注意!!!!!!!!!!!
#include <bits/stdc++.h>
#include <cmath>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int, int>> qu2;
priority_queue<int> pq;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1... | #define _GLIBCXX_DEBUG // TLEの原因になるので注意!!!!!!!!!!!
#include <bits/stdc++.h>
#include <cmath>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int, int>> qu2;
priority_queue<int> pq;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1... | replace | 67 | 69 | 67 | 69 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define INF (int)1e9
#define cBits(x) __builtin_popcount(x)
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) a / gcd(a, b) * b
#define FOR(i, a, b) for (int i = a; i < b; i++)
#defi... | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define INF (int)1e9
#define cBits(x) __builtin_popcount(x)
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) a / gcd(a, b) * b
#define FOR(i, a, b) for (int i = a; i < b; i++)
#defi... | replace | 32 | 36 | 32 | 36 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int n, a[100100], cnt[100100];
inline long long cal(int x) { return 1ll * x * (x - 1) / 2; }
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", a + i), cnt[a[i]]++;
for (int i = 1; i <= n; i++)
ans += cal(cnt[i]);
for (... | #include <bits/stdc++.h>
using namespace std;
long long ans = 0;
int n, a[200100], cnt[200100];
inline long long cal(int x) { return 1ll * x * (x - 1) / 2; }
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", a + i), cnt[a[i]]++;
for (int i = 1; i <= n; i++)
ans += cal(cnt[i]);
for (... | replace | 3 | 4 | 3 | 4 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
int fact(int n);
int nCr(int n, int r) {
if (n < r) {
return 0;
}
return fact(n) / (fact(r) * fact(n - r));
}
// Returns factorial of n
int fact(int n) {
int res = 1;
for (int i = 2; i <= n; i++)
res = res * i;
ret... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
int fact(int n);
int nCr(int n, int r) {
if (n < r) {
return 0;
}
return fact(n) / (fact(r) * fact(n - r));
}
// Returns factorial of n
int fact(int n) {
int res = 1;
for (int i = 2; i <= n; i++)
res = res * i;
ret... | replace | 54 | 55 | 54 | 57 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
bool palin(string s) {
int n = s.length();
for (int i = 0; i <= n / 2; i++) {
if (s[i] != s[n - i - 1])
return false;
}
return true;
}
int main() {
// your code goes here
int n;
cin >> n;
int a[n];
vector<ll> cnt(n + 1... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
bool palin(string s) {
int n = s.length();
for (int i = 0; i <= n / 2; i++) {
if (s[i] != s[n - i - 1])
return false;
}
return true;
}
int main() {
// your code goes here
int n;
cin >> n;
int a[n];
vector<ll> cnt(n + 1... | replace | 23 | 32 | 23 | 36 | TLE | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int N;
vector<long long> A(100010, 0);
vector<long long> NA(100010, 0);
long long SA = 0;
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> A[i];
++NA[A[i]];
}
for (int i = 1; i <= N; i++)
SA += NA[i] * (NA[i] - 1) / 2;
/*x番目のボールの番号はA[i]、... | #include <bits/stdc++.h>
using namespace std;
int N;
vector<long long> A(200010, 0);
vector<long long> NA(200010, 0);
long long SA = 0;
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> A[i];
++NA[A[i]];
}
for (int i = 1; i <= N; i++)
SA += NA[i] * (NA[i] - 1) / 2;
/*x番目のボールの番号はA[i]、... | replace | 4 | 6 | 4 | 6 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string.h>
#include <string>
#include <u... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string.h>
#include <string>
#include <u... | replace | 27 | 28 | 27 | 28 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
#define pb push_back
#define ll long long
using namespace std;
int A[100001], nums[100000];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
A[x]++;
nums[i] = x;
}
ll total = 0;
for ... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
#define pb push_back
#define ll long long
using namespace std;
int A[200001], nums[200000];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
A[x]++;
nums[i] = x;
}
ll total = 0;
for ... | replace | 10 | 11 | 10 | 11 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define DBG(x) cerr << #x << “ = ” << (x) << endl
#define Rep(i, a, b) for (int i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
int main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
... | #include <bits/stdc++.h>
using namespace std;
#define DBG(x) cerr << #x << “ = ” << (x) << endl
#define Rep(i, a, b) for (int i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
int main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
... | replace | 26 | 33 | 26 | 27 | TLE | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map<long long, long long> mp;
vector<long long> a(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
for (int i = 0; i < n; ++i) {
mp[a[i]]++;
}
for (int k = 0; k < n; ++k) {
mp[a[k]]--;
long long sum = 0;
for (au... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
map<long long, long long> mp;
vector<long long> a(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
for (int i = 0; i < n; ++i) {
mp[a[i]]++;
}
long long sum = 0;
for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
s... | replace | 13 | 21 | 13 | 19 | TLE | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll cnt[114514], a[114514];
int main() {
ll n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
cnt[a[i]]++;
}
ll ans = 0;
for (int i = 1; i <= n; i++) {
ans += cnt[i] * (cnt[i] - 1) / 2;
}
for (int i = 0; i < n; i... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll cnt[214514], a[214514];
int main() {
ll n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
cnt[a[i]]++;
}
ll ans = 0;
for (int i = 1; i <= n; i++) {
ans += cnt[i] * (cnt[i] - 1) / 2;
}
for (int i = 0; i < n; i... | replace | 4 | 5 | 4 | 5 | 0 | |
p02732 | C++ | Runtime Error | /******************************************
* AUTHOR : Dharmveer Jakhar *
* Handle : dvjakhar *
* INSTITUTION : IIT (BHU) Varanasi *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define N 100005
#define mod 1000000007
#define dd double
#define rep(i, n) for (int i = 0; i... | /******************************************
* AUTHOR : Dharmveer Jakhar *
* Handle : dvjakhar *
* INSTITUTION : IIT (BHU) Varanasi *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define N 100005
#define mod 1000000007
#define dd double
#define rep(i, n) for (int i = 0; i... | delete | 46 | 53 | 46 | 46 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <vector>
using ll = long long;
using namespace std;
int main(void) {
ll n, a, sum = 0, one = 0;
map<ll, ll> m, m2;
vector<int> v;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a;
v.push_back(a);
m[a]+... | #include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <vector>
using ll = long long;
using namespace std;
int main(void) {
ll n, a, sum = 0, one = 0;
map<ll, ll> m, m2;
vector<int> v;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a;
v.push_back(a);
m[a]+... | replace | 26 | 29 | 26 | 30 | TLE | |
p02732 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end() // 昇順
#define RALL(x) (x).rbegin(), (x).rend() // 降順
const long long mod = 1e9 + 7;
typedef long long ll; // ll とdoubleは違う
typedef pr... | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end() // 昇順
#define RALL(x) (x).rbegin(), (x).rend() // 降順
const long long mod = 1e9 + 7;
typedef long long ll; // ll とdoubleは違う
typedef pr... | replace | 54 | 55 | 54 | 55 | -11 | |
p02732 | C++ | Runtime Error | // #include "pch.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <algorithm>
#include <bitset>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define ll long long... | // #include "pch.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <algorithm>
#include <bitset>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define ll long long... | replace | 37 | 39 | 37 | 39 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mx 200005
#define ll long long
ll arr[mx] = {0};
ll contribute[mx] = {0};
int in[mx];
int main() {
ios_base::sync_with_stdio(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n, a;
cin >> n;
for (in... | #include <bits/stdc++.h>
using namespace std;
#define mx 200005
#define ll long long
ll arr[mx] = {0};
ll contribute[mx] = {0};
int in[mx];
int main() {
ios_base::sync_with_stdio(0);
int n, a;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a;
arr[a]++;
in[i] = a;
}
ll sum = 0;
for (int i = 1... | replace | 9 | 13 | 9 | 10 | -11 | |
p02732 | C++ | Runtime Error | ///*
// 正在播放《フリージア》
// 1:21 ━━━━━━●───── 5:35
// ? ? ?? ? ?
//```````'`...```````''`````````````'````````````````'`.`''
//```````''..`';;'```''```'''''''''''''`````````````````'':
//.````''''':;;!!:````'````'''''''''''``````````````````'':
//``''''''':;;;;;'```'``````''```````````____________```'':
//````... | ///*
// 正在播放《フリージア》
// 1:21 ━━━━━━●───── 5:35
// ? ? ?? ? ?
//```````'`...```````''`````````````'````````````````'`.`''
//```````''..`';;'```''```'''''''''''''`````````````````'':
//.````''''':;;!!:````'````'''''''''''``````````````````'':
//``''''''':;;;;;'```'``````''```````````____________```'':
//````... | replace | 101 | 102 | 101 | 102 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define int long long
using namespace std;
int n;
int a[100005], num[100005], sum;
int cal(int x) { return x * (x - 1) / 2; }
signed main() {
scanf("%lld", &n);
for (int i = 1; i <= n; i++)
scanf("%lld", &a[i]), num[a[i]]++;
for (in... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#define int long long
using namespace std;
int n;
int a[1000005], num[1000005], sum;
int cal(int x) { return x * (x - 1) / 2; }
signed main() {
scanf("%lld", &n);
for (int i = 1; i <= n; i++)
scanf("%lld", &a[i]), num[a[i]]++;
for (... | replace | 7 | 8 | 7 | 8 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long mp[30005] = {0};
signed main() {
long long n;
cin >> n;
long long a[n + 5];
set<long long> st;
for (long long i = 0; i < n; ++i) {
/* code */
cin >> a[i];
st.insert(a[i]);
mp[a[i]]++;
}
long long sum = 0;
for (long long ele... | #include <bits/stdc++.h>
using namespace std;
long long mp[300005] = {0};
signed main() {
long long n;
cin >> n;
long long a[n + 5];
set<long long> st;
for (long long i = 0; i < n; ++i) {
/* code */
cin >> a[i];
st.insert(a[i]);
mp[a[i]]++;
}
long long sum = 0;
for (long long el... | replace | 4 | 5 | 4 | 5 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
const int INF = 2147483647; // int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll n;
cin >> n;
unordered_map<ll, ll> m;
vector<ll> v(n);
rep(i, n) {
int in;
c... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
const int INF = 2147483647; // int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
ll n;
cin >> n;
unordered_map<ll, ll> m;
vector<ll> v(n);
rep(i, n) {
int in;
c... | replace | 19 | 35 | 19 | 27 | TLE | |
p02732 | C++ | Runtime Error |
#include "bits/stdc++.h"
#define MOD 1000000007
#define rep(i, N) for (int i = 0; i < N; i++)
#define ll long long
#define int long long
using namespace std;
class Fact {
public:
vector<ll> f;
Fact(ll n) {
f = vector<ll>(n + 1);
f[0] = 1;
f[1] = 1;
for (int i = 2; i <= n; i++)
f[i] = f[i -... |
#include "bits/stdc++.h"
#define MOD 1000000007
#define rep(i, N) for (int i = 0; i < N; i++)
#define ll long long
#define int long long
using namespace std;
class Fact {
public:
vector<ll> f;
Fact(ll n) {
f = vector<ll>(n + 1);
f[0] = 1;
f[1] = 1;
for (int i = 2; i <= n; i++)
f[i] = f[i -... | replace | 36 | 37 | 36 | 37 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long a[N], b[N];
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long int n = 0;
cin >> n;
for (i... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long a[N], b[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long int n = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
b[a[i]]++;
}
long long sum = 0;
for (int i = 0; i <... | delete | 7 | 12 | 7 | 7 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
template <class T> void chmin(T &x, T y) {
if (x < y)
x = y;
}
template <class T> void chmax(T &x, T y) {
if (x > y)
x = y;
}
int N;
map<int, ll> mp;
int A[100010];
ll sum;
int main() {
cin >> N;
for (int i = 0; i < N;... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
template <class T> void chmin(T &x, T y) {
if (x < y)
x = y;
}
template <class T> void chmax(T &x, T y) {
if (x > y)
x = y;
}
int N;
map<int, ll> mp;
int A[200010];
ll sum;
int main() {
cin >> N;
for (int i = 0; i < N;... | replace | 14 | 15 | 14 | 15 | 0 | |
p02732 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define fore(i, a) for (auto &i : a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define fore(i, a) for (auto &i : a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#... | replace | 46 | 53 | 46 | 49 | TLE | |
p02732 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <vector>
#define REP(i, n, N) for (ll i = (n); i < (N); i++)
// #define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--)
#define p(s) cout << (s) << endl
#define p2(a, b) cout << (a... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <stdio.h>
#include <vector>
#define REP(i, n, N) for (ll i = (n); i < (N); i++)
// #define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--)
#define p(s) cout << (s) << endl
#define p2(a, b) cout << (a... | replace | 53 | 58 | 53 | 55 | TLE | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define watc... | #include <bits/stdc++.h>
using namespace std;
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define watc... | replace | 52 | 53 | 52 | 53 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100010;
ll n, a[N], num[N];
int main() {
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i], num[a[i]]++;
ll ans = 0;
for (int i = 1; i <= n; i++) {
ans += (num[i] - 1) * num[i] / 2;
// cout<<num[i]<<endl;
}
// cout... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 200010;
ll n, a[N], num[N];
int main() {
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i], num[a[i]]++;
ll ans = 0;
for (int i = 1; i <= n; i++) {
ans += (num[i] - 1) * num[i] / 2;
// cout<<num[i]<<endl;
}
// cout... | replace | 3 | 4 | 3 | 4 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define inf 1000000000000000000
#define ll long long
#define max(A, B) ((A) > (B) ? (A) : (B))
#define min(A, B) ((A) < (B) ? (A) : (B))... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define inf 1000000000000000000
#define ll long long
#define max(A, B) ((A) > (B) ? (A) : (B))
#define min(A, B) ((A) < (B) ? (A) : (B))... | replace | 23 | 25 | 23 | 25 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long con(long long n) { return n * (n - 1) / 2; }
int main() {
long long N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
}
vector<int> cnt(N);
for (int i = 0; i < N; i++)
cnt.at(A.at(i))++;
long long sum = 0;
f... | #include <bits/stdc++.h>
using namespace std;
long long con(long long n) { return n * (n - 1) / 2; }
int main() {
long long N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A.at(i);
A.at(i)--;
}
vector<int> cnt(N);
for (int i = 0; i < N; i++)
cnt.at(A.at(i))++;
long lo... | insert | 11 | 11 | 11 | 12 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n;
int a[N];
int occ[N];
long long ans;
int main() {
// freopen("in.in" , "r" , stdin);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
ans += occ[a[i]]++;
}
for (int i = 0; i < n; i++) {
ans -= --occ[a[i]];
cout... | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int n;
int a[N];
int occ[N];
long long ans;
int main() {
// freopen("in.in" , "r" , stdin);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
ans += occ[a[i]]++;
}
for (int i = 0; i < n; i++) {
ans -= --occ[a[i]];
cout... | replace | 4 | 5 | 4 | 5 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
int A[100000];
int cnt[100000];
c... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
int A[200000];
int cnt[200000];
c... | replace | 17 | 19 | 17 | 19 | 0 | |
p02732 | C++ | Runtime Error | #include <iostream>
#include <set>
using namespace std;
const int maxn = 1e5 + 50;
long long a[maxn], cnt[maxn];
set<int> temp;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
cnt[a[i]]++;
}
long long ans = 0;
for (int i = 1; i <= n; ++i) {
if (cnt[i])
ans += (c... | #include <iostream>
#include <set>
using namespace std;
const int maxn = 2e5 + 50;
long long a[maxn], cnt[maxn];
set<int> temp;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
cnt[a[i]]++;
}
long long ans = 0;
for (int i = 1; i <= n; ++i) {
if (cnt[i])
ans += (c... | replace | 4 | 5 | 4 | 5 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
ll N;
ll A[100005];
ll cnt[100005];
ll calc(ll n) { return n * (n - 1) / 2; }
int main() {
cin >> N;
ll a... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
ll N;
ll A[200005];
ll cnt[200005];
ll calc(ll n) { return n * (n - 1) / 2; }
int main() {
cin >> N;
ll a... | replace | 15 | 17 | 15 | 17 | 0 | |
p02732 | C++ | Runtime Error | // made by capeta160
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define etm ... | // made by capeta160
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define etm ... | replace | 364 | 365 | 364 | 365 | 0 | |
p02732 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;
ll A[100010];
ll... | #include <algorithm>
#include <cmath>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;
ll A[200010];
ll... | replace | 16 | 18 | 16 | 18 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define F first
#define S second
#define mp make_pair
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, n, m) for (int i = n; i <= m; i++)
#define read(n) cin >> n;
#define write(n) cout << n;
using namespace std;
const int N = 1e5 + 5;... | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define F first
#define S second
#define mp make_pair
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, n, m) for (int i = n; i <= m; i++)
#define read(n) cin >> n;
#define write(n) cout << n;
using namespace std;
const int N = 2e5 + 5;... | replace | 11 | 12 | 11 | 12 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int cnt[100010], a[100010];
int main() {
int n, c = 0;
ll ans = 0;
cin >> n;
for (int i = 0; i < n; i++) {
int k;
cin >> a[i];
// if(cnt[a[i]]==0)c++;
cnt[a[i]]++;
}
for (int i = 1; i <= n; i++) {
if (cnt[i]) {
ans... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll cnt[200010], a[200010];
int main() {
int n, c = 0;
ll ans = 0;
cin >> n;
for (int i = 0; i < n; i++) {
int k;
cin >> a[i];
// if(cnt[a[i]]==0)c++;
cnt[a[i]]++;
}
for (int i = 1; i <= n; i++) {
if (cnt[i]) {
ans ... | replace | 3 | 4 | 3 | 4 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define SpeeD ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define ll long long
#define endl '\n'
// pair<int, int> *p=new pair<int, int>[n];
// std::vector<pair<int,int>> vp;
// v.push_back(make_pair(x,y))
// pair<int, int> p[1000001];
// string *s=new string [n];
// int freq[e];
// ... | #include <bits/stdc++.h>
#define SpeeD ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define ll long long
#define endl '\n'
// pair<int, int> *p=new pair<int, int>[n];
// std::vector<pair<int,int>> vp;
// v.push_back(make_pair(x,y))
// pair<int, int> p[1000001];
// string *s=new string [n];
// int freq[e];
// ... | replace | 15 | 16 | 15 | 16 | 0 | |
p02732 | C++ | Runtime Error | /* ***********************************************
Author :taciturnity
Created Time :2020/2/21 8:23:51
File Name :TEST.cpp
************************************************ */
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
... | /* ***********************************************
Author :taciturnity
Created Time :2020/2/21 8:23:51
File Name :TEST.cpp
************************************************ */
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
... | replace | 30 | 31 | 30 | 31 | 0 | |
p02732 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, c) for (int i = 0; i < (int)c; ++i)
using llint = long long int;
using namespace std;
int main() {
int N;
map<llint, llint> mp;
vector<llint> A(N);
cin >> N;
rep(i, N) {
cin >> A[i];
mp[A[i]]++;
}
llint num = 0;
for (auto itr = mp.begin(); itr != mp.end... | #include <bits/stdc++.h>
#define rep(i, c) for (int i = 0; i < (int)c; ++i)
using llint = long long int;
using namespace std;
int main() {
int N;
map<llint, llint> mp;
int A[200006];
cin >> N;
rep(i, N) {
cin >> A[i];
mp[A[i]]++;
}
llint num = 0;
for (auto itr = mp.begin(); itr != mp.end(); i... | replace | 9 | 10 | 9 | 10 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.