submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s106388008 | p03682 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
static const long long INF = 200000;
#define N 100000
struct POINT {
int x;
int y;
};
int n;
POINT p[N]... | /tmp/ccU1HuA2.o: in function `main':
a.cc:(.text+0x22e): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccU1HuA2.o
a.cc:(.text+0x255): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccU1HuA2.o
a.cc:(.text+0x281): relocation tr... |
s495059666 | p03682 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
static const long long INF = 200000;
#define N 100000
struct POINT {
int x;
int y;
};
int n;
POINT p[N]... | /tmp/ccvnl5A8.o: in function `main':
a.cc:(.text+0x22e): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccvnl5A8.o
a.cc:(.text+0x255): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccvnl5A8.o
a.cc:(.text+0x281): relocation tr... |
s276855421 | p03682 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define MAX_V 100
#define INF INT_MAX
struct city
{
int x, y, num;
};
int co... | /tmp/ccBbkTzU.o: in function `prim()':
a.cc:(.text+0x21): relocation truncated to fit: R_X86_64_PC32 against symbol `mincost' defined in .bss section in /tmp/ccBbkTzU.o
a.cc:(.text+0x34): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccBbkTzU.o
a.cc:(.text+0x42): reloc... |
s248109022 | p03682 | C | #include <iostream>
using namespace std;
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define FORr(i, j, k) for(int i = j; i >= k; --i)
#define repr(i, j) FOR(i, j, 0)
#define INF (1 << 30)
#define ft first
#define sd second
typedef long long ll;
typedef unsigned long long ull;
ty... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s377960674 | p03682 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>
#include <cmath>
using namespace std;
struct UnionFind {
vector<int> par;
vector<int> sizes;
UnionFind(int n) : par(n), sizes(n, 1) {
for (int i = 0; i < n; i++... | a.cc: In function 'void solve(int, std::vector<std::pair<int, std::pair<int, int> > >)':
a.cc:54:48: error: expected ',' or ';' before '=' token
54 | vector< pair<int, pair<int, int> > > V1(n) = V;
| ^
a.cc:55:48: error: expected ',' or ';' before '=' token
... |
s431845294 | p03682 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
#define min(a,b)(a>b ? b:a)
void Swap(int*a,int*b){
long long int temp=*a;
*a=*b;
*b=temp;
}
int main(){
int n=0;
cin>>n;
int data[100000][2];
for(int i=0;i<n;i++){
cin>>data[i][0]>>data[i][1];
}
for(int i=0;i<n;i++){
int k=i;
fo... | a.cc: In function 'int main()':
a.cc:35:55: error: expected ')' before '{' token
35 | }else if(data[k][0]<data[j][0]{
| ~ ^
| )
a.cc:40:17: error: expected primary-expression ... |
s494192275 | p03682 | C | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int64 long long int
#define uint64 unsigned long long int
using namespace std;
const int N = 100005;
int n, DS[N], SZ[N];
int64 ans, cnt;
vector <pair<int,int>> vx, vy;
vector <struct Edge> D;
struct Edge {
int64 c;
int x;
int y;
};
int r... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s751390518 | p03682 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
long long int n, a[100005], val[100005],set[100005];
int findSet(int x) {
if (set[x] == x)
return x;
return set[x] = findSet(set[x]);
}
void unionSet(int x, int y) {
int fx = findSet(x);
int fy = findSet(y);
if(fx!=fy)
set[fx] = fy;... | a.cc: In function 'int main()':
a.cc:73:31: error: 'fabs' was not declared in this scope; did you mean 'labs'?
73 | rx[i-1].len = fabs(retu[i-1].x - retu[i].x);
| ^~~~
| labs
a.cc:78:31: error: 'fabs' was not declared in this sco... |
s304122980 | p03682 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
long long int n, a[100005], val[100005],set[100005];
int findSet(int x) {
if (set[x] == x)
return x;
return set[x] = findSet(set[x]);
}
void unionSet(int x, int y) {
int fx = findSet(x);
int fy = findSet(y);
if(fx!=fy)
set[fx] = fy;... | a.cc: In function 'long long int fact(long long int)':
a.cc:42:17: error: 'MOD' was not declared in this scope
42 | te = te%MOD;
| ^~~
a.cc: In function 'int main()':
a.cc:73:31: error: 'fabs' was not declared in this scope; did you mean 'labs'?
73 | rx[i-1].len = fab... |
s163526170 | p03682 | C++ | #include<iostream>
#include<cmath>
#include<queue>
#include<cstdio>
using namespace std;
priority_queue<pair<int,pair<int,int> > > q;
pair<int,int> pos[111111];
int pa[111111],n,ans,cnt;
int root(int x)
{
if (pa[x]!=x) pa[x]=root(pa[x]);
return pa[x];
}
bool Union(int x,int y)
{
int rx=root(x);
int ry=root(y);
if ... | a.cc: In function 'int main()':
a.cc:52:18: error: expected '}' at end of input
52 | return 0;
| ^
a.cc:27:1: note: to match this '{'
27 | {
| ^
|
s596399329 | p03683 | Java |
import java.math.BigInteger;
import java.util.*;
public class B {
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
fact=new long[100001];
fact[0]=1;
for(int i=1;i<100001;i++) {
fact[i]=(fact[i-1]%mod*i%mod+mod)%mod;
}
int n=sc.nextInt();
int m=sc.nextInt();
if((n==1&&m>1)... | Main.java:4: error: class B is public, should be declared in a file named B.java
public class B {
^
1 error
|
s124575403 | p03683 | C++ | #include<cstdio.h>
#include<cmaths>
using namespace std;
const int M=1000000007;
int n,m;
long long ans=1;
int main(){
scanf("%d%d",&n,&m);
if(abs(n-m)>1){
printf("-1\n");
return 0;
}
for(int i=1;i<=n;++i)ans=ans*i%M;
for(int i=1;i<=m;++i)ans=ans*i%M;
if(n!=m)printf("%lld\n",ans);
else printf("%lld\n",2*ans%... | a.cc:1:9: fatal error: cstdio.h: No such file or directory
1 | #include<cstdio.h>
| ^~~~~~~~~~
compilation terminated.
|
s183730720 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
int r,c;
int sd(pair<int,int> a){
int x,y;
tie(x,y) = a;
if(x==0)
return 0;
if(y==c)
return 1;
if(x==r)
return 2;
if(y==0)
return 3;
return -1;
}
bool bcmp(pair<pair<int,int>,int> a, pair<pair<int,int>,int> b){... | a.cc: In function 'int main()':
a.cc:42:9: error: no matching function for call to 'sort(std::vector<std::pair<std::pair<int, int>, int> >::iterator, std::vector<std::pair<std::pair<int, int>, int> >::iterator, <unresolved overloaded function type>)'
42 | sort(xvec.begin(),xvec.end(),bcmp);
| ~~~~^~~~~... |
s136858283 | p03683 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const mod=1000000007;
int main() {
ll n,m;
cin>>n>>m;
ll aa=1;
if(abs(n-m)>=2){
cout<<0<<endl;}
else{
for(ll i=1; i<=n; i++){
aa=(aa*i)%mod;}
for(ll i=1; i<=m; i++){
aa=(aa*i)%mod;}
cout<<aa<<endl;}}
| a.cc:5:7: error: 'mod' does not name a type
5 | const mod=1000000007;
| ^~~
a.cc: In function 'int main()':
a.cc:14:11: error: 'mod' was not declared in this scope; did you mean 'modf'?
14 | aa=(aa*i)%mod;}
| ^~~
| modf
a.cc:16:11: error: 'mod' was not declared in this... |
s945447604 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define ir... | a.cc: In function 'long long int fact(int)':
a.cc:132:41: error: 'MOD' was not declared in this scope
132 | for(int i=1; i<=a; i++) (res *= i) %= MOD;
| ^~~
|
s161372003 | p03683 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N=sc.nextLong();
long M=sc.nextLong();
long sum_N = 1;
long sum_M = 1;
long ans = 0;
long n_m = Math.abs(N-M);
long l = (Long)Math.pow(10, 9) + 7;
if(n_... | Main.java:12: error: incompatible types: double cannot be converted to Long
long l = (Long)Math.pow(10, 9) + 7;
^
1 error
|
s157279858 | p03683 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N=sc.nextLong();
long M=sc.nextLong();
long sum_N = 1;
long sum_M = 1;
long ans = 0;
long n_m = Math.abs(N-M);
long l = Math.pow(10, 9) + 7;
if(n_m < 2)... | Main.java:12: error: incompatible types: possible lossy conversion from double to long
long l = Math.pow(10, 9) + 7;
^
1 error
|
s158909141 | p03683 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N=sc.nextLong();
long M=sc.nextLong();
long sum_N = 1;
long sum_M = 1;
long ans = 0;
int n_m = Math.abs(N-M);
if(n_m < 2){
for(long i = N;i <= 0;i--){... | Main.java:11: error: incompatible types: possible lossy conversion from long to int
int n_m = Math.abs(N-M);
^
1 error
|
s061982739 | p03683 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N=sc.nextLong();
long M=sc.nextLong();
long sum_N = 1;
long sum_M = 1;
long ans = 0;
int n_m = Math.abs(N-M);
if(n_m < 2){
for(long i = N;i <= 0;i--){... | Main.java:11: error: incompatible types: possible lossy conversion from long to int
int n_m = Math.abs(N-M);
^
Main.java:20: error: incompatible types: int cannot be converted to boolean
if(n_m = 0){
^
2 errors
|
s717297548 | p03683 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N=sc.nextLong();
long M=sc.nextLong();
long sum_N = 0;
long sum_M = 0;
if(Math.abs(N-M) < 2){
for(long i = N;i = 0;i--){
sum_N *= i;
}
for... | Main.java:12: error: incompatible types: long cannot be converted to boolean
for(long i = N;i = 0;i--){
^
Main.java:15: error: incompatible types: long cannot be converted to boolean
for(long j = M;j = 0;j--){
^
2 errors
|
s528199154 | p03683 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N=sc.nextLong();
long M=sc.nextLong();
long sum_N = 0;
long sum_M = 0;
if(ABS(N-M) < 2){
for(i = N;i = 0;i--){
sum_N *= i;
}
for(j = M;j =... | Main.java:11: error: cannot find symbol
if(ABS(N-M) < 2){
^
symbol: method ABS(long)
location: class Main
Main.java:12: error: cannot find symbol
for(i = N;i = 0;i--){
^
symbol: variable i
location: class Main
Main.java:12: error: cannot find symbol
for(i = N;i = 0;i--){
... |
s738950076 | p03683 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
long long int a,b,c[110],d[100010],ans =1,ant=1;
int main(){
cin >> a >>b;
if(abs(a-b) >1){
cout << "0" <<endl;
}
else{
if(abs(a-b) =1){
for(int i=1;i<=a;i++){
... | a.cc: In function 'int main()':
a.cc:20:11: error: lvalue required as left operand of assignment
20 | if(abs(a-b) =1){
| ~~~^~~~~
|
s563752338 | p03683 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
unsigned long long int c=1,d,e;
cin>>a>>b;
for(int i=1;i<=a;i++){
c*=i;
c=c%1000000007;
}
for(int =1;i<=b;i++){
e*=i;
e=c%1000000007;
}
if(abs(a-b)>1)
cout<<0<<endl;
else if(a==b){
d=2*c*c%1000000007;
cout<<... | a.cc: In function 'int main()':
a.cc:12:11: error: expected unqualified-id before '=' token
12 | for(int =1;i<=b;i++){
| ^
a.cc:12:10: error: expected ';' before '=' token
12 | for(int =1;i<=b;i++){
| ^~
| ;
a.cc:12:11: error: expected primary-expression before '=... |
s203138808 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
const wa=1000000007;
int N,M;
cin >> N >> M;
if(abs(N-M)>1)cout << 0;
else{
long mat=1;
for(long i=1;i<N+1;i++){
mat*=i;
mat=mat%wa;
}
for(long i=1;i<M+1;i++){
mat*=i;
mat=mat%wa;
}
if(N==M)mat*=2;
... | a.cc: In function 'int main()':
a.cc:5:9: error: 'wa' does not name a type
5 | const wa=1000000007;
| ^~
a.cc:13:15: error: 'wa' was not declared in this scope
13 | mat=mat%wa;
| ^~
a.cc:17:15: error: 'wa' was not declared in this scope
17 | mat=mat%wa;
| ... |
s486128301 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
const wa=1000000007;
int N,M;
cin >> N >> M;
if(abs(N-M)>1)cout << 0;
else{
long mat=1;
for(int i=1;i<N+1;i++){
mat*=i;
mat=mat%wa;
}
for(int i=1;i<M+1;i++){
mat*=i;
mat=mat%wa;
}
if(N==M)mat*=2;
co... | a.cc: In function 'int main()':
a.cc:5:9: error: 'wa' does not name a type
5 | const wa=1000000007;
| ^~
a.cc:13:15: error: 'wa' was not declared in this scope
13 | mat=mat%wa;
| ^~
a.cc:17:15: error: 'wa' was not declared in this scope
17 | mat=mat%wa;
| ... |
s798649531 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
const wa=1000000007;
int main() {
int N,M;
cin >> N >> M;
if(abs(N-M)>1)cout << 0;
else{
long mat=1;
for(int i=1;i<N+1;i++){
mat*=i;
mat=mat%wa;
}
for(int i=1;i<M+1;i++){
mat*=i;
mat=mat%wa;
}
if(N==M)mat*=2;
cout... | a.cc:3:7: error: 'wa' does not name a type
3 | const wa=1000000007;
| ^~
a.cc: In function 'int main()':
a.cc:13:15: error: 'wa' was not declared in this scope
13 | mat=mat%wa;
| ^~
a.cc:17:15: error: 'wa' was not declared in this scope
17 | mat=mat%wa;
| ... |
s830577499 | p03683 | C++ | #include <iostream>
#include <stdlib.h>
using namespace std;
long Factorial(int k);
int main()
{
long n,m,ans=0;
cin >> n >> m;
if(abs(n-m)>=2){
ans=0;
}
else if(abs(n-m)==1){
ans=(Factorial(n)%1000000007)*Factorial(m)%1000000007;
}
else if(n==m){
ans=2*(Factorial(n)%1000000007)Factorial(m)%1000000007;
... | a.cc: In function 'int main()':
a.cc:18:48: error: expected ';' before 'Factorial'
18 | ans=2*(Factorial(n)%1000000007)Factorial(m)%1000000007;
| ^~~~~~~~~
| ;
|
s908886198 | p03683 | C++ | #include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#d... | a.cc:113:22: error: macro "srep" passed 4 arguments, but takes just 3
113 | srep(i,,1,m+1){
| ^
a.cc:7:9: note: macro "srep" defined here
7 | #define srep(i,s,t) for (int i = s; i < t; ++i)
| ^~~~
a.cc: In function 'int main()':
a.cc:113:9: error: 'srep' was not de... |
s119367606 | p03683 | C++ | // Code by ajcxsu
// Problem: exhausted
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
struct Pos { int x, y; } p[N];
bool cmp(const Pos &a, const Pos &b) { return a.x==b.x?a.x<b.x; }
#define ls x<<1
#define rs x<<1|1
int mx[N<<2], sum[N<<2];
void updata(int x, int l, int r, int d, int w) {
if(... | a.cc: In function 'bool cmp(const Pos&, const Pos&)':
a.cc:9:63: error: expected ':' before ';' token
9 | bool cmp(const Pos &a, const Pos &b) { return a.x==b.x?a.x<b.x; }
| ^
| :
... |
s979222872 | p03683 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
ll perm(ll a) {
if(MOD<=a) return 0;
ll ans0 = 1, ans1 = 1;
for (ll i = 1; i < a/2; ++i) {
... | a.cc: In function 'll perm(ll)':
a.cc:22:26: error: expected ')' before numeric constant
22 | ans0 = (ans0 * (1 1a-1)) % MOD;
| ~ ^~~
| )
a.cc:22:39: error: expected ')' before ';' token
22 | ans0 = (ans0 * (1 1a-1)) % MOD;
| ... |
s168833653 | p03683 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
#include <unordered_map>
using namespace std;
const int mod = 1e9 + 7;
using ll = long long;
unordered_map<int,ll>hash;
ll f(int n) {
if(!hash[n]) {
ll ans = 1;
for (ll i = 1; i <= n; ++i) {
ans = (ans * i) % mod;... | a.cc: In function 'll f(int)':
a.cc:11:9: error: reference to 'hash' is ambiguous
11 | if(!hash[n]) {
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
... |
s364922058 | p03683 | C++ | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define int long long
typedef pair<int,int> ii;
typedef pair<ii,ii> iiii;
iiii x[1000005];
vector<ii> vec[10];
int r,c,n,cnt;
stack<int> st;
//0 là cột bên trái
//1 là hàng ở trên
//2 là cột bên p... | cc1plus: error: '::main' must return 'int'
|
s600562724 | p03683 | C++ | l = map(int, raw_input().split())
n = l[0]
m = l[1]
mod = 1000000000 + 7
'''
def mod_pow(x,n,mod):
ll ret = 1;
while n > 0:
if n & 1 :
(ret *= x) %= mod
(x *= x) %= mod
n /= 2
return ret
def combo(n,k,mod):
if n / 2 < k:
k = n - k
bunshi = 1
for i i... | a.cc:6:1: error: empty character constant
6 | '''
| ^~
a.cc:6:3: warning: missing terminating ' character
6 | '''
| ^
a.cc:6:3: error: missing terminating ' character
a.cc:29:1: error: empty character constant
29 | '''
| ^~
a.cc:29:3: warning: missing terminating ' character
29 | '''
... |
s956793695 | p03683 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = scan.nextInt();
long frac[] = new long[100020];
int a = 1000000007;
if (Math.abs(x - y) > 1) {
System.out.println('0');
return;
}
frac[0] = 1;
... | Main.java:6: error: cannot find symbol
int y = scan.nextInt();
^
symbol: variable scan
location: class Main
1 error
|
s670929463 | p03683 | C++ | 2 2 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 2 2
| ^
|
s841123779 | p03683 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
ll n, m;
ll M = 1e9 + 7;
ll f(ll p) {
ll re;
for (re = 1; p > 0; re = re * p-- % M);
return re;
}
ll abs(ll p) {return p > 0 ? p : -p;}
int main()
{
cin >> n >> m;
cout << f(n) * f(m) * max(0LL, 2 - abs(n - m)) % M << endl;
... | a.cc: In function 'int main()':
a.cc:20:43: error: call of overloaded 'abs(ll)' is ambiguous
20 | cout << f(n) * f(m) * max(0LL, 2 - abs(n - m)) % M << endl;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/e... |
s914360751 | p03683 | C | #include <stdio.h>
#include <math.h>
int factorial(int n) {
if (n > 0) {
return n * factorial(n - 1);
} else {
return 1;
}
}
int main(void){
int mode = pow(10,9) + 7;
int N,M;
int ans;
scanf_s("%d", &N);
scanf_s("%d", &M);
if(N == M){
ans = factorial(N) * fac... | main.c: In function 'main':
main.c:15:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
15 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s206013901 | p03683 | C | #include <stdio.h>
#include <math.h>
int factorial(int n) {
if (n > 0) {
return n * factorial(n - 1);
} else {
return 1;
}
}
int main(void){
int mode = pow(10,9) + 7;
int N,M;
int ans;
scanf("%d",&N);
scanf("%d",&M);
if(N == M){
ans = factorial(N) * factorial... | main.c: In function 'main':
main.c:19:9: error: too many arguments to function 'puts'
19 | puts("%d",ans % mode);
| ^~~~
In file included from main.c:1:
/usr/include/stdio.h:714:12: note: declared here
714 | extern int puts (const char *__s);
| ^~~~
main.c:23:9: error: too ma... |
s008669329 | p03683 | C | #include <stdio.h>
#include <stdlib.h>
#define MOD (7+1e9)
long long int factorial(long long int n) {
long long int fact[100000];
long long int i;
fact[1] = 1;
for(i = 2; i <= n; i++) {
fact[i] = ((fact[i-1] % MOD) * (i % MOD)) % MOD;
}
return fact[n];
}
int main(){
long long i... | main.c: In function 'factorial':
main.c:13:31: error: invalid operands to binary % (have 'long long int' and 'double')
13 | fact[i] = ((fact[i-1] % MOD) * (i % MOD)) % MOD;
| ~~~~~~~~~ ^
| |
| long long int
main.c:13:43: er... |
s512507360 | p03683 | C | #include<bits/stdc++.h>
#define ll long long
#define mo 1000000007
using namespace std;
int x,y;
ll fac(int x){
ll s=1;
for (int i=1;i<=x;i++)
s=s*i%mo;
return s;
}
int main(){
scanf("%d%d",&x,&y);
if (x>y) swap(x,y);
if (x==y) printf("%lld",fac(x)*fac(x)*2%mo);
else if (x+1==y) printf("%lld",fac(x)*fac(y)%mo)... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s432517155 | p03683 | C++ | dsfdsz | a.cc:1:1: error: 'dsfdsz' does not name a type
1 | dsfdsz
| ^~~~~~
|
s932256638 | p03683 | C++ | #encoding: utf-8
def main():
N,M=map(int,input().split())
if(abs(N-M)<=2):
return 0
ret=1
for i in range(1,N+1):
ret*=i
for i in range(1,M+1):
ret*=i
return ret
if __name__ == '__main__':
main() | a.cc:1:2: error: invalid preprocessing directive #encoding
1 | #encoding: utf-8
| ^~~~~~~~
a.cc:15:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
15 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:3:1: error: 'def' does not name a type
3 | def ... |
s647756665 | p03683 | C | #include <iostream>
#include <algorithm>
#include <cmath>
#define MAX 1000000007
using namespace std;
long long int fct(int n)
{
if(n==1) return 1;
return (n*fct(n-1))%MAX;
}
int main()
{
int n,m;
cin>>n>>m;
if(abs(n-m)>1)
{
cout<<0<<endl;
return 0;
}
if(abs(n-m)==1)
{
cout<<(fct(n)*fct(m))%MAX<... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s379652857 | p03683 | C | #include <bits/stdc++.h>
#define MAX 1000000007
using namespace std;
long long int fct(int n)
{
if(n==1) return 1;
return (n*fct(n-1))%MAX;
}
int main()
{
int n,m;
cin>>n>>m;
if(abs(n-m)>1)
{
cout<<0<<endl;
return 0;
}
if(abs(n-m)==1)
{
cout<<(fct(n)*fct(m))%MAX<<endl;
return 0;
}
cout<<(2... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s524217162 | p03683 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
/**
* @author fangda.wang
*/
public class Reconciled {
private final static int MOD = 1_000_000_000 +7;
private final static BigDecimal B_MOD = BigDecimal.valueOf(MOD);
public static void mai... | Main.java:8: error: class Reconciled is public, should be declared in a file named Reconciled.java
public class Reconciled {
^
1 error
|
s522441269 | p03683 | C++ | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
/**
* @author fangda.wang
*/
public class Reconciled {
private final static int MOD = 1_000_000_000 +7;
private final static BigDecimal B_MOD = BigDecimal.valueOf(MOD);
public static void mai... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fm... |
s506411172 | p03683 | C++ | iiiii const search = function (keywords) {
return ajaxPost(`/signals/search`, {keywords: keywords})
.then(res => {
renderRecent(res.recent);
renderClassic(res.cars);
})
.catch(err => {
... | a.cc:2:21: error: stray '`' in program
2 | return ajaxPost(`/signals/search`, {keywords: keywords})
| ^
a.cc:2:37: error: stray '`' in program
2 | return ajaxPost(`/signals/search`, {keywords: keywords})
| ^
a.cc:1:1: error: 'iiiii' doe... |
s871674145 | p03683 | C++ | #include <iostream>
using namespace std;
int main(){
int N, M;
long long sum = 1;
long long d = (long long)pow(10.0, 9.0) + 7;
cin >> N >> M;
if(N > M){
int a = N;
N = M;
M = N;
for(int i = 1 ; i <= N; i++){
sum *= i;
sum %= d;
}
sum *= sum;
sum %= d;
sum *= (N + 1);
sum %= d;
... | a.cc: In function 'int main()':
a.cc:8:34: error: 'pow' was not declared in this scope
8 | long long d = (long long)pow(10.0, 9.0) + 7;
| ^~~
|
s203406321 | p03683 | C++ | #include <iostream>
using namespace std;
int main(){
int N, M;
long long sum = 1;
long long d = (long long)pow(10.0, 9.0) + 7;
cin >> N >> M;
if(N > M){
int a = N;
N = M;
M = N;
for(int i = 1 ; i <= N; i++){
sum *= i;
sum %= d;
}
sum *= sum;
sum %= d;
sum *= (N + 1);
sum %= d;
... | a.cc: In function 'int main()':
a.cc:8:34: error: 'pow' was not declared in this scope
8 | long long d = (long long)pow(10.0, 9.0) + 7;
| ^~~
|
s891117571 | p03683 | C++ | #include<stdio.h>
long long int factorial(int N){
int i;
int fact;
for(i=1;i<=N;i++){
fact*=i;
}
return fact;
}
int main(){
int N,M,multi_N,multi_M;
scanf("%d %d",&N,&M);
if(N-M>=3 || N-M<=-3){
printf("0\n");
}else{
printf("%lld\n",factorial(M)*factorial(N)*... | a.cc: In function 'int main()':
a.cc:18:54: error: invalid operands of types 'double' and 'double' to binary 'operator%'
18 | printf("%lld\n",factorial(M)*factorial(N)*2.0%(1000000000.0+7.0));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
| ... |
s308289874 | p03683 | C++ | int b = (a * a) % mod
| a.cc:1:14: error: 'a' was not declared in this scope
1 | int b = (a * a) % mod
| ^
a.cc:1:18: error: 'a' was not declared in this scope
1 | int b = (a * a) % mod
| ^
a.cc:1:23: error: 'mod' was not declared in this scope
1 | int b = (a * a) % mod
|... |
s820246990 | p03683 | C++ | #include <fstream>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <queue>
#include <random>
using namespace std;
#define min(a,b) ((a)<(b) ? (a):(b))
#def... | a.cc: In function 'int main(int, const char**)':
a.cc:261:20: error: 'INT_MAX' was not declared in this scope
261 | es[i].cost=INT_MAX;
| ^~~~~~~
a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
14 | #include <rand... |
s411384895 | p03683 | C++ | #include <stdio.h>
#include <stdlib.h>
using namespace std;
const int nom = 1000000007;
int ans = 0, n, m, f[100005];
int main()
{
scanf("%d%d", &n, &m);
if (abs(n - m) > 1) { printf("0"); return 0; }
f[0] = 1;
for (int i = 1; i <= max(n, m); i++)
f[i] = (f[i - 1] *... | a.cc: In function 'int main()':
a.cc:13:31: error: 'max' was not declared in this scope
13 | for (int i = 1; i <= max(n, m); i++)
| ^~~
a.cc:16:43: error: found ':' in nested-name-specifier, expected '::'
16 | if (n == m) ans = (ans * 2) % nom:
| ... |
s991447794 | p03683 | Java |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Reconciled {
static final long MOD = (long) 1e9 + 7;
static final int M... | Main.java:11: error: class Reconciled is public, should be declared in a file named Reconciled.java
public class Reconciled {
^
1 error
|
s654129921 | p03683 | C | g`"#include<stdbool.h>
int all(int n) {
unsigned long result = 1;
for(int i = 1; i <=n; i++) {
result = result*i;
result = result % 1000000007;
}
return result;
}
int main() {
int a,b;
unsigned long kekka;
scanf("%d %d", &a, &b);
if (a == b) {
kekka = (all(a) * ... | main.c:1:2: error: stray '`' in program
1 | g`"#include<stdbool.h>
| ^
main.c:1:3: warning: missing terminating " character
1 | g`"#include<stdbool.h>
| ^
main.c:1:3: error: missing terminating " character
1 | g`"#include<stdbool.h>
| ^~~~~~~~~~~~~~~~~~~~
main.c:1:2: error: expected '... |
s074332443 | p03683 | C++ | #include <bits/stdc++.h>
#include <windows.h>
#define LEN 100000
using namespace std;
class UFS {
private:
int f[LEN];
int size[LEN];
int len;
int block;
public:
UFS(int n);
void Add();
int Union(int a, int b);
int IsSameRoot(int a, int b);
int GetLength();
int FindRoot(int k);
int GetBlocks()... | a.cc:2:10: fatal error: windows.h: No such file or directory
2 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s522414801 | p03683 | C++ | #include <iostream>
using namespace std;
struct
{
int x,y;
}v[100003];
int n,viz[100003],dist,a,b,nod;
long long dist;
int main()
{
cin>>n;
for(int i=1;i<=n;++i) cin>>v[i].x>>v[i].y;
for(int i=1;i<=n;++i)
{
if(!viz[i])
{
viz[i]=true;
dist=99999999;
... | a.cc:9:11: error: conflicting declaration 'long long int dist'
9 | long long dist;
| ^~~~
a.cc:8:19: note: previous declaration as 'int dist'
8 | int n,viz[100003],dist,a,b,nod;
| ^~~~
a.cc: In function 'int main()':
a.cc:39:13: error: 'sol' was not declared in this scope... |
s249269502 | p03683 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
static const long long INF = 1000000000;
#define N 100000
struct POINT {
int x;
int y;
};
int n;
POINT ... | /tmp/ccWVy1Zw.o: in function `main':
a.cc:(.text+0x22a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccWVy1Zw.o
a.cc:(.text+0x252): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccWVy1Zw.o
a.cc:(.text+0x281): relocation tr... |
s289137700 | p03683 | C++ | #include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<map>
#include<set>
#include<algorithm>
#include<queue>
#include<time.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
#define fe(x) for(int ii=be[x];ii;ii=e[ii].ne)
using namespace std;
int r,c,n,m,xx,yy,... | a.cc:15:5: error: ambiguating new declaration of 'int random()'
15 | int random(){
| ^~~~~~
In file included from /usr/include/c++/14/bits/std_abs.h:38,
from /usr/include/c++/14/cmath:49,
from /usr/include/c++/14/math.h:36,
from a.cc:2:
/usr/include/stdlib... |
s118816491 | p03683 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
#define N 100000
#define INF (1 << 21)
struct POINT {
int x;
int y;
};
int n;
POINT p[N];
int cost[N + 1... | /tmp/cc0QajjK.o: in function `main':
a.cc:(.text+0x22a): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc0QajjK.o
a.cc:(.text+0x252): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/cc0QajjK.o
a.cc:(.text+0x281): relocation tr... |
s393367673 | p03683 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
#define N 100000
#define INF (1 << 21)
struct POINT {
int x;
int y;
};
int n;
POINT p[N];
int cost[N + 1... | /tmp/ccjHn4lZ.o: in function `main':
a.cc:(.text+0x21e): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccjHn4lZ.o
a.cc:(.text+0x25e): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccjHn4lZ.o
a.cc:(.text+0x292): relocation tr... |
s300630525 | p03683 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;
#define N 100000
#define INF (1 << 21)
struct POINT {
int x;
int y;
};
int n;
POINT p[N];
int cost[N + 1... | /tmp/ccDJJrwA.o: in function `main':
a.cc:(.text+0x21e): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccDJJrwA.o
a.cc:(.text+0x25e): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccDJJrwA.o
a.cc:(.text+0x292): relocation tr... |
s470802962 | p03683 | C++ | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual soluti... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.OutputStream;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmod... |
s887840852 | p03683 | C++ | #include <iostream>
using namespace std;
long long int kaizyou(long long int n){
return n*kaizyou(n-1)%1000000007
}
main(){
long long int n,m,ans;
cin >> n >> m;
if(n>m+1 || m>n+1){
cout << "0" <<endl;
}else{
ans=kaizyou(n);
ans*=kaizyou(m);
if(n!=m){
ans*=2;
}
ans%=1000000007;... | a.cc: In function 'long long int kaizyou(long long int)':
a.cc:5:35: error: expected ';' before '}' token
5 | return n*kaizyou(n-1)%1000000007
| ^
| ;
6 | }
| ~
a.cc: At global scope:
a.cc:8... |
s228282865 | p03683 | C++ | #include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algor... | a.cc:53:10: fatal error: conio.h: No such file or directory
53 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s722878053 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long long res = 1;
cin >> n >> m;
int base = 1e9 + 7;
if ( abs (n - m) > 1) {
cout << 0 << '\n;
}
else
{
if (n == m) {
res = 2;
}
for (int i = 1; i <= n; ++i) {
... | a.cc:13:26: warning: missing terminating ' character
13 | cout << 0 << '\n;
| ^
a.cc:13:26: error: missing terminating ' character
13 | cout << 0 << '\n;
| ^~~~
a.cc: In function 'int main()':
a.cc:14:5: error: expected primary-... |
s720787274 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long long res = 1;
cin >> n >> m;
int base = 1e9 + 7;
if ( abs (n - m) > 1) {
cout << 0;
else
{
if (n == m) {
res = 2;
}
for (int i = 1; i <= n; ++i) {
re... | a.cc: In function 'int main()':
a.cc:14:9: error: expected '}' before 'else'
14 | else
| ^~~~
a.cc:12:27: note: to match this '{'
12 | if ( abs (n - m) > 1) {
| ^
|
s524656135 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long long res = 1;
cin >> n >> m;
int base = 1e9 + 7;
if ( abs (n - m) > 1) {
cout << 0;
else
{
if (n == m) {
res = 2;
}
for (int i = 1; i <= n; ++i) {
re... | a.cc: In function 'int main()':
a.cc:14:9: error: expected '}' before 'else'
14 | else
| ^~~~
a.cc:12:27: note: to match this '{'
12 | if ( abs (n - m) > 1) {
| ^
|
s712162843 | p03683 | C++ | #include <iostream>
#include <algorithm>
#define _ %1000000007
typedef long long LL;
using namespace std;
int compute(int M, int D) {
if (abs(M-D) > 1) return 0;
int tiny = min(M, D);
LL ret = 1;
for (LL item = tiny; item >= 2; item--) {
ret = (item*ret)_;
}
ret = (ret*ret)_;
if(M ... | a.cc: In function 'int main()':
a.cc:32:31: error: expected ';' before numeric constant
32 | cout << ret << endl;100000 100000
| ^~~~~~~
| ;
|
s087038216 | p03683 | Java | /**
* @author Finn Lidbetter
*/
import java.util.*;
import java.io.*;
import java.awt.geom.*;
public class TaskC {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
long MOD ... | Main.java:8: error: class TaskC is public, should be declared in a file named TaskC.java
public class TaskC {
^
1 error
|
s438128784 | p03683 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m, ans = 1;
cin >> n >> m;
if (n > m) swap(n,m);
if (n + 1 < m) cout << 0;
else {
rep(i,1,n+1) ans = ans * i % MOD * i % MOD;
if (n == m) cout << ans * 2 % MOD;
else cout << ans * m % MOD;
}
}
| a.cc: In function 'int main()':
a.cc:10:13: error: 'i' was not declared in this scope
10 | rep(i,1,n+1) ans = ans * i % MOD * i % MOD;
| ^
a.cc:10:9: error: 'rep' was not declared in this scope
10 | rep(i,1,n+1) ans = ans * i % MOD * i % MOD;
| ^~~
a.cc:11:39: error... |
s667119193 | p03684 | C++ | #include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
/*----------------------------------ここからマクロ----------------------------------*/
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define vecin(a) rep(i,a.s... | a.cc: In function 'int main()':
a.cc:157:57: error: no matching function for call to 'abs(long long int&, long long int&)'
157 | cout << min(abs(vec[0].first - vec[1].first),abs(vec[0].second.first,vec[1].second.first)) << "\n";
| ~~~^~~~~~~~~~~~~~~~~... |
s152539265 | p03684 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e18+7;
ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define rf(i,a,b) for(long long i=a;i>=b;i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define w(t)... | a.cc: In function 'void dfs(ll)':
a.cc:49:16: error: reference to 'visit' is ambiguous
49 | void dfs(ll v){visit[v] = 1;for(auto x:adj[v]){if(!visit[x])dfs(x);}}
| ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
from a.cc:1:
/usr/include/c++/14... |
s961781593 | p03684 | C++ | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <queue>
#include <iomanip>
#include <set>
//#include <bits/stdc++.h>
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>... | a.cc: In function 'int main()':
a.cc:68:11: error: 'kruskal' was not declared in this scope
68 | cout<<kruskal(s,t,c,N)<<endl;
| ^~~~~~~
|
s705997866 | p03684 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
struct edge
{
int x,y,cost;
};
struct pct
{
int x,y,ind;
};
bool cmp1(pct a, pct b)
{
return a.x<b.x;
}
bool cmp2(pct a, pct b)
{
return a.y<b.y;
}
bool cmp(edge a, edge b)
{
return a.cost<b.cost;
}
pct P[100005];
vector<edge> Edg;
i... | a.cc:32:1: error: 'vector' does not name a type
32 | vector<edge> Edg;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:89:9: error: 'Edg' was not declared in this scope
89 | Edg.push_back({P[i].ind,P[i-1].ind,P[i].x-P[i-1].x});
| ^~~
a.cc:93:9: error: 'Edg' was not declared in this scope... |
s501421843 | p03684 | C++ | //#include "pch.h"
//#include "stdafx.h"
#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <functional>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
usin... | a.cc:70:9: warning: "M_PI" redefined
70 | #define M_PI 3.14159265358979
| ^~~~
In file included from /usr/include/c++/14/cmath:47,
from /usr/include/c++/14/math.h:36,
from a.cc:8:
/usr/include/math.h:1121:10: note: this is the locatio... |
s733049455 | p03684 | C++ | #include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
// typedef complex<double> point;
ll mod = 1e9 + 7;
#define EPS 1e-1
#define PI 3.141592653589
#define point complex<ld>
#define dot(a, b) (conj(a) * b).real()
#define cross(a, b) (conj(a) * b).imag()
#define line tu... | a.cc: In function 'int main()':
a.cc:585:13: error: 'l' was not declared in this scope
585 | for(l i=0;i<mp[pay].size();++i){
| ^
a.cc:585:19: error: 'i' was not declared in this scope; did you mean 'it'?
585 | for(l i=0;i<mp[pay].size();++i){
| ^
| ... |
s748750495 | p03684 | C++ | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | a.cc:132:8: error: extra qualification 'Kruskal::' on member 'searchMinimumSpanningTree' [-fpermissive]
132 | void Kruskal::searchMinimumSpanningTree() {
| ^~~~~~~
a.cc:144:3: error: extra qualification 'Kruskal::' on member 'Kruskal' [-fpermissive]
144 | Kruskal::Kruskal(Graph graph) { this->graph... |
s620510686 | p03684 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
struct city{
int x,y,i;
city(int x_,int y_,int i_){
x=x_,y=y_,i=i_;
};
};
struct edge{
int cst,e1,e2;
edge(int cst_,int e1_,int e2_){
cst=cst_,e1=e1_,e2=e2_;
};
bool operator<(const edge& o... | a.cc: In member function 'bool edge::operator<(const edge&) const':
a.cc:19:62: warning: no return statement in function returning non-void [-Wreturn-type]
19 | bool operator<(const edge& o)const{cst>o.cst;}
| ^
In file included from ... |
s049004710 | p03684 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
struct city{
int x,y,i;
city(int x_,int y_,int i_){
x=x_,y=y_,i=i_;
};
};
struct edge{
int cst,e1,e2;
edge(int cst_,int e1_,int e2_){
cst=cst_,e1=e1_,e2=e2_;
};
bool operator<(const edge& o... | a.cc: In member function 'bool edge::operator<(const edge&) const':
a.cc:19:62: warning: no return statement in function returning non-void [-Wreturn-type]
19 | bool operator<(const edge& o)const{cst>o.cst;}
| ^
In file included from ... |
s880842789 | p03684 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
struct city{
int x,y,i;
city(int x_,int y_,int i_){
x=x_,y=y_,i=i_;
};
};
struct edge{
int cst,e1,e2;
edge(int cst_,int e1_,int e2_){
cst=cst_,e1=e1_,e2=e2_;
};
bool operator<(const edge& o... | a.cc: In member function 'bool edge::operator<(const edge&) const':
a.cc:19:62: warning: no return statement in function returning non-void [-Wreturn-type]
19 | bool operator<(const edge& o)const{cst>o.cst;}
| ^
In file included from ... |
s960874038 | p03684 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
const int oo = 1e9 + 7;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
int n, par[100001], sz[100001];
vector<iii> point, edg;
int dist(int a, int b, int c, int d){
return min(abs(a - c), abs(b - d));
}
int... | a.cc: In function 'long long int anc(long long int)':
a.cc:20:31: error: 'root' was not declared in this scope
20 | else return (par[x] = root(par[x]));
| ^~~~
|
s378777495 | p03684 | C++ | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
struct point {
int x, y, id;
} a[N];
bool cmp1(const point& a, const point& b) {
if (a.x != b.x) {
return a.x < b.x;
}
return a.y < b.y;
}
bool cmp2(const point& a, const point& b) {
if (a.y != b.y) {
return a.... | a.cc: In function 'int main()':
a.cc:60:14: error: 'p' was not declared in this scope
60 | sort(p, p + n, cmp1);
| ^
|
s764604370 | p03684 | C++ | typedef long long ll;
int N;
void _main() {
cin >> N;
vector<pair<int, int>> va, vb;
rep(i, 0, N) {
int x, y; cin >> x >> y;
va.push_back({ x, i });
vb.push_back({ y, i });
}
vector<tuple<int, int, int>> edges;
sort(va.begin(), va.end());
sort(vb.begin(), vb.end())... | a.cc: In function 'void _main()':
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin >> N;
| ^~~
a.cc:6:5: error: 'vector' was not declared in this scope
6 | vector<pair<int, int>> va, vb;
| ^~~~~~
a.cc:6:12: error: 'pair' was not declared in this scope
6 | vector<... |
s802946844 | p03684 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <algorithm>
// 全局变量
const int N = 100010 , M = N + N;
int x[N],y[N],id[N],n;
typedef struct ufset *UFset;
struct ufset
{
int *parent;
int *root;
};
UFset UFinit(int size)
{
int e;
UFset U=(UFset)malloc(sizeof *U);
U->parent=(int*)malloc((size+1)*sizeof(int));
... | a.cc: In function 'int main()':
a.cc:87:3: error: expected initializer before 'for'
87 | for (i = 1; i <= n; ++i)
| ^~~
a.cc:87:15: error: 'i' was not declared in this scope
87 | for (i = 1; i <= n; ++i)
| ^
a.cc:106:24: error: 'v' was not declared in this scope
106 | u = UFf... |
s756153049 | p03684 | Java | import sys
import heapq
def getn():
return int(sys.stdin.readline())
def getnums():
return list(map(int,(sys.stdin.readline().split())))
INF=10000000000
n = getn()
pos = []
edge = [[] for i in range(n)]
for i in range(n):
x,y = getnums()
pos.append([x,y,i])
pos.sort(key=lambda x:x[0])
for i,j in zip(p... | Main.java:1: error: '.' expected
import sys
^
Main.java:2: error: '.' expected
import heapq
^
Main.java:3: error: ';' expected
def getn():
^
Main.java:48: error: illegal character: '#'
#print("union: ", next_e[1], group)
^
Main.java:49: error: illegal character: '#'
... |
s913298631 | p03684 | C++ | /*
_____
.'|||||'.
/ > < \
| ^ |
| \ / |
\ '---' /
'._____.'
|||||
*/
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<vector>
#include<cstring>
#include<stack>
#include<cmath>
#include<queue>
using namespa... | a.cc: In function 'int find1(int)':
a.cc:46:5: error: 'retufn' was not declared in this scope
46 | retufn(f[x]);
| ^~~~~~
a.cc:45:38: warning: control reaches end of non-void function [-Wreturn-type]
45 | if (f[x]==x) return(x); else f[x]=find1(f[x]);
| ~~~... |
s812556272 | p03684 | C++ | #include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int > vi;
typedef pair<int ,int > pii;
typedef vector<pii> vii;
const int inf=0x3f3f3f3f, maxn=100007, mod=1e9+7;
const ll linf=0x3f3f3f3f3f3f3f3fLL;
const ll P=192... | a.cc:15:1: error: storage class 'register' invalid for function 'find'
15 | register int find(int x){
| ^~~~~~~~
|
s288718176 | p03684 | C++ | #include <bits/stdc++.h>
using namespace std;
#define countof(a) (sizeof(a)/sizeof(*a))
#define vi vector<int>
#define vvi vector<vector<int> >
#define vpi vector<pi >
#define pi pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define all(n) n.begin(), n.end()
#define FROMTO(var, from, to) for... | a.cc: In constructor 'Comb::Comb(int)':
a.cc:47:14: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
47 | UPTO(i,1,n) {
| ^
a.cc:17:49: note: in definition of macro 'UPTO'
17 | #define UPTO(var, from, to) for (register int var = (from); var <= ((int)to... |
s440251623 | p03684 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
struct ver{
int key;
int x;
int y;
};
struct edge{
int cost;
int v1;
int v2;
};
int main(){
int n;
int answer=0;
std::vector<ver> verList;
std::vector<std::vector<edge>> edgeList;
std::priority_queue<edge, std::vector<edge>, std::func... | a.cc: In function 'int main()':
a.cc:23:59: error: 'function' is not a member of 'std'
23 | std::priority_queue<edge, std::vector<edge>, std::function<bool(edge, edge)>> qList(
| ^~~~~~~~
a.cc:5:1: note: 'std::function' is defined in header '<fu... |
s553838635 | p03684 | C++ | #include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
using namespace std;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
#define shosu setprecision(10)... | a.cc: In function 'int main()':
a.cc:47:14: error: request for member 'first' in 'p', which is of non-class type 'P [N]' {aka 'std::pair<long long int, long long int> [N]'}
47 | swap(p.first,p.second);
| ^~~~~
a.cc:47:22: error: request for member 'second' in 'p', which is of non-class type ... |
s527079372 | p03684 | C++ | #include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
using namespace std;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
#define shosu setprecision(10)... | a.cc: In function 'int main()':
a.cc:47:11: error: no matching function for call to 'swap(P [N])'
47 | swap(p);
| ~~~~^~~
In file included from /usr/include/c++/14/bits/quoted_string.h:38,
from /usr/include/c++/14/iomanip:50,
from a.cc:7:
/usr/include/c++/14/sstrea... |
s404854357 | p03684 | C++ | 6
8 3
4 9
12 19
18 1
13 5
7 6 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 6
| ^
|
s691415225 | p03684 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+10;
int pre[N];
struct Node{
int x,y,ind;
}v1[N],v[4*N];
int cmp1(Node a,Node b)
{
if(a.x==b.x)
return a.y<b.y;
return a.x<b.x;
}
int cmp2(Node a,Node b)
{
if(a.y==b.y)
return a.x<b.x;
return a.y<b... | a.cc: In function 'int main()':
a.cc:41:16: error: 'v1ind' was not declared in this scope; did you mean 'vind'?
41 | sort(v1,v1+v1ind,cmp1);
| ^~~~~
| vind
|
s086854044 | p03684 | Java |
import java.io.*;
import java.util.*;
class XComparator implements Comparator<Point>{
@Override
public int compare(Point p1, Point p2){
return p1.x < p2.x ? -1 : 1;
}
}
class YComparator implements Comparator<Point>{
@Override
public int compare(Point p1, Point p2){
return p1.y < p2.y ? -1 : 1;
}
}
class ... | Main.java:134: error: class, interface, enum, or record expected
import java.io.*;
^
Main.java:135: error: class, interface, enum, or record expected
import java.util.*;
^
2 errors
|
s486464597 | p03684 | C++ | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<long long,long long> ii;
vector<pair<long long,ii>> edge;
long long n,up[100005],sz[100005];
pair<ii,long long> x[100005];
bool cmp(const pair<ii,long long> &a,const pair<ii,long lo... | a.cc: In function 'int main()':
a.cc:53:23: error: no matching function for call to 'min(long long int&, int)'
53 | edge.pb(mp(min(val,INT_MAX),mp(x1,x2)));
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/... |
s486870161 | p03684 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ... | a.cc: In function 'void init(int)':
a.cc:25:9: error: reference to 'rank' is ambiguous
25 | rank[i] = 0;
| ^~~~
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
... |
s506786599 | p03684 | C++ | /*
sort points by x (1st time)
by y (2nd time)
each time => push back the weight bw 2 points
=> MST (kruskal)
=> DONE!
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+5;
struct data{
int x,y,id;
} c[N];
int n,pset[N],ans;
vector< pair< int,pair<int,int> > > edge;
bool... | a.cc:21:11: error: reference to 'data' is ambiguous
21 | bool cmpx(data _a,data _b){
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc... |
s508867066 | p03684 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> iPair;
struct Graph
{
int V, E;
vector< pair<int, iPair> > edges;
Graph(int V, int E)
{
this->V = V;
this->E = E;
}
void addEdge(int u, int v, int w)
{
edges.push_back({w, {u... | a.cc: In function 'int main()':
a.cc:105:39: error: expected unqualified-id before '.' token
105 | for(int i = 0; i < n-1; i++) Graph.addEdge(i, i + 1, min(abs(edges2[i].first-edges2[i+1].first), abs(edges2[i].second-edges2[i+1].second)));
| ^
a.cc:107:39: error: expect... |
s195124087 | p03684 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> iPair;
struct Graph
{
int V, E;
vector< pair<int, iPair> > edges;
Graph(int V, int E)
{
this->V = V;
this->E = E;
}
void addEdge(int u, int v, int w)
{
edges.push_back({w, {u... | a.cc: In function 'int main()':
a.cc:105:34: error: 'addEdge' was not declared in this scope
105 | for(int i = 0; i < n-1; i++) addEdge(i, i + 1, min(abs(edges2[i].first-edges2[i+1].first), abs(edges2[i].second-edges2[i+1].second)));
| ^~~~~~~
a.cc:107:34: error: 'addEdge' w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.