submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s913429016 | p04022 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#in... | a.cc: In function 'const std::vector<_Tp>& get_primes(const T&, T2&)':
a.cc:282:45: error: expected ';' before 'iter'
282 | ITER(const_iterator iter, primes)
| ^~~~
a.cc:26:45: note: in definition of macro 'ITER'
26 | #define ITER(it,a) for ... |
s832717393 | p04022 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#in... | a.cc: In function 'const std::vector<_Tp>& get_primes(const T&, T2&)':
a.cc:282:30: error: need 'typename' before 'std::vector<_Tp>::const_iterator' because 'std::vector<_Tp>' is a dependent scope
282 | for (std::vector<T>::const_iterator iter = primes.begin(), end = primes.end();
| ... |
s450631881 | p04022 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#in... | a.cc:43:22: warning: overflow in conversion from 'LL' {aka 'long long int'} to 'int' changes value from '10009402209' to '1419467617' [-Woverflow]
43 | const int MAX1 = MAX * (LL)MAX;
| ~~~~^~~~~~~~~
a.cc: In function 'const std::vector<_Tp>& get_primes(const T&, T2&)':
a.cc:282:30: error: nee... |
s268623034 | p04022 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#in... | a.cc:43:22: warning: overflow in conversion from 'LL' {aka 'long long int'} to 'int' changes value from '10009402209' to '1419467617' [-Woverflow]
43 | const int MAX1 = MAX * (LL)MAX;
| ~~~~^~~~~~~~~
a.cc: In function 'const std::vector<_Tp>& get_primes(const T&, T2&)':
a.cc:282:30: error: nee... |
s374069309 | p04022 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#in... | a.cc:43:22: warning: overflow in conversion from 'LL' {aka 'long long int'} to 'int' changes value from '10009402209' to '1419467617' [-Woverflow]
43 | const int MAX1 = MAX * (LL)MAX;
| ~~~~^~~~~~~~~
a.cc: In function 'const std::vector<_Tp>& get_primes(const T&, T2&)':
a.cc:282:30: error: nee... |
s534921281 | p04022 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <vector>
using namespace std;
typedef long long LL;
const int maxn = 100005;
LL a[maxn],t[maxn];int n,cnt,m,ans;
int prm[maxn],tot,is[maxn],ord[maxn];
void predo(int n) {
for (int i=2;i<=n;i++)
{
if (!is[i]) prm[++tot]=i;
... | a.cc: In function 'void solve(LL)':
a.cc:38:15: error: 'sqrt' was not declared in this scope
38 | LL n_=sqrt(n);
| ^~~~
|
s199157557 | p04022 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <bitset>
#include <cmath>
using namespace std;
const int kMax = 2200;
const int kMaxPr = 500;
bitset < kMax > used;
void Init(vector < int > &prime) {
int index = 0;
for (int pr = 2; pr < kMax; pr ++) {
if (used[pr]) {
continue;
}
... | a.cc: In function 'int main(int, const char**)':
a.cc:118:2: error: expected '}' at end of input
118 | }
| ^
a.cc:31:40: note: to match this '{'
31 | int main(int argc, char const *argv[]) {
| ^
|
s180064377 | p04022 | C++ | 10
1
10
100
1000000007
10000000000
1000000009
999999999
999
999
999 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10
| ^~
|
s583045985 | p04022 | C++ | #include <bits/stdc++.h>
#define FI(i,a,b) for(int i=(a);i<=(b);i++)
#define FD(i,a,b) for(int i=(a);i>=(b);i--)
#define LL long long
#define Ldouble long double
#define PI 3.14159265358979323846264338327950288419
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define mp make_pair
#define fi first
#define se seco... | a.cc: In function 'int main()':
a.cc:69:26: error: 'INF' was not declared in this scope
69 | if(pa == INF) assert(!M.count(pa));
| ^~~
|
s003921556 | p04022 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
long long n, s[100000], t[100000], K, ret, inf = (1LL << 40), num[2]; vector<pair<long long, int>>vec; bool used[100000];
long long solve(long long I) {
long long ret = 1;
for (long long i = 2; i <= 2500; i++) {
long long U = 0; while (I%i... | a.cc: In function 'long long int solve(long long int)':
a.cc:15:23: error: 'sqrtl' was not declared in this scope; did you mean 'strtol'?
15 | long long G = sqrtl(1.0L*I); if (G*G == I) { ret *= G; }
| ^~~~~
| strtol
|
s757851961 | p04022 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
long long n, s[100000], t[100000], col[100000], cnt, num[100000]; vector<pair<long long, int>>F;
map<long long, bool>M;
void dfs(int pos, int depth) {
if (col[pos] != -1)return;
col[pos] = depth; num[depth]++;
if (t[pos] == -1... | a.cc: In function 'int main()':
a.cc:32:39: error: 'sqrtl' was not declared in this scope; did you mean 'strtol'?
32 | long long H = sqrtl(1.0L*I);
| ^~~~~
| strtol
|
s338243926 | p04022 | C++ | #include <cstdio>
#include <cstring>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#define a first
#define b second
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR (i, 0, n)
#define _ << " _ " <<
#define TRACE(x) cerr << #x << " =... | a.cc:17:9: warning: "debug" redefined
17 | #define debug
| ^~~~~
a.cc:16:9: note: this is the location of the previous definition
16 | #define debug(...) fprintf(stderr, __VA_ARGS__)
| ^~~~~
a.cc:18:9: warning: "TRACE" redefined
18 | #define TRACE(x)
| ^~~~~
a.cc:15:9:... |
s617810457 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define si(X) scanf("%d", &(X))
#define sll(X) scanf("%lld",&(X))
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int mod = 1e9+7;
ll gcd(ll a,ll b){
if(b==0)
return a;return gcd(b,a%b);
}
ll expo(ll base,ll pow){
ll ans = ... | a.cc: In function 'long long int complement(long long int)':
a.cc:76:21: error: 'mul' was not declared in this scope; did you mean 'fmul'?
76 | y = mul(y, p), x /= p, x /= p;
| ^~~
| fmul
a.cc:78:28: error: 'mul' was not declared in this scope; did ... |
s357054328 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define si(X) scanf("%d", &(X))
#define sll(X) scanf("%lld",&(X))
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int mod = 1e9+7;
ll gcd(ll a,ll b){
if(b==0)
return a;return gcd(b,a%b);
}
ll expo(ll base,ll pow){
ll ans = 1... | a.cc: In function 'int main()':
a.cc:106:27: error: no match for 'operator=' (operand types are 'std::map<long long int, int>::iterator' {aka 'std::_Rb_tree<long long int, std::pair<const long long int, int>, std::_Select1st<std::pair<const long long int, int> >, std::less<long long int>, std::allocator<std::pair<const... |
s201039094 | p04022 | C++ | #include<bits/stdc++.h>
#define lim 2154
#define ll long long
using namespace std;
ll a[100010];
ll b[100010];
ll p[100010];
map<ll,ll> vis;
map<ll,ll> cnt1;
map<ll,ll> sqr;
map<ll,ll> root;
vector<ll> v;
void sieve()
{
ll i,j,k,l;
sqr[1]=1;
root[1]=1;
for(i=2;i<=100000;i++)
{
if(p[i]) cont... | a.cc:111:4: error: redefinition of 'long long int a [100010]'
111 | ll a[100010];
| ^
a.cc:5:4: note: 'long long int a [100010]' previously declared here
5 | ll a[100010];
| ^
a.cc:112:4: error: redefinition of 'long long int b [100010]'
112 | ll b[100010];
| ^
a.cc:6:4: note: 'long l... |
s194981116 | p04022 | C++ | #define _USE_MATH_DEFINES
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <math.h>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <stdio.h>
#include <string.h>
#inclu... | a.cc: In function 'int main()':
a.cc:114:11: error: expected '}' at end of input
114 | return 0;
| ^
a.cc:82:11: note: to match this '{'
82 | int main(){
| ^
|
s609636674 | p04022 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
typedef long long int LL;
bool same_cube = 1, czy_jest_cube = 0;
int n;
LL pom, wynik;
const int stala = 2155, stala_1 = 100007;
const LL reszta = 1000000000000000007LL, wspolczynnikPoczatkowy = 20000000009LL;
bool zajete[stala]... | a.cc: In function 'int main()':
a.cc:165:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
165 | sort(kolejnosc.begin(), kolejnosc.end(), sort_kolejnosc);
| ^~~~
| sqrt
|
s044531389 | p04022 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <unordered_se... | a.cc: In function 'int main()':
a.cc:26:10: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__int128')
26 | cout << numeric_limits<__int128>::max() << endl;
| ~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | ... |
s601060547 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
map<long long, long long> cnt;
long long arr[100050];
bool isPrime[100050];
vector<long long> prime;
long long Slove(long long n)
{
for(vector<long long>::size_type i = 0; i < prime.size(); ++i)
{
if(prime[i] * prime[i] * prime[i] > n)
break;
... | a.cc: In function 'int main()':
a.cc:41:29: error: cannot bind non-const lvalue reference of type 'std::_Rb_tree_iterator<std::pair<const long long int, long long int> >&' to an rvalue of type 'std::map<long long int, long long int>::iterator' {aka 'std::_Rb_tree<long long int, std::pair<const long long int, long long ... |
s355385618 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
map<long long, long long> cnt;
long long arr[100050];
bool isPrime[100050];
vector<long long> prime;
long long Slove(long long n)
{
for(vector<long long>::size_type i = 0; i < prime.size(); ++i)
{
if(prime[i] * prime[i] * prime[i] > n)
break;
... | a.cc: In function 'int main()':
a.cc:43:26: error: base operand of '->' has non-pointer type 'std::map<long long int, long long int>'
43 | long long a = cnt->first;
| ^~
|
s342883147 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
map<__int64, __int64> match;
map<__int64, __int64> cnt;
__int64 arr[100050];
bool isPrime[100050];
vector<__int64> prime;
__int64 Slove(__int64 n)
{
for(vector<__int64>::size_type i = 0; i < prime.size(); ++i)
{
while(n % (prime[i] * prime[i] * prime[i]) ==... | a.cc:4:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
4 | map<__int64, __int64> match;
| ^~~~~~~
| __ynf64
a.cc:4:14: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
4 | map<__int64, __int64> match;
| ^~~~~~~
| ... |
s243245228 | p04022 | C++ | #include <iostream>
#include <vector>
#define NMAX 100000
#define REP(i, a, n) for(int i = a; i < n; i++)
using namespace std;
typedef long long ll;
int N;
ll s[NMAX];
vector<int> prime;
pair< pair<ll, ll>, bool > norm[NMAX];
int main(void) {
cin >> N;
REP(i, 0, N) cin >> s[i];
bool ptable[NMAX] = {false};
... | a.cc: In function 'int main()':
a.cc:52:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
52 | std::sort(norm, norm + N);
| ^~~~
| qsort
|
s336906346 | p04022 | C++ | #include <iostream>
#include <vector>
#define NMAX 100000
#define REP(i, a, n) for(int i = a; i < n; i++)
using namespace std;
typedef long long ll;
int N;
ll s[NMAX];
vector<int> prime;
pair< pair<ll, ll>, bool > norm[NMAX];
int main(void) {
cin >> N;
REP(i, 0, N) cin >> s[i];
bool ptable[NMAX] = {false};
... | a.cc: In function 'int main()':
a.cc:52:3: error: 'sort' was not declared in this scope; did you mean 'short'?
52 | sort(norm, norm + N);
| ^~~~
| short
|
s990825613 | p04022 | Java | import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Collections... | Main.java:90: error: 'catch' without 'try'
catch (Exception e){}
^
Main.java:77: error: 'try' without 'catch', 'finally' or resource declarations
try {
^
Main.java:94: error: illegal start of expression
public static long inv(long v) {
^
3 errors
|
s381934263 | p04022 | Java | import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Collections... | Main.java:73: error: illegal character: '\u00a0'
if(map2.contains(red))?{
^
Main.java:76: error: 'else' without 'if'
} else {
^
2 errors
|
s923179776 | p04022 | Java | import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.Collections... | Main.java:78: error: illegal start of expression
public static long inv(long v) {
^
1 error
|
s324740225 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define deb... | In file included from /usr/include/c++/14/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
from a.cc:1:
a.cc: In function 'int main()':
a.cc:92:23: error: 'p' was not declared in this scope
92 | assert(n==p);
| ^
|
s874061555 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define deb... | In file included from /usr/include/c++/14/cassert:44,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
from a.cc:1:
a.cc: In function 'int main()':
a.cc:92:23: error: 'p' was not declared in this scope
92 | assert(n==p);
| ^
|
s607684663 | p04022 | C++ | #include <iostream>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <string>
#include <stack>
#include <limits>
#include <cassert>
#include <fstream>
#include <cstring>
#include <bitset>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <ciso646>
using ... | a.cc: In constructor 'prime::prime(long long unsigned int)':
a.cc:61:26: error: 'sqrt' was not declared in this scope
61 | ull ma = sqrt(num) + 1;
| ^~~~
a.cc: In member function 'bool prime::IsPrime(long long unsigned int)':
a.cc:81:26: error: 'sqrt' was not declared i... |
s518532184 | p04022 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <iomanip>
// #include <cmath>
#include <cassert>
using namespace std;
typedef __int128_t ll;
const int MAX_SIZE = 4000;
bool isprime[MAX_SIZE];
vector... | a.cc: In function 'll conj(ll)':
a.cc:73:11: error: 'sqrt' was not declared in this scope; did you mean 'sq'?
73 | ll sq = sqrt(red);
| ^~~~
| sq
a.cc:75:7: error: 'floor' was not declared in this scope
75 | t = floor(t);
| ^~~~~
a.cc: In function 'int main()':
a.cc... |
s952283939 | p04022 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <iomanip>
// #include <cmath>
#include <cassert>
using namespace std;
typedef int128_t ll;
const int MAX_SIZE = 4000;
bool isprime[MAX_SIZE];
vector<l... | a.cc:16:9: error: 'int128_t' does not name a type; did you mean 'int8_t'?
16 | typedef int128_t ll;
| ^~~~~~~~
| int8_t
a.cc:20:8: error: 'll' was not declared in this scope
20 | vector<ll> prime_num;
| ^~
a.cc:20:10: error: template argument 1 is invalid
20 | vector<ll... |
s422507708 | p04022 | C++ |
#include <iostream>
#include <cassert>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <set>
#include <map>
#include <iomanip>
#include <math.h>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <fstream>
#define REP(i, n) for (int i = 0; i < n; ++i)
#def... | a.cc: In function 'void solve()':
a.cc:153:26: error: 'antipattern' was not declared in this scope; did you mean 'antiPattern'?
153 | if (s[i] != 1 || antipattern > MAXPATTERN) {
| ^~~~~~~~~~~
| antiPattern
|
s342139391 | p04022 | C++ | jinclude <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef double DB;
#define F(i,a,b) for(int i=(a);i<=(b);++i)
#define R(i,n) for(int i=0;i<(n);++i)
#define fill(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
const LL INF = 1e10 + 7;
int n,tot;
map<LL,int> cnt;
map<LL,LL> cp;
LL ... | a.cc:1:1: error: 'jinclude' does not name a type
1 | jinclude <bits/stdc++.h>
| ^~~~~~~~
a.cc:15:1: error: 'map' does not name a type
15 | map<LL,int> cnt;
| ^~~
a.cc:16:1: error: 'map' does not name a type
16 | map<LL,LL> cp;
| ^~~
a.cc: In function 'int main()':
a.cc:41:9: error: 'scanf' w... |
s668063393 | p04022 | C++ | #include <bits/stdc++.h>
using namespace std;
jypedef long long LL;
typedef double DB;
#define F(i,a,b) for(int i=(a);i<=(b);++i)
#define R(i,n) for(int i=0;i<(n);++i)
#define fill(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
const LL INF = 1e10 + 7;
int n,tot;
map<LL,int> cnt;
map<LL,LL> cp;
LL p[4... | a.cc:3:1: error: 'jypedef' does not name a type; did you mean 'typedef'?
3 | jypedef long long LL;
| ^~~~~~~
| typedef
a.cc:12:7: error: 'LL' does not name a type
12 | const LL INF = 1e10 + 7;
| ^~
a.cc:15:5: error: 'LL' was not declared in this scope
15 | map<LL,int> cnt;
| ... |
s189344819 | p04022 | C++ | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define li long long
#define itn int
using namespace std;
inline int nxt(){
int n;
scanf("%d", &n);
return n;
}
int gcd(int x, int y){
while (y){
x %= y;
swap(x, y);
}
return x;
}
const int mod = 1000000007;
long long pw(long long a, long lo... | a.cc: In function 'int main()':
a.cc:140:44: error: 'class std::bitset<22000>' has no member named 'empty'
140 | while (i < n && h[i].first.empty())
| ^~~~~
|
s436237057 | p04022 | C++ | #include <cstdio>
#include <cstring>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#define MEM(x, y) memset((x), (y), sizeof(x))
#define X first
#define Y second
typedef long long lld;
typedef std::pair<int,int> pii;
typedef std::vector<pii> vip;
typedef std::priority_queue<pii, vip, std::greater... | a.cc: In function 'void addEdge(int, int, int)':
a.cc:31:44: error: 'wei' was not declared in this scope
31 | prv[cntE]=upper[U], nxt[cntE] = V, wei[cntE] = W, upper[U]=cntE++;
| ^~~
a.cc: In function 'bool bfs()':
a.cc:43:33: error: 'qtr' was not declared in ... |
s912648153 | p04022 | C++ | #include<bits/stdc++.h>
using namespace std;
class Disjointset {
public:
vector<int> rank,p;
Disjointset(){}
Disjointset(int size){
rank.resize(size,0);
p.resize(size,0);
for(int i=0;i<size;i++) makeSet(i);
}
void makeSet(int x){
p[x]=x;
rank[x]=0;
}
bool same(int x,int y){
return ... | a.cc: In function 'int main()':
a.cc:53:46: error: expected ')' before ']' token
53 | if(k*k*k==max(s[i],s[j])/min(s[i],s[j])]) d.unite(i,j);
| ~ ^
| )
a.cc:53:46: error: expected primary-expression before ']' t... |
s409893318 | p04022 | C++ | #include <iostream>
#include <unordered_map>
#include <algorithm>
#include <vector>
using namespace std;
int N;
vector<int> p;
bool s[100005];
using pii = pair<long long int, int>;
vector<pii> factor(long long int x) {
vector<pii> f;
for(long long int curp: p) {
int dc = 0;
while(x % curp ==... | a.cc:36:33: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::vector<std::pair<long long int, int> >; _Tp = int; _Hash = std::hash<std::vector<std::pair<long long int, int> > >; _Pred = std::equal_to<std::vector<std::pair<long long int, int> > >; _All... |
s902085564 | p04023 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define ull unsigned ll
#define f first
#define s second
#define ALL(x) x.begin(),x.end()
#define SZ(x) (int)x.size()
#define SQ(x) (x)*(x)
#define MN(a,b) a = min(a,(__typeof__(a))(b))
#define MX(a,b) a = max(a,(__typeof__(a)... | a.cc: In function 'int main()':
a.cc:3:12: error: expected primary-expression before 'long'
3 | #define ll long long
| ^~~~
a.cc:72:37: note: in expansion of macro 'll'
72 | numat[tt] += numat[i] * ll(me / lens[tt]);
| ^~
|
s048247966 | p04023 | C++ | // in the name of GOD
#include <bits/stdc++.h>
#define S second
#define F first
#define pb push_back
#define sz(cp) 1LL*cp.size()
#define tm are_you_now_tm_is_define_?
#define ta(c) c-'a'+1
//#define int long long
using namespace std;
typedef long long ll ;
typedef long double ld ;
typedef pair < ll , ll > pii ;
con... | a.cc: In function 'void get_yal(int, ll)':
a.cc:26:20: error: no matching function for call to 'min(long long int, __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type)'
26 | int j = min(1LL*i-1,upper_bound(mv.begin(),mv.end(),w1)-mv.begin()-1) ;
| ... |
s673828290 | p04023 | C++ | #include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acos(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memse... | a.cc: In function 'int main()':
a.cc:58:18: error: invalid use of member function 'std::map<long long int, long long int>::rbegin' (did you forget the '()' ?)
58 | if(m.rbegin->x%v[i]!=0)
| ~~^~~~~~
|
s601063833 | p04023 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <array>
#include <l... | a.cc:67:6: error: stray '#' in program
67 | }#include <cstdio>
| ^
a.cc: In function 'int main()':
a.cc:67:7: error: 'include' was not declared in this scope
67 | }#include <cstdio>
| ^~~~~~~
a.cc:67:16: error: 'cstdio' was not declared in this scope; did you mean 'stdin'?
67 | ... |
s148541665 | p04023 | C++ | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cassert>
#define ll long long
using namespace std;
namespace IO
{
const int __S=(1<<20)+5;char __buf[__S],*__H,*__T;
inline char getc()
{
if(__H==__T) __T=(__H=__buf)+fread(__buf,1,__S,stdin);
if(__H==__T) ret... | a.cc: In function 'void IO::printd(long double, int)':
a.cc:58:34: error: 'floor' was not declared in this scope
58 | long long __t=(long long)floor(__x);print(__t);putc('.');__x-=(double)__t;
| ^~~~~
|
s170650536 | p04023 | C++ | #include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#define LL long long
#define M 200020
using namespace std;
LL read(){
LL nm=0,fh=1; LL cw=getchar();
for(;!isdigit(cw);cw=getchar()) if(cw=='-') fh=-fh;
for(;isdigit(cw);cw=getchar()) nm=nm*10+(cw-'0');
return nm*fh;
}
LL n,T,... | cc1plus: error: '::main' must return 'int'
|
s655589311 | p04023 | C++ | #include <bits/stdc++.h>
using namespace std;
namespace IO
{
const int __S=(1<<20)+5;char __bua[__S],*__H,*__T;
inline char getc()
{
if(__H==__T) __T=(__H=__buf)+fread(__buf,1,__S,stdin);
if(__H==__T) return -1;return *__H++;
}
template <class __I>inline void read(__I &__x)
{
__x=0;int __fg=1;char __c=getc(... | a.cc: In function 'char IO::getc()':
a.cc:8:39: error: '__buf' was not declared in this scope; did you mean '__bua'?
8 | if(__H==__T) __T=(__H=__buf)+fread(__buf,1,__S,stdin);
| ^~~~~
| __bua
a.cc: At global scop... |
s470409598 | p04023 | C++ | include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<iostream>
#define N 110000
#define LL long long
using namespace std;
LL sta[N],a[N],t[N],s[N],ans;
int tp,n,m;
int td(LL k,int r)
{
int l=1,res=0;
while(l<=r)
{
int mid=(l+r)/2;
if(a[mid]<=k) res=mid,l=mid+1;
... | a.cc:1:1: error: 'include' does not name a type
1 | include<cstring>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from a.cc:4:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164... |
s732863016 | p04023 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int MAXN = 100005;
typedef long long ll;
int n,q,top;
ll a[MAXN],op[MAXN],t[MAXN],d[MAXN];
inline int getnext(ll k,int r)
{
int l=1,mid,ret=-1;
while(l<=r){
mid=(l+r)>>1;
if(op[mid]<=k)l=mid+1,ret=mid;
else r=mid-1;
}
return r... | a.cc: In function 'int main()':
a.cc:22:9: error: 'stk' was not declared in this scope; did you mean 'std'?
22 | stk[++top]=n;
| ^~~
| std
|
s132980629 | p04023 | C++ | #include<bits/stdc++.h>
#define N (100009)
#define ll long long
using namespace std;
ll n,q,x,a[N],c,A[N],f[N];
ll main()
{
cin>>n>>q;
a[++c]=n;
for (ll i=1; i<=q; ++i)
{
cin>>x;
while (c && x<=a[c]) --c;
a[++c]=x;
}
f[c]=1;
for (ll i=c; i; --i)
{
ll k=a[i];
while (k>a[1])
{
ll t=lower_bound(a+1,... | cc1plus: error: '::main' must return 'int'
|
s385658239 | p04023 | C++ | #include<bits/stdc++.h>
typedef long long LL;
using namespace std;
const int MX=100005;
int n,Q;
LL a[MX],dt[MX],t[MX],x,cur,c;
int main(){
cin>>n>>Q,a[++c]=n;
for(int i=1;i<=Q;i++){cin>>x;while(c&&x<=a[c])--c;a[++c]=x;}
t[c]=1;
for(int i=c;i;i--){
LL tmp=a[i],it=lower_bound(a+1,a+i,tmp)-a;
for(;it;it=lower_... | a.cc: In function 'int main()':
a.cc:19:48: error: expected ';' before ')' token
19 | for(int i=1;i<=n;i++)cout<<(cur+=dt[i]))<<endl;
| ^
| ;
|
s683751806 | p04023 | C++ | #include<cstdio>
#include<algorithm>
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
using namespace std;
typedef long long ll;
const int maxn=100000+10,maxtot=maxn*25;
ll ans[maxn],cnt[maxn],a[maxn],b[maxn],tree[maxtot],p[maxn][70][2];
int root[maxn],left[maxtot],right[maxtot],rank[maxn];
int l... | a.cc: In function 'int main()':
a.cc:57:19: error: reference to 'rank' is ambiguous
57 | fo(i,1,m) rank[i]=lower_bound(b+1,b+num+1,a[i])-b;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
... |
s719603826 | p04023 | C++ | #include<bits/stdc++.h>
#define MX 30001000
using namespace std;
struct treaps
{
int son[MX][2],num[MX],cop[MX],inn[MX],tt;
long long size[MX],ans[MX];
int newnode(int s=0)
{
if (tt>MX) assert(0);
int t=++tt;
son[t][0]=son[s][0];
son[t][1]=son[s][1];
size[t]=size[s];
num[t]=num[s];
return t;
}
void... | a.cc: In member function 'int treaps::merge(int, int)':
a.cc:22:45: error: expected primary-expression before '%' token
22 | if (rand()*(1ll<<31)+rand())%(size[s]+size[t])<size[s])
| ^
a.cc:36:9: warning: control reaches end of non-void function [-Wre... |
s621901457 | p04023 | C++ | #include<cstdio>
#include<algorithm>
#include<cstring>
#define LL long long
using namespace std;
const int maxn=500001;
int n,q,sz=1;
LL a,st[maxn],cnt[maxn],sum[maxn],lazy[maxn];
inline int find(int l,int r,LL key)
{
while(l<=r)
{
int mid=(l+r)/2;
if(st[mid]>=key)
r=mid-1;
else l=mid+1;
}
return r;
}
inli... | a.cc: Assembler messages:
a.cc:40: Error: operand type mismatch for `mov'
|
s373353510 | p04023 | C++ | //C++14 (Clang 3.8.0)
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#includ... | a.cc: In function 'int main()':
a.cc:60:9: error: 'bef' was not declared in this scope
60 | bef=i-1;
| ^~~
|
s648527394 | p04023 | C++ | #include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <set>
#include <deque>
#include <cstring>
#include <functional>
#include <climits>
#include <list>
#include <ctime>
#include <complex>
#include <ext/rope>
#define F1(x,... | a.cc: In function 'int main()':
a.cc:52:29: error: no matching function for call to 'std::vector<std::pair<long long int, int> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
52 | F1(a,1,x.size())y.pb(x[a]%x[a-1]),y.pb(x[a]);
| ... |
s109670019 | p04023 | C | #include "stdio.h"
#include "climits"
int i = 0;
int j = 0;
int far;
int retu[100000];
int trynum;
int getnum[100000];
int num[100000];
int start;
int min();
int box;
int little;
int prev;
int startbox;
int cal;
int main() {
scanf("%d", &far);
scanf("%d", &trynum);
for (i = 0; i < trynum; i++) {
scanf("%d", &g... | main.c:2:10: fatal error: climits: No such file or directory
2 | #include "climits"
| ^~~~~~~~~
compilation terminated.
|
s744691017 | p04023 | C++ | #include <iostream>
#include <unordered_map>
#include <algorithm>
#include <vector>
using namespace std;
int N;
vector<int> p;
bool s[100005];
using pii = pair<long long int, int>;
vector<pii> factor(long long int x) {
vector<pii> f;
for(long long int curp: p) {
int dc = 0;
while(x % curp ==... | a.cc:36:33: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::vector<std::pair<long long int, int> >; _Tp = int; _Hash = std::hash<std::vector<std::pair<long long int, int> > >; _Pred = std::equal_to<std::vector<std::pair<long long int, int> > >; _All... |
s955818770 | p04024 | C++ | #include <cstdio>
using namespace std;
const int Mod = 1e9 + 7;
int Ad(int x, int y) { return ((x + y) > Mod) ? (x + y - Mod) : (x + y); }
int Dc(int x, int y) { return ((x - y) < 0) ? (x - y + Mod) : (x - y); }
int Ml(int x, int y) { return (long long)x * y % Mod; }
int ksm(int x, long long y) {
int ret = 1;
for (; ... | a.cc:44:33: error: 'll' has not been declared
44 | void ksm(Matrix &ans, Matrix x, ll y) {
| ^~
|
s454562414 | p04024 | C++ | #include<bits/stdc++.h>
using namespace std;
const int P=1e9+7;
const int N=1e3+5;
struct Mar{
int v[2][2];
}x,ans;
Mar operator * (Mar x,Mar y){
Mar ans;
for(int i=0;i<2;i++)
for(int j=0;j<2;j++){
ans.v[i][j]=0;
for(int k=0;k<2;k++)
ans.v[i][j]=(ans.v[i][j]+1LL*x.v[i][k]*y.v[k][j])%P;
}
return ans;
}... | a.cc:65:11: error: redefinition of 'const int P'
65 | const int P=1e9+7;
| ^
a.cc:3:11: note: 'const int P' previously defined here
3 | const int P=1e9+7;
| ^
a.cc:66:11: error: redefinition of 'const int N'
66 | const int N=1e3+5;
| ^
a.cc:4:11: note: 'const in... |
s706825135 | p04024 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define int long long
const int P = 1e9 + 7;
int h, w, cnt, s1, s2, f1, f2; lint k;
char s[1050][1050];
struct Maxtir {
int a[10][10], n;
void init(int _n, int x) {n = _n; memset(a, 0, sizeof a); for(int i = 1; i <= n; ++i) a[i][i] = x;}
Maxtir op... | a.cc: In function 'int main()':
a.cc:31:42: error: expected ';' before 'for'
31 | scanf("%lld%lld%lld", &h, &w, &k)
| ^
| ;
32 | for(int i = 1; i <= h; ++i) {
| ~~~ ... |
s869655561 | p04024 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <math.h>
#include <set>
#include <random>
#include <map>
#include <unordered_map>
#define FOR(i, n, m) for(ll i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = std:... | a.cc: In function 'int main()':
a.cc:215:9: error: too few arguments to function 'int r(std::vector<std::__cxx11::basic_string<char> >&)'
215 | if(r()) {
| ~^~
a.cc:151:5: note: declared here
151 | int r(vector<string>& s) {
| ^
|
s420041357 | p04024 | C++ | #include <bits/stdc++.h>
#define IL __inline__ __attribute__((always_inline))
#define For(i, a, b) for (int i = a, i##end = b; i <= i##end; ++ i)
#define FOR(i, a, b) for (int i = a, i##end = b; i < i##end; ++ i)
#define Rep(i, a, b) for (int i = a, i##end = b; i >= i##end; -- i)
#define REP(i, a, b) for (int i = (a)... | a.cc: In function 'int main()':
a.cc:134:5: error: 'row' was not declared in this scope; did you mean 'pow'?
134 | row |= ok;
| ^~~
| pow
a.cc:134:12: error: 'ok' was not declared in this scope; did you mean 'k'?
134 | row |= ok;
| ^~
| k
|
s158321140 | p04024 | C++ | 11 15 1000000000000000000
.....#.........
....###........
....####.......
...######......
...#######.....
..##.###.##....
..##########...
.###.....####..
.####...######.
###############
#.##..##..##..# | a.cc:2:6: error: stray '#' in program
2 | .....#.........
| ^
a.cc:3:5: error: stray '##' in program
3 | ....###........
| ^~
a.cc:3:7: error: stray '#' in program
3 | ....###........
| ^
a.cc:4:5: error: stray '##' in program
4 | ....####.......
| ^~
a.cc:4:7:... |
s362120097 | p04024 | C++ | 11 15 1000000000000000000
.....#.........
....###........
....####.......
...######......
...#######.....
..##.###.##....
..##########...
.###.....####..
.####...######.
###############
#.##..##..##..# | a.cc:2:6: error: stray '#' in program
2 | .....#.........
| ^
a.cc:3:5: error: stray '##' in program
3 | ....###........
| ^~
a.cc:3:7: error: stray '#' in program
3 | ....###........
| ^
a.cc:4:5: error: stray '##' in program
4 | ....####.......
| ^~
a.cc:4:7:... |
s043291714 | p04024 | C++ | #include<algorithm>
using namespace std;
const int N = 1005, P = 1e9 + 7;
int h, w, num, o1, o2, s;
using ll = long long;
ll k;
char m[N][N];
int qp (int a, ll b) {
int c = 1; for (; b; b >>= 1, a = 1ll * a * a % P) if (b & 1) c = 1ll * c * a % P; return c;
}
struct Matrix {
int T[2][2];
Matrix () { T[0][0] = T[0]... | a.cc: In function 'int main()':
a.cc:35:9: error: 'scanf' was not declared in this scope
35 | scanf("%d%d%lld", &h, &w, &k);
| ^~~~~
a.cc:36:28: error: 'puts' was not declared in this scope
36 | if (k <= 1) return puts("1"), 0; --k;
| ^~~~
a.cc:48:24:... |
s544412858 | p04024 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int ... | a.cc: In function 'int main()':
a.cc:34:35: error: 'M' was not declared in this scope
34 | scanf("%d%d",&n,&m); cin>>M;
| ^
|
s788777928 | p04024 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int ... | a.cc: In function 'int main()':
a.cc:66:35: error: 'k' was not declared in this scope
66 | ll ans = modpow(c,k-1);
| ^
a.cc:85:35: error: 'k' was not declared in this scope
85 | ll ans = modpow(c,k-1);
| ... |
s010999416 | p04024 | C | //ProblemD.cpp
#include <iostream>
static std::istream & ip = std::cin;
static std::ostream & op = std::cout;
#if OJ_MYPC
#include <ojio.h>
#endif
#ifndef OPENOJIO
#define OPENOJIO
#endif
#if 1 || DEFINE
/***************************************************************/
typedef unsigned long long u64;
typedef long ... | main.c:3:10: fatal error: iostream: No such file or directory
3 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s134743587 | p04024 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define forn(i, a, n) for (int i = a; i < n; ++i)
#define ford(i, a, n) for (int i = n - 1; i >= a; --i)
#define fore(i, a, n) for (int i = a; i <= n; ++i)
#define all(a) (a).begin(), (a).end()
... | a.cc: In function 'int main()':
a.cc:84:23: error: 'gets' was not declared in this scope; did you mean 'getw'?
84 | forn(i, 0, h) gets(a[i]);
| ^~~~
| getw
|
s898091929 | p04025 | C++ | #include <bits/stdc++.h>
using namespace std;
#define llong long long
#define len(x) ((int)x.size())
#define rep(i,n) for (int i = -1; ++ i < n; )
#define rep1(i,n) for (int i = 0; i ++ < n; )
#define rand __rand
mt19937 rng(chrono::system_clock::now().time_since_epoch().count()); // or mt19937_64
template<class T =... | a.cc: In function 'int main()':
a.cc:65:16: error: expected ';' before 'return'
65 | cout << ans
| ^
| ;
......
68 | return 0;
| ~~~~~~
|
s251541359 | p04025 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
const int INF = 2e9;
int main(){
int n;
cin >> n;
vector<int> a[n];
rep(i,n) cin >> a[i];
ll ans = INF;
for(int i = -100;i <= 100;i++){
ll sum = 0;... | a.cc: In function 'int main()':
a.cc:13:18: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>')
13 | rep(i,n) cin >> a[i];
| ~~~ ^~ ~~~~
| | |
| | std::vector<int>
... |
s905652725 | p04025 | C++ | r | a.cc:1:1: error: 'r' does not name a type
1 | r
| ^
|
s324912407 | p04025 | C++ | r | a.cc:1:1: error: 'r' does not name a type
1 | r
| ^
|
s379070057 | p04025 | C++ | #include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#incl... | a.cc: In function 'int main()':
a.cc:59:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
59 | int main(){
| ^~
a.cc:59:9: note: remove parentheses to default-initialize a variable
59 | int main(){
| ^~
| --
a.cc:59:9: note: or re... |
s607090068 | p04025 | C++ | //BISMILLAHIR RAHMANIR RAHIM
//By the name of ALLAH
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<iterator>
#include<numeric>
#define pi acos(-1.0)
using namespace std;
bool f(long long int x,long long int ... | a.cc: In function 'void solve()':
a.cc:23:11: error: 'ceil' was not declared in this scope
23 | int p=ceil((a[0]+a[t-1])/2);
| ^~~~
|
s200252602 | p04025 | C | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
int totalc = 50000;//
for (int i = -100; i <= 100; i++) {
int totalc_ati = 0;
for (int j = 0; j < n; j++) {
int sa = a.at(j) - i;//(x-y)
to... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s778099826 | p04025 | C++ | n = int(input());
a = list(map(int, input().split()));
a.sort()
ans = 1 << 60
for x in range(a[0], a[n-1]) :
res = 0
for j in range(n) :
res += abs(x - a[j])**2
ans = min(ans, res)
print(ans) | a.cc:1:1: error: 'n' does not name a type
1 | n = int(input());
| ^
a.cc:2:1: error: 'a' does not name a type
2 | a = list(map(int, input().split()));
| ^
a.cc:4:1: error: 'a' does not name a type
4 | a.sort()
| ^
|
s551656659 | p04025 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
cin >> N;
vector<long long> a(N);
long long sun = 0;
for(int i = 0; i < N; i++) {
cin >> a[i];
sum += a[i];
}
long long ave = sum / N;
long long ave2 = ave + 1;
long long res = 0, res2 = 0;
for(int i = 0; i < N; i+... | a.cc: In function 'int main()':
a.cc:11:5: error: 'sum' was not declared in this scope; did you mean 'sun'?
11 | sum += a[i];
| ^~~
| sun
a.cc:13:19: error: 'sum' was not declared in this scope; did you mean 'sun'?
13 | long long ave = sum / N;
| ^~~
| ... |
s269054772 | p04025 | C++ | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,no-stack-protector,fast-math")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 1e5 + 5, M = 2 * N + 5;
ll ans(LLONG_MAX)
int n, a[N];
int ... | a.cc:10:1: error: expected ',' or ';' before 'int'
10 | int n, a[N];
| ^~~
a.cc: In function 'int check(int)':
a.cc:18:25: error: 'n' was not declared in this scope
18 | for(int i = 0 ; i < n ; ++i)
| ^
a.cc:19:26: error: 'a' was not declared in this scope
19 | r... |
s166257708 | p04025 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
sum+=a[i];
}
int p=sum/n;
int ans1=0,ans2=0;
for(int i=0;i<n;i++){
ans1+=((a[i]-p)*(a[i]-p));
ans2+((a[i]-(p+1))*(a[i]-(p+1)));
}
cout<<min(ans1,ans2)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'sum' was not declared in this scope
9 | sum+=a[i];
| ^~~
a.cc:11:9: error: 'sum' was not declared in this scope
11 | int p=sum/n;
| ^~~
|
s831031818 | p04025 | C++ | #ifndef UNTITLED15_TEMPLATE_H
#define UNTITLED15_TEMPLATE_H
#ifdef _DEBUG
#include "bits_stdc++.h"
#else
#include <bits/stdc++.h>
#endif
#ifndef fast_sort
#define fast_sort sort
#endif
#define use_pq
#define use_for
#define use_for_each
#define use_sort
#define use_fill
#define use_rand
#define use_mgr
#define use_... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s290008271 | p04025 | C++ | int main() {
int N;
cin >> N;
int sum = 0;
vector<int> A(N);
rep(i, N) {
cin >> A[i];
sum += A[i];
}
int mean = sum / N;
int can1, can2, can3, can4;
can1 = mean + 1;
can2 = mean + 2;
can3 = mean - 1;
can4 = mean - 2;
int res, res1, res2, res3, res4;
... | a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> N;
| ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
5 | vector<int> A(N);
| ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
5 | vector<int> A(N);
... |
s400916372 | p04025 | C++ | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;
int main() {
int n, m = 1000000000;
cin >> n;
vector<int> v(n);
rep(i, n) cin >> v[i];
sort(v.begin(), v.end());
rep(i, n){
int tmp = 0
rep(j, n) tmp += (v[i]-v[j])*(v[i]-v[j]);
m = min(... | a.cc: In function 'int main()':
a.cc:3:19: error: expected ',' or ';' before 'for'
3 | #define rep(i, n) for(int i = 0; i < n; ++i)
| ^~~
a.cc:14:5: note: in expansion of macro 'rep'
14 | rep(j, n) tmp += (v[i]-v[j])*(v[i]-v[j]);
| ^~~
a.cc:14:9: error: 'j' was not declared ... |
s310091226 | p04025 | C++ | #include<bits/stdc++.h>
using namespace std;
int A[MAXN];
int N;
int sub;
int ans;
int main(){
cin>>N;
for (int i=1;i<=N;++i)cin>>A[i];
ans = 1000000000;
for (int x=-100;x<=100;++x){
sub=0;
for (int i=1;i<=N;++i)sub += (A[i] - x)*(A[i]-x);
ans = min(ans,sub);
}
cout<<ans;
} | a.cc:3:7: error: 'MAXN' was not declared in this scope
3 | int A[MAXN];
| ^~~~
a.cc: In function 'int main()':
a.cc:10:36: error: 'A' was not declared in this scope
10 | for (int i=1;i<=N;++i)cin>>A[i];
| ^
a.cc:14:39: error: 'A' was not declared in th... |
s063527820 | p04025 | Java | import java.io.*;
import java.util.*;
public class BeTogether {
public static void main(String[] args) {
FastReader sc=new FastReader();
int N=sc.nextInt();
int[] a=new int[N];
double sum=0;
for(int i=0;i<N;i++){
a[i]=sc.nextInt();
sum+=a[i];
}
int avg=(int)Math.... | Main.java:5: error: class BeTogether is public, should be declared in a file named BeTogether.java
public class BeTogether {
^
1 error
|
s500271363 | p04025 | Java | import java.io.*;
import java.util.*;
public class BeTogether {
public static void main(String[] args) {
FastReader sc=new FastReader();
int N=sc.nextInt();
int[] a=new int[N];
double sum=0;
for(int i=0;i<N;i++){
a[i]=sc.nextInt();
sum+=a[i];
}
int avg=(int)Math.... | Main.java:5: error: class BeTogether is public, should be declared in a file named BeTogether.java
public class BeTogether {
^
1 error
|
s485364114 | p04025 | C++ | #include<bits/stdc++.h>
using namespace std ;
const int N = 5005 , mod = 1e9 + 7 ;
int n, f [N] [N], m; char s [N];
int main () {
scanf ( "% d% s" , & n, s + 1 ); m = strlen (s + 1 );
f [ 0 ] [ 0 ] = 1 ;
for ( int i = 0 ; i <n; i ++)
for ( int j = 0 ; j <= i; j ++) {
if (j) f [i + 1 ] ... | a.cc: In function 'int main()':
a.cc:12:58: error: expected ')' before 'l'
12 | f [i + 1 ] [j + 1 ] = (f [i + 1 ] [j + 1 ] + 1l l * f [i] [j] * 2 )% mod;
| ~ ^~
| )
a.cc:14:49: error:... |
s034259506 | p04025 | C++ | #include <bits / stdc ++. h>
using namespace std ;
const int N = 5005 , mod = 1e9 + 7 ;
int n, f [N] [N], m; char s [N];
int main () {
scanf ( "% d% s" , & n, s + 1 ); m = strlen (s + 1 );
f [ 0 ] [ 0 ] = 1 ;
for ( int i = 0 ; i <n; i ++)
for ( int j = 0 ; j <= i; j ++) {
if (j) f [... | a.cc:1:10: fatal error: bits / stdc ++. h: No such file or directory
1 | #include <bits / stdc ++. h>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
|
s592595611 | p04025 | Java | import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args) { new Main(); }
FS in = new FS();
PrintWriter out = new PrintWriter(System.out);
int n, c;
long mod = (long)1e9 + 7;
int[] a, b;
long[][] pre, dp;
Main() {
n = in.nextInt();
c = in.nextInt();
a = ... | Main.java:62: error: not a statement
b >> 1;
^
1 error
|
s320943370 | p04025 | Java | import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args) { new Main(); }
FS in = new FS();
PrintWriter out = new PrintWriter(System.out);
int n, min, arr[];
Main() {
arr = new int[n = in.nextInt()];
for (int i = 0; i < n; arr[i++] = in.nextInt());
min = 400_000*... | Main.java:35: error: cannot find symbol
StringTokenizer st = new StringTokenier("");
^
symbol: class StringTokenier
location: class Main.FS
1 error
|
s335025590 | p04025 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
int a,b[110],c,d;
cin >> a;
for(int i=0;i<a;i++)
cin >> b[i];
c=10000000;
for(int i=0;i<a;i++){
d =0;
for(int i=-100;i<110;i++){
d +=(b[i]-j);
}
c =min(c,d);
}
cout << c << endl;
} | a.cc: In function 'int main()':
a.cc:15:15: error: 'j' was not declared in this scope
15 | d +=(b[i]-j);
| ^
|
s216344506 | p04025 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
int n,a[100],ans=10000000,cnt=0;
cin >> n;
for(int i=0; i<n; i++) {
cin >> a[i];
}
for(int i=-100; i<=100; i++) {
for(int j=0; j<n; j++) {
cnt+=(a[j]-i)(a[j]-i);
}
if(cnt<ans) {
ans=cnt;
}
... | a.cc: In function 'int main()':
a.cc:13:20: error: expression cannot be used as a function
13 | cnt+=(a[j]-i)(a[j]-i);
| ~~~~~~~~^~~~~~~~
|
s069889159 | p04025 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=410;
const ll mod = 1e9+7 ;
ll a[N],b[N];
ll sum[N][N], l[N][N];
ll dp[N][N];
int main(){
ll n,m;
scanf("%lld%lld",&n, &m);
for(int i=1;i<=n;i++){
scanf("%lld",&a[i]);
}
for(int i=1;i<=n;i++){
scanf("%lld... | a.cc: In function 'int main()':
a.cc:33:87: error: expected primary-expression before ')' token
33 | dp[i][j]=(dp[i][j]%mod+(1ll*dp[i-1][j-k]*(sum[b[i]][k]-sum[a[i]-1][k]+))%mod)%mod;
| ^
|
s712112130 | p04025 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(void){
int N;
cin >> N;
vector<int> a(N);
int s = 0;
for(int i = 0; i < N; i++){
cin >> a[i];
s += a[i];
}
int m = (int)round((double)s / N);
int ans = 0;
for(int i = 0; i < N; i++) ans += (a[i] - m) * (a[i] - m);
cout << an... | a.cc: In function 'int main()':
a.cc:15:16: error: 'round' was not declared in this scope
15 | int m = (int)round((double)s / N);
| ^~~~~
|
s687261208 | p04025 | C++ | #include<iostream>
#include<cmath>
#include<vector>
using namespace std;
int main()
{
vector<int> num(n);
long long n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>num[i];
}
int cost=1000000;
for(int i=-200;i<=200;i++)
{
int be=0;
for(int j=0;j<n;j++)
{
be+=(i-num[j])*(i-num[j]);
}
cost=min(cost,be);
... | a.cc: In function 'int main()':
a.cc:7:25: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | vector<int> num(n);
| ^
| yn
|
s719037782 | p04025 | C++ | #include<iostream>
#include<vector>
#include<climits>
#include<algorithm>
using namespace std;
int ans=INT_MAX;
int main(void){
int n;
cin>>n;
vector<int> a(n);
for(int i =0;i<n;i++)cin>>a(i);
for(int i =-100;i<=100;i++){
int tmp=0;
for(int j =0;j<n;j++)tmp+=(a[j]-i)*(a[j]-i);
ans=min(ans,tm... | a.cc: In function 'int main()':
a.cc:11:30: error: no match for call to '(std::vector<int>) (int&)'
11 | for(int i =0;i<n;i++)cin>>a(i);
| ~^~~
|
s501922205 | p04025 | C++ | #include<iostream>
#include<vector>
#include<climits>
#include<algorithm>
using namespace std;
int ans=INT_MAX;
int main(void){
int n;
cin>>n;
vector<int> a(n);
for(int i =0;i<n;i++)cin>>a(i);
for(int i =-100;i<=100;i++){
int tmp=0;
for(int j =0;j<n;j++)tmp+=(a[j]-i)*(a[j]-i);
ans=max(ans,... | a.cc: In function 'int main()':
a.cc:11:30: error: no match for call to '(std::vector<int>) (int&)'
11 | for(int i =0;i<n;i++)cin>>a(i);
| ~^~~
|
s928747182 | p04025 | C++ | #include<iostream>
#include<vector>
#include<climts>
#include<algorithm>
using namespace std;
int ans=INT_MAX;
int main(void){
int n;
cin>>n;
vector<int> a(n);
for(int i =0;i<n;i++)cin>>a(i);
for(int i =-100;i<=100;i++){
int tmp=0;
for(int j =0;j<n;j++)tmp+=(a[j]-i)*(a[j]-i);
ans=max(ans,t... | a.cc:3:9: fatal error: climts: No such file or directory
3 | #include<climts>
| ^~~~~~~~
compilation terminated.
|
s341653742 | p04025 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#include<string.h>
#include<set>
#define inf 0x3f3f3f3f
using namespace std;
int pre[110];
int main()
{
int n;
cin>>n;
int sum=0;
for(int i=0;i<n;i++)
{
scanf("%d",&pre[i]);
sum+=p... | a.cc: In function 'int main()':
a.cc:25:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
25 | ans+=(pre[i]-sum)*(pre[i]-sum);
| ^~~
| abs
a.cc:27:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
27 | printf("%d\n",ans);
| ... |
s106938276 | p04025 | C++ | #include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
#define Di 3.1415926
#include<math.h>
#include<string>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
ll gcd(ll a,ll b)
{
return a%b? gcd(b,a%b):b;
}
struct Node
{
int t;
char a[102];
}s[102];
bool c... | a.cc: In function 'int main()':
a.cc:29:11: error: 'i' was not declared in this scope
29 | for(i=0;i<m;i++)
| ^
a.cc:38:13: error: 'i' was not declared in this scope
38 | for(i=0;i<m;i++)
| ^
|
s894615675 | p04025 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
long long sum=1e9+7;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n;
scanf("%d",&n);
vector<int> v(n);
for(int i=0;i<n;i++)
cin>>v[i];
for (int i=-100;i<=100;++i){
long long tmp=0;
for(int j=0;j<n;j++)... | a.cc: In function 'int main()':
a.cc:10:5: error: 'vector' was not declared in this scope
10 | vector<int> v(n);
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include<cmath>
+++ |+#include <vector>
4 | using... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.