submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s667510370 | p03681 | C | #include<stdio.h>
#include<math.h>
int main()
{
long long int a,b,ans,mod,i,modp[200001];
scanf("%lld %lld",&a,&b);
mod=pow(10,9)+7;
modp[0]=1
for(i=1;i<200001;++i)
{
modp[i]=(modp[i-1]*i)%mod;
}
ans=(modp[a]*modp[b])%mod;
if(abs(a-b)>1) printf("0");
else printf("%lld",ans);
return 0;} | main.c: In function 'main':
main.c:8:12: error: expected ';' before 'for'
8 | modp[0]=1
| ^
| ;
9 | for(i=1;i<200001;++i)
| ~~~
main.c:14:6: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
14 | if(abs(a-b)>1) printf("0");
... |
s509492826 | p03681 | C++ | #include<bits/stdc++.h>
#define D 1000000007
using namespace std;
using ull = long long;
}
int main(){
ull n, m; cin >> n >> m;
ull ans =0;
ull n_func=1, m_func=1;
if(n-m > 1 || m-n > 1){
cout << 0 << endl;
return 0;
}
for(int i=n; i>=1; i--){
n_func = n_func*i;
... | a.cc:6:1: error: expected declaration before '}' token
6 | }
| ^
|
s224355363 | p03681 | C++ | #include<bits/stdc++.h>
#define D 1000000007
using namespace std;
using ull = unsigned long long;
int main(){
ull n, m; cin >> n >> m;
ull ans =0;
ull n_func=1, m_func=1;
if(abs(n-m) > 1){
cout << 0 << endl;
return 0;
}
for(int i=n; i>=1; i--){
n_func = n_func*i;
... | a.cc: In function 'int main()':
a.cc:10:11: error: call of overloaded 'abs(ull)' is ambiguous
10 | if(abs(n-m) > 1){
| ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
from a.cc:1:
/usr/includ... |
s988960696 | p03681 | C++ | /*
Contest 065
C - Reconciled?
Rakesh Kumar --> 01/09/2020
*/
#include <bits/stdc++.h>
using ll = long long int;
ll f (ll n) {
ll r = 1;
for (ull i = 2; i <= n; ++i)
r = (r * i) % static_cast<ll>((1e9 + 7));
return r;
}
/*
combinations maths questions.
for example
D --> dog, M --> M... | a.cc: In function 'll f(ll)':
a.cc:13:10: error: 'ull' was not declared in this scope; did you mean 'll'?
13 | for (ull i = 2; i <= n; ++i)
| ^~~
| ll
a.cc:13:21: error: 'i' was not declared in this scope
13 | for (ull i = 2; i <= n; ++i)
| ^
|
s542024997 | p03681 | C++ | #include<iostream>
using namespace std;
typedef long long ll;
#define MOD 1000000007
int main() {
cin.tie(0);
cin.sync_with_stdio(0);
ll n, m;
scanf("%lld %lld", &n, &m);
if (m < n - 1 || n + 1 < m) {
printf("%d\n", 0);
return 0;
}
ll ans = 1;
if (abs(m - n) == 1... | a.cc: In function 'int main()':
a.cc:21:9: error: 'maxi' was not declared in this scope
21 | maxi = max(m, n)
| ^~~~
a.cc:22:24: error: 'i' was not declared in this scope
22 | for (ll i = 1; i <= maxi; i++) ans = ans * i % MOD;
| ^
|
s233394451 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m; scanf("%d%d", &n, &m);
if(abs(n - m) > 1) {
printf("0\n");
return 0;
}
// 同数の場合 N! * M! * 2
// 1個違いの場合 N! * M!
ll n_kai = 1;
ll m_kai = 1;
for(int i = 1; i <= n; i++) n_kai = (n_kai * i) % MOD;
for(... | a.cc: In function 'int main()':
a.cc:11:5: error: 'll' was not declared in this scope
11 | ll n_kai = 1;
| ^~
a.cc:12:7: error: expected ';' before 'm_kai'
12 | ll m_kai = 1;
| ^~~~~~
| ;
a.cc:13:33: error: 'n_kai' was not declared in this scope
13 | for(int i = 1;... |
s640751260 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
template<int MOD> struct Fp {
long long val;
constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
if (val < 0) val += MOD;
}
constexpr int getmod() { return MOD; }
constexpr Fp operator - () const noexcept {
return val ? MOD - val : 0;... | a.cc:59:14: error: two or more data types in declaration of 'type name'
59 | using mint = Fp<MOD>
| ^~~~~~~
|
s617929590 | p03681 | C++ | #include <bits/stdc++.h>
template<int MOD> struct Fp {
long long val;
constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
if (val < 0) val += MOD;
}
constexpr int getmod() { return MOD; }
constexpr Fp operator - () const noexcept {
return val ? MOD - val : 0;
}
constexpr ... | a.cc:46:22: error: 'ostream' does not name a type
46 | friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
| ^~~~~~~
a.cc: In member function 'constexpr Fp<MOD>& Fp<MOD>::operator/=(const Fp<MOD>&)':
a.cc:33:25: error: there are no arguments to 'swap' that ... |
s875837127 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define MOD = 1000000007ULL;
#define rep(i,n) for(int i=0;i<n;i++)
int main() {
ll N,M;
cin>>N>>M;
ll mod=1;
rep(i,N) mod=mod*i%... | a.cc: In function 'int main()':
a.cc:8:13: error: expected primary-expression before '=' token
8 | #define MOD = 1000000007ULL;
| ^
a.cc:16:28: note: in expansion of macro 'MOD'
16 | rep(i,N) mod=mod*i%MOD;
| ^~~
a.cc:8:13: error: expected primary-expres... |
s415958642 | p03681 | C++ |
ans=fact(min(n,m));
ans*=ans;
ans%=mod;
ans*=max(n,m);
ans%=mod;
}
cout<<ans;
}
else
cout<<"0\n";
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt"... | a.cc:2:17: error: 'ans' does not name a type
2 | ans=fact(min(n,m));
| ^~~
a.cc:3:17: error: 'ans' does not name a type
3 | ans*=ans;
| ^~~
a.cc:4:17: error: 'ans' does not name a type
4 | ans%=mod;
| ... |
s762144132 | p03681 | C++ | #include<bits/stdc++.h>
//#include <ext/pb_ds/detail/standard_policies.hpp>
const double pi=acos(-1.0);
//memset ( a , 0 , n * sizeof(ll) ) ;
using namespace std;
//using namespace __gnu_pbds;
#define endl '\n'
#define sl(n) scanf("%lld",&n)
#define mp make_pair
#define pb push_back
#define ... | a.cc: In function 'int main()':
a.cc:86:10: error: expected ',' or ';' before 'cout'
86 | cout<<ans<<endl;
| ^~~~
|
s808911293 | p03681 | C++ | #include<bits/stdc++.h>
//#include <ext/pb_ds/detail/standard_policies.hpp>
const double pi=acos(-1.0);
//memset ( a , 0 , n * sizeof(ll) ) ;
using namespace std;
//using namespace __gnu_pbds;
#define endl '\n'
#define sl(n) scanf("%lld",&n)
#define mp make_pair
#define pb push_back
#define ... | a.cc: In function 'void init()':
a.cc:79:10: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
79 | int main(){
| ^~
a.cc:79:10: note: remove parentheses to default-initialize a variable
79 | int main(){
| ^~
| --
a.cc:79:10: no... |
s938219912 | p03681 | C++ | #include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <deque>
using namespace std;
#define rep(i, n) for (int i=0; i<int(n); i++... | a.cc: In function 'int main()':
a.cc:34:31: error: 'mod' was not declared in this scope; did you mean 'modf'?
34 | nn %= mod;
| ^~~
| modf
a.cc:40:31: error: 'mod' was not declared in this scope; did you mean 'modf'?
4... |
s223523580 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int facctorialMethod(int k){
ll sum = 1;
for (int i = 1; i <= k; ++i)
{
sum = sum*i%(1000000000+7);
}
return sum;
}
int main()
{
int n,m;
ll ans=0;
cin >> n >>m;
ll N,M;
N=facctorialMethod(n);
M=facctorial... | a.cc:24:18: error: extended character is not valid in an identifier
24 | ans = N * M *2 %(1000000000+7);
| ^
a.cc:27:15: error: extended character is not valid in an identifier
27 | ans = N * M %(1000000000+7);
| ^
a.cc: In function 'int main()':
a.cc:24:18: ... |
s687099089 | p03681 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
#include <iomanip>
#include <map>
#include <math.h>
#include <list>
#include <deque>
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a,... | a.cc: In function 'int main()':
a.cc:43:29: error: expected '}' at end of input
43 | cout << ans << endl;
| ^
a.cc:25:1: note: to match this '{'
25 | {
| ^
|
s584008204 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll r = 1000000007;
ll np(int a){
ll ans=1;
while(a>0){
ans *= a;
ans %= r
a--;
}
return ans;
}
int main(){
int n,m;
cin >> n >> m;
if(abs(n-m) > ... | a.cc: In function 'long long int np(int)':
a.cc:11:17: error: expected ';' before 'a'
11 | ans %= r
| ^
| ;
12 | a--;
| ~
|
s881162575 | p03681 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
ll n, m;
cin >> n >> m;
if(n-m>1||m-n>1){
cout << 0 << endl;
return 0;
}
ll a = 1;
rep(i,n+1){
a*= i;
}
ll b = 1;
rep(i,m+1)){
b *= i;
... | a.cc: In function 'int main()':
a.cc:20:15: error: expected primary-expression before ')' token
20 | rep(i,m+1)){
| ^
|
s791246201 | p03681 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 1; (i) < (n); i++)
#define ll long long
using namespace std;
int main(){
ll n,m;
cin>>n,m;
ll ans=0;
if(n-m>=2||m-n>2){
cout<<'0'<<endl;
return 0;
}
else if(n-m=1||m-n=1){
for(ll i=n;i>=1;i--){
for(ll j=m;j>=1;j--){
ans=i*j;... | a.cc: In function 'int main()':
a.cc:14:16: error: lvalue required as left operand of assignment
14 | else if(n-m=1||m-n=1){
| ~^~~~~
|
s867983550 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
if (abs(n-m)>1) cout << 0 << endl;
else {
long long kaim=1;
long long kain=1;
for (int i=2;i<=m;++i){
kaim*=i;
}
for (int i=2;i<=n;++i){
kain*=i;
}
long long ans=2*kain*ka... | a.cc: In function 'int main()':
a.cc:17:32: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
17 | long long ans=2*kain*kain%(1e9+7);
| ~~~~~~~~~~~^~~~~~~~
| | |
| | doubl... |
s555275320 | p03681 | C++ | import math
mod=10**9+7
def main():
N,M=map(int,input().split())
ans=0
if abs(N-M)>=2:
print(0)
else:
if N==M:
ans+=(math.factorial(N)*math.factorial(M))*2
ans%=mod
print(ans)
else:
ans+=(math.factorial(N)*math.fa... | a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s121652283 | p03681 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 100000... | a.cc: In function 'int main()':
a.cc:69:23: error: expected ';' before ')' token
69 | for(ll i=2;i<=100000){
| ^
| ;
a.cc:73:27: error: 'i' was not declared in this scope
73 | if(max(n,m)-min(n,m)>=2;i++){
| ^
|
s468274373 | p03681 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 100000... | a.cc: In function 'int main()':
a.cc:69:23: error: expected ';' before ')' token
69 | for(ll i=2;i<=100000){
| ^
| ;
|
s818772897 | p03681 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 100000... | a.cc: In function 'int main()':
a.cc:65:3: error: 'vll' was not declared in this scope; did you mean 'll'?
65 | vll kaizyo(100000+1) ;
| ^~~
| ll
a.cc:66:3: error: 'kaizyo' was not declared in this scope
66 | kaizyo[0] = 1 ;
| ^~~~~~
a.cc:68:23: error: expected ';' before ')' token
... |
s418304132 | p03681 | C++ | N = 10**6
mod = 10**9 + 7
fact = [1]
for i in range(1, N+1):
fact.append(fact[-1]*i%mod)
n,m = map(int, input().split())
if n-m > 1 or m-n >1:
ans=0
elif n-m == 0:
ans = 2*fact[n]*fact[m]%mod
else:
ans = fact[n] * fact[m] % mod
print(ans)
| a.cc:1:1: error: 'N' does not name a type
1 | N = 10**6
| ^
|
s096423264 | p03681 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
using ll = long long;
ll factorial(ll x) {
if (x==0 || x==1) return 1;
return ((x % 1000000007) * factorial(x-1)) % 1000000007;
}
int main() {
ll n, m;
cin >> n >> m;
ll a = max(n, m);
ll b = min(n, ... | a.cc: In function 'int main()':
a.cc:24:23: error: 'factrial' was not declared in this scope; did you mean 'factorial'?
24 | cout << (temp*factrial(a)) % 1000000007 << endl;
| ^~~~~~~~
| factorial
|
s689009182 | p03681 | C++ | // clang-format off
#include <bits/stdc++.h>
#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
... | a.cc: In function 'int main()':
a.cc:62:9: error: expected ',' or ';' before 'while'
62 | while (true);
| ^~~~~
|
s737558229 | p03681 | C++ | // clang-format off
#include <bits/stdc++.h>
#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
... | a.cc: In function 'int main()':
a.cc:63:5: error: expected ',' or ';' before 'cout'
63 | cout << "ce" << endl;
| ^~~~
|
s070267573 | p03681 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
int main(){
ll N, M; cin >> N >> M;
if(N + 1 < M || M + 1 < N){
cout << 0 << endl;
return;
}
ll ans = 1;
for(ll i = N; i > 0; i--){
ans *= i;
ans %= MOD;
}
for(... | a.cc: In function 'int main()':
a.cc:14:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
14 | return;
| ^~~~~~
|
s064144166 | p03681 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq... | a.cc: In function 'int main()':
a.cc:20:13: error: 'N' was not declared in this scope
20 | REP(i,2,N){
| ^
a.cc:4:48: note: in definition of macro 'REP'
4 | #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
| ^
a.cc:24:13: error: 'M'... |
s601678500 | p03681 | C++ | #include<bits/stdc++.h>
#define ll long long
using namespace std;
ll fact(ll a) {
ll ret = 1;
for (ll i = 1; i <= a; ++i) ret *= a;
return ret%mod;
}
int main() {
ll n,m; cin >> n >> m;
ll mod = 1000000000+7;
if (abs(n-m) > 1) cout << 0 << endl;
else {
ll ans = 0;
if (n==m) ans = 2*fact(n)*fact(n... | a.cc: In function 'long long int fact(long long int)':
a.cc:8:14: error: 'mod' was not declared in this scope; did you mean 'modf'?
8 | return ret%mod;
| ^~~
| modf
|
s504926467 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,m,ansn,ansm;
cin >> n >> m;
ansn = 1;
ansm = 1;
if(n==m){
for (n ;n>0;--n){
ansn *= n;
}
for (m ;m>0;--m){
ansm *= m;
}
cout << ansn * ansm%1000000007 << endl;
break;
}
else if ( n+1 == m || n-1 == m... | a.cc: In function 'int main()':
a.cc:19:5: error: break statement not within loop or switch
19 | break;
| ^~~~~
a.cc:29:5: error: break statement not within loop or switch
29 | break;
| ^~~~~
|
s772059551 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,m,ansn,ansm;
cin >> n >> m;
ansn = 1;
ansm = 1;
if(n==m){
for (n ;n>0;--n){
ansn *= n;
}
for (m ;m>0;--m){
ansm *= m;
}
cout << ansn * ansm%1000000007 << endl;
break; }
else if ( n+1 == m || n-1 == m){... | a.cc: In function 'int main()':
a.cc:19:5: error: break statement not within loop or switch
19 | break; }
| ^~~~~
a.cc:28:5: error: break statement not within loop or switch
28 | break; }
| ^~~~~
a.cc:31:5: error: break statement not within loop or switch
31 | break;
| ... |
s626253561 | p03681 | C++ | /*Function Template*/
#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)
int Len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int Sint(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10... | a.cc: In function 'int main()':
a.cc:63:22: error: expected ';' before ':' token
63 | cout<<ans%mod<<endl:
| ^
| ;
|
s762084849 | p03681 | C++ | #include <stdio.h>
#include <iostream>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] *... | a.cc:26:6: error: invalid preprocessing directive #printf
26 | #printf("%d", 0);
| ^~~~~~
|
s663732533 | p03681 | C++ | #include <iostream> | /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
|
s650084686 | p03681 | C++ | #include <iostream>
#include <vector>
using namespace std;
long long int MOD = 1000000007;
int main(){
int M, D;
cin >> M >> D;
if(abs(M - D) > 1){
cout << 0;
return 1;
}else{
long long int ans = 1LL;
for(int i = M; i >=1; i--){
ans *= i;
ans %= MOD;
}
for(int i = N; ... | a.cc: In function 'int main()':
a.cc:21:17: error: 'N' was not declared in this scope
21 | for(int i = N; i >=1; i--){
| ^
|
s810170134 | p03681 | C++ | #include <isotream>
#include <vector>
using namespace std;
long long int MOD = 1000000007;
int main(){
int M, D;
cin >> M >> D;
if(abs(M - D) > 1){
cout << 0;
return 1;
}else{
long long int ans = 1LL;
for(int i = M; i >=1; i--){
ans *= i;
ans %= MOD;
}
for(int i = N; ... | a.cc:1:10: fatal error: isotream: No such file or directory
1 | #include <isotream>
| ^~~~~~~~~~
compilation terminated.
|
s813123819 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
constexpr int32_t MOD = 1e9 + 7; //10^9
template<int32_t MAX> struct cominit{
int64_t Fac[MAX], Finv[MAX], Inv[MAX];
constexpr cominit(): Fac(), Finv(), Inv(){
Fac[0] = Fac[1] = 1;
Finv[0] = Finv[1] = 1;
Inv[1] = 1;
for (int i = 2; ... | a.cc: In function 'int main()':
a.cc:24:34: error: 'MAX' was not declared in this scope
24 | constexpr auto com = cominit<MAX>();
| ^~~
a.cc:24:37: error: template argument 1 is invalid
24 | constexpr auto com = cominit<MAX>();
| ... |
s596059172 | p03681 | C++ | #include<iostream>
#define M 1000000007L
long n,m;long f(long x){return x-1?x*f(x-1):1;}
main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*max(0,2-abs(n-m));} | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*max(0,2-abs(n-m));}
| ^~~~
a.cc: In function 'int main()':
a.cc:4:46: error: 'max' was not declared in this scope; did you mean 'std::max'?
4 | main(){std::cin>>n>>m;std::... |
s147484972 | p03681 | C++ | #include<iostream>
#define M 1000000007L
long n,m;long f(long x){return x-1?x*f(x-1):1}
main(){std::cin>>n>>m;std::cout<<f(n)*f(m)%M*fmax(0,2-abs(n-m));} | a.cc: In function 'long int f(long int)':
a.cc:3:46: error: expected ';' before '}' token
3 | long n,m;long f(long x){return x-1?x*f(x-1):1}
| ^
| ;
a.cc: At global scope:
a.cc:4:1: warning: ISO C++ forbids declara... |
s604398152 | p03681 | C | #include<iostream>
#include<cmath>
long f(long x){if(x==1)return 1l;return x*f(x-1)%1000000007;}
int main()
{
long n,m;std::cin>>n>>m;
if(abs(n-m)<2)std::cout<<(abs(n-m)<2?f(n)*f(m)%1000000007*(2-abs(n-m))%1000000007:0)<<std::endl;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s721715850 | p03681 | C++ | #include<bits/stdc++.h>
using namespace std;
using long long = ll;
const ll mod=1e9+7;
int main(){
ll n,m,ans=1; cin>>n >>m;
if(abs(n-m)>1){
cout<<0<<endl;
return 0;
}
if(n==m)ans=2;
for(int i=1;i<=n;i++){
ans*=i;
ans%=mod;
}
for(int i=1;i<=m;i++){
ans*=i;
ans%=mod;
}
cout<<ans... | a.cc:3:7: error: expected nested-name-specifier before 'long'
3 | using long long = ll;
| ^~~~
a.cc:4:7: error: 'll' does not name a type
4 | const ll mod=1e9+7;
| ^~
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
6 | ll n,m,ans=1; cin>>n >>m;
... |
s355356974 | p03681 | C++ | #include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long long c=a%i_7;
if(c>=0)return c;
return c+i_7;
}
using namespace st... | a.cc: In function 'int kruskal()':
a.cc:52:9: error: 'i' was not declared in this scope
52 | rep(i,edges.size()){
| ^
a.cc:52:5: error: 'rep' was not declared in this scope; did you mean 'res'?
52 | rep(i,edges.size()){
| ^~~
| res
|
s489794114 | p03681 | C++ | #define _CRT_SECURE_NO_WARNINGS
#define MATH_PI 3.14159265358979323846264338327950288419716939
#define DIVIDER9 1000000007
#define lli long long int
#include <iostream>
#include <string.h>
#include <fstream>
#include <math.h>
#include <iomanip>
using namespace std;
#ifdef _WIN32
#pragma warning(disable : 4101)
sign... | a.cc: In function 'int main()':
a.cc:4:13: error: expected primary-expression before 'long'
4 | #define lli long long int
| ^~~~
a.cc:256:22: note: in expansion of macro 'lli'
256 | c *= lli(i + 1);
| ^~~
a.cc:4:13: error: expected primary-expression be... |
s481490048 | p03681 | C++ | #include<bits/stdc++.h>
typedef long long llong;
using namespace std;
llong f(int x){
llong res=1;
for(int i=1;i<=x;++i){
res*=i;
res%=MOD;
}
return res;
}
int main(){
int n,m;
cin>>n>>m;
if(abs(n-m)>1){
cout<<0<<endl;
return 0;
}
llong ans=f(n);
ans*=f(m);
ans%=MOD;
if(abs(n-m)==0){
ans*=... | a.cc: In function 'llong f(int)':
a.cc:9:22: error: 'MOD' was not declared in this scope
9 | res%=MOD;
| ^~~
a.cc: In function 'int main()':
a.cc:25:14: error: 'MOD' was not declared in this scope
25 | ans%=MOD;
| ^~~
|
s899048437 | p03681 | C++ | #include <bits/stdc++.h>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begi... | a.cc:97:18: error: exponent has no digits
97 | ans = ans % (10e + 9);
| ^~~
a.cc: In function 'int main()':
a.cc:91:17: error: 'max' cannot be used as a function
91 | ll max = max(N, M);
| ~~~^~~~~~
a.cc:92:17: error: 'min' cannot be used as a function
92 | ... |
s858997679 | p03681 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
#define repprev(i,a,b) for(ll i=b-1;i>=a;i--)
#define reprev(i,n) repprev(i,0,n)
using namespace std;
#define sz(x)... | a.cc:167:14: error: 'int fac(int)' redeclared as different kind of entity
167 | int fac(int k){
| ^
a.cc:42:11: note: previous declaration 'long long int fac [510000]'
42 | long long fac[MAX], finv[MAX], inv[MAX];
| ^~~
a.cc: In function 'int main()':
a.cc:183:26: error: 'fac' ca... |
s875035557 | p03681 | Java | import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
solve();
}
static long MOD = (... | Main.java:28: error: cannot find symbol
if(n == m) return 2 * tmp % mod;
^
symbol: variable mod
location: class Main
1 error
|
s363826852 | p03681 | C++ | #include<iostream>
using namespace std;
long long abs(long long x,long long y){ long c;
if( x >= y){ c = x - y;}
else{c = y - x;}
return c;}
long long Fac( long long n){
int rep = 1;
for(int i = 1; i <= n; i++){
rep = rep * j; rep = rep % 1000000007;}
return rep;}
... | a.cc: In function 'long long int Fac(long long int)':
a.cc:13:18: error: 'j' was not declared in this scope
13 | rep = rep * j; rep = rep % 1000000007;}
| ^
|
s590221264 | p03681 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
cin>>a>>b;
cout<<a*b*2;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:10: error: 'a' was not declared in this scope
4 | cin>>a>>b;
| ^
a.cc:4:13: error: 'b' was not declared in this scope
4 | cin>>a>>b;
| ^
|
s627722433 | p03681 | C++ | easy | a.cc:1:1: error: 'easy' does not name a type
1 | easy
| ^~~~
|
s096821651 | p03681 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
const long long mod 1e9+7;
int main() {
long long n,m,ans=1;
cin >> n >> m;
if(abs(n-m)>1) {
cout << 0 << endl;
return 0;
}
for(long long i=2; i<=n; i++) {
ans*=i;
ans%=mod;
}
for(long long i=2; i<=m; i++) {
an... | a.cc:5:21: error: expected initializer before numeric constant
5 | const long long mod 1e9+7;
| ^~~
a.cc: In function 'int main()':
a.cc:15:10: error: 'mod' was not declared in this scope; did you mean 'modf'?
15 | ans%=mod;
| ^~~
| modf
a.cc:19:10: err... |
s253073257 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define INF INT_MAX
#define MOD 1000000007
#define PI acos(-1)
using ll = long long;
using ull = unsigned long long;
using Pii... | a.cc: In function 'int main(int, char**)':
a.cc:37:32: error: expected ';' before 'ans'
37 | ans = fact(N)*fact(M)*2
| ^
| ;
38 | ans %= MOD;
| ~~~
|
s813319308 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m, i;
long long a = 1;
if(abs(m-n) > 1){
cout << 0;
}else{
for(i=1; i<=n; i++){
a *= (long long)i;
a %= 1000000007;
}
for(i=1; i<=n; i++){
a *= (long long)i;
... | a.cc: In function 'int main()':
a.cc:18:17: error: 'b' was not declared in this scope
18 | if(a == b){
| ^
|
s751410044 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
int main(){
ll n,m;
cin >> n >> m;
ll ans = 1;
if(max(n,m)-min(n,m) >= 2)ans = 0;
FOR(i,1,m+1)(ans*=i)%=MOD;
FOR(i,1,n+1)(ans*=i)%=MOD;
if(n==m)(ans*=2)%=MOD;
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:31: error: 'MOD' was not declared in this scope
10 | FOR(i,1,m+1)(ans*=i)%=MOD;
| ^~~
a.cc:11:31: error: 'MOD' was not declared in this scope
11 | FOR(i,1,n+1)(ans*=i)%=MOD;
| ^~~
a.cc:1... |
s926100575 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
long N, M;
cin >> N >> M;
int flag = 0;
if(abs(N - M) != 0 && abs(N - M) != 1) flag++;
long ans = 0, a = 1, b = 1;
if(flag == 1) {
for(int i = N; i != 0; i--) {
a *= i;
a %= 100000007;
}
for(int i = M; i != 0; i--) {
b... | a.cc: In function 'int main()':
a.cc:18:16: error: 'B' was not declared in this scope
18 | ans = (a * B) % 1000000007;
| ^
|
s513620966 | p03681 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007;
signed main(){
int n, m; cin >> n >> m;
if(abs(n - m <= 1)){
cout << 0 << endl;
return 0;
}else{
int ans = 1;
for(int i = 1; i <= n; i++){
ans *= i;
ans %=... | a.cc: In function 'int main()':
a.cc:30:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
30 | cout << ans << endl;
| ^~~
| abs
|
s093382208 | p03681 | C++ | include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int n,m;
cin>>n>>m;
ll c=1;
for(int i=1;i<=n;i++){
c*=i;
c%=1000000007;
}
for(int i=1;i<=m;i++){
c*=i;
c%=1000000007;
}
if(n==m){
c*=2;
c%=1000000007;
}
cout<<c;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin>>n>>m;
| ^~~
a.cc:20:3: error: 'cout' was not declared in this scope
20 | cout<<c;
| ^~~~
|
s610718414 | p03681 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll mo=1000000007
int main(){
ll a,b;
cin>>a,b;
if(a<b) swap(a,b);
if(a-b>1) cout<<0;
else if(a==b){
ll c=1;
for(int i=a;i>0;i++){
c*=i;
c%=mo;
}
cout<<c*4%mo;
}else{
ll c=1;
for(int i=a;i>0;i++){
c*=i... | a.cc:5:1: error: expected ',' or ';' before 'int'
5 | int main(){
| ^~~
|
s960717088 | p03681 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include<string>
#include<iomanip>
using ll = long long;
using ull = unsigned long long;
static ull tenq = 1000000000;
static ull mod = tenq + 7;
using namespace std;
int main(){
ll n, m; cin >> n >> m;
ull na = 1, ma = 1;
ll diff = 0;
... | a.cc: In function 'int main()':
a.cc:26:17: error: 'nm' was not declared in this scope; did you mean 'na'?
26 | ull ans = (na*nm*diff) % mod;
| ^~
| na
|
s972002047 | p03681 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,m,ansn=1,ansm=1;
cin>>n>>m;
if(abs(n-m)>=2){
cout<<0<<endl;
return 0;
}
while(n){
ansn*=n;
ansn%=(1e9+7);
n--;
}
while(m){
ansm*=m;
ansm%=(1e9+7);
m--;
}
cout<<(n-m?(ansn*ansm)%(1e9+7):((ansn*ansm)*2)... | a.cc: In function 'int main()':
a.cc:13:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
13 | ansn%=(1e9+7);
| ~~~~^~~~~~~~~
a.cc:13:9: note: in evaluation of 'operator%=(long long int, double)'
a.cc:18:9: error: invalid operands of types 'long long int' and 'dou... |
s211242727 | p03681 | C++ | #include <bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
ll s[100100];
int main(){
int n,m;
cin>>n>>m;
long long p;
s[0]=1;
for(int i=1;i<=10010;i++){
s[i]=(s[i-1]%mod*i%mod)%mod;
if(s[i]>=mod) s[i]-=mod;
}
if(abs(n-m)>1) cout<<0<<endl;
else{
if(n<m) swa... | a.cc:4:1: error: 'll' does not name a type
4 | ll s[100100];
| ^~
a.cc: In function 'int main()':
a.cc:9:5: error: 's' was not declared in this scope
9 | s[0]=1;
| ^
|
s906422149 | p03681 | C++ | let ( *@ ) a b = (a * b) mod 1000000007
let fact = let rec f v n = if n <= 0 then v else f (n *@ v) (n-1) in f 1
let n, m = Scanf.scanf "%d %d" (fun x y -> x, y)
let () =
let mul = 2 - abs (n - m) |> max 0 in
fact n *@ fact m *@ mul |> Printf.printf "%d\n" | a.cc:1:8: error: stray '@' in program
1 | let ( *@ ) a b = (a * b) mod 1000000007
| ^
a.cc:2:56: error: stray '@' in program
2 | let fact = let rec f v n = if n <= 0 then v else f (n *@ v) (n-1) in f 1
| ^
a.cc:6:11: error: stray '@' in p... |
s730063979 | p03681 | C++ | 2#include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>
using namespace std;
int main() {
int N,M;
cin >> N>>M;
long long int Y = 0;
long long int R = 1;
if (N == M) {
for (int i = 1; i ... | a.cc:1:2: error: stray '#' in program
1 | 2#include <iostream>
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 2#include <iostream>
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
... |
s530655768 | p03681 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
if(Math.abs(m - n) > 1) {
System.out.println("1");
}
else {
long factorial = 2;
for(int i = 2; i <= n; i++) {
factorial = factorial... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s684254780 | p03681 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
if(Math.abs(m - n) > 1) {
System.out.println("1");
}
else {
long factorial = 2;
for(int i = 2; i <= n; i++) {
factorial = factorial... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s669373452 | p03681 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
if(Math.abs(m - n) > 1) {
System.out.println("1");
}
else {
long factorial = 2;
for(int i = 2; i <= n; i++) {
factorial = fac... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s448562511 | p03681 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b... | a.cc:94:11: error: redefinition of 'const int INF'
94 | const int INF = 1e9,MOD = 1e9 + 7;
| ^~~
a.cc:18:11: note: 'const int INF' previously defined here
18 | const int INF = 1e9,MOD = 1e9 + 7;
| ^~~
a.cc:94:21: error: redefinition of 'const int MOD'
94 | const int INF = 1e9,MO... |
s175348338 | p03681 | C++ | #include <string>
#include <iostream>
using namespace std;
long main() {
long n,m,i,ans=1;
cin >> n>>m;
if(n-m==1 || m-n==1){
for(i=1;i<=n;i++){
ans = ans*i;
ans = ans%(1000000007);
}
for(i=1;i<=m;i++){
ans = ans*i;
ans = ans %(1000000007);
}
}else if(n==m){
for(i... | cc1plus: error: '::main' must return 'int'
|
s196479907 | p03681 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b;
cin>>a>>b;
long long ans=1;
if(abs(a-b)>1)ans=0;
else if(a==b){
for(int i=1;i<=a;i++){
ans=(ans*i)%1000000007;
ans=(ans*2)%1000000007;
}
}else{
ll ans2=1;
for(int i=1;i<=min(a,b);i++){
ans=(ans*i)%1000000007;
ans2=(ans2*i)%1000000007;
}
ans2=(ans2*... | a.cc: In function 'int main()':
a.cc:14:1: error: 'll' was not declared in this scope
14 | ll ans2=1;
| ^~
a.cc:17:1: error: 'ans2' was not declared in this scope; did you mean 'ans'?
17 | ans2=(ans2*i)%1000000007;
| ^~~~
| ans
a.cc:19:1: error: 'ans2' was not declared in this scope; did you mea... |
s437727741 | p03681 | C++ | import static java.lang.System.out;
import java.util.Scanner;
import java.util.Arrays;
public class Main{
public static void main(String[]aa){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int max = 1000000007;
if(Math.abs(N-M)>1){
out.print... | a.cc:1:1: error: 'import' does not name a type
1 | import static java.lang.System.out;
| ^~~~~~
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.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '... |
s972467869 | p03681 | C++ | #ifndef __INTMOD_H__0001__
#define __INTMOD_H__0001__
#include <vector>
template <unsigned int Modulus>
class IntMod {
typedef unsigned long long ULL;
private:
unsigned int value_m;
void Copy(const IntMod& other) { value_m = other.value_m; }
bool Modulus_is_valid() { return Modulus != 0; }
public:
IntMod() { va... | a.cc: In member function 'IntMod<Modulus> IntMod<Modulus>::Fact() const':
a.cc:101:24: error: 'vector' does not name a type
101 | static vector<IntMod> table;
| ^~~~~~
a.cc:103:21: error: 'table' was not declared in this scope; did you mean 'mutable'?
103 | ... |
s594627921 | p03681 | C++ | #include <iostream>
#include <array>
using namespace std;
const int abs(const int &x) {
return (x < 0) ? -x : x;
}
int main()
{
ios::sync_with_stdio(false);
int n, m;
cin >> n >> m;
const int MOD = (const int)1e9 + 7;
if (abs(n - m) >= 2) {
cout << 0;
}
else {
int p ... | a.cc: In function 'int main()':
a.cc:18:12: error: call of overloaded 'abs(int)' is ambiguous
18 | if (abs(n - m) >= 2) {
| ~~~^~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
from /usr/include/c++/... |
s588286648 | p03681 | C++ | ar = [int(i) for i in input().split()]
n = ar[0]
m = ar[1]
res = 1
if(abs(n-m)>1):
res = -1
elif(abs(n-m) == 1):
max = max(n, m)
min = min(n, m)
for i in range(max-1):
res = res * max * min
res %= (10**9+7)
max -= 1
min -= 1
else:
max = max(n, m)
res = res * 2*n * m
n -= 1
m -= 1
for i in range(max-2)... | a.cc:1:1: error: 'ar' does not name a type; did you mean 'char'?
1 | ar = [int(i) for i in input().split()]
| ^~
| char
|
s273526921 | p03681 | C++ | #include <stdio.h>
using namespace std;
#define R 1000000007
int main() {
int N, M;
long long int ans;
long long int a = 1;
long long int b = 1;
scanf_s("%d%d",&N,&M);
bool nTurn = true;
int curN = N;
int curM = M;
for (int i = 0; i < (N + M); i++) {
if (nTurn) {
if (curN == 0) {
a = 0;
break;
... | a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | scanf_s("%d%d",&N,&M);
| ^~~~~~~
| scanf
a.cc:60:9: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
60 | printf_s("%d", (a+b)%R... |
s573665671 | p03681 | C++ | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
long long int mod = 10e9+7;
int fact(int n){
int factorial = 1;
for (int i=1;i<=n;i++){
factorial*= i;
}
return factorial;
}
int main() {
int d,m;long long int ans=0;
cin>>... | a.cc: In function 'int main()':
a.cc:24:37: error: expected ')' before ';' token
24 | ans = 2*(fact(d)*fact(m);
| ~ ^
| )
|
s976455315 | p03681 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
int mod_fact(int n, int mod) {
if ( n <= 1 ) return 1;
return (n * mod_fact(n-1)) % mod;
}
int main( void ) {
int N, M;
std::cin >> N >> M;
const int mod = 1000000007;
const int max = std::max(N, M);
const int min = std::min(N, M);
if( max -... | a.cc: In function 'int mod_fact(int, int)':
a.cc:7:23: error: too few arguments to function 'int mod_fact(int, int)'
7 | return (n * mod_fact(n-1)) % mod;
| ~~~~~~~~^~~~~
a.cc:5:5: note: declared here
5 | int mod_fact(int n, int mod) {
| ^~~~~~~~
a.cc: In function 'int main()':
a... |
s678680135 | p03681 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
int mod_fact(int n, int mod) {
if ( n <= 1 ) return 1;
return (n * mod_fact(n-1)) % mod;
}
int main( void ) {
int N, M;
std::cin >> N >> M;
const int mod = 1000000007;
const int max = std::max(N, M);
const int min = std::min(N, M);
if( max -... | a.cc: In function 'int mod_fact(int, int)':
a.cc:7:23: error: too few arguments to function 'int mod_fact(int, int)'
7 | return (n * mod_fact(n-1)) % mod;
| ~~~~~~~~^~~~~
a.cc:5:5: note: declared here
5 | int mod_fact(int n, int mod) {
| ^~~~~~~~
a.cc: In function 'int main()':
a... |
s687229914 | p03681 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
typedef long long ll;
int mod_fact(int n, int mod) {
if ( n <= 1 ) return 1;
return (n * factorial(n-1)) % mod;
}
int main( void ) {
int N, M;
std::cin >> N >> M;
const int mod = 1000000007;
const int max = std::max(N, M);
const int min = std:... | a.cc: In function 'int mod_fact(int, int)':
a.cc:9:15: error: 'factorial' was not declared in this scope
9 | return (n * factorial(n-1)) % mod;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:26:24: error: 'factorial' was not declared in this scope
26 | const int fact_max = factorial(max... |
s902305052 | p03681 | C++ | #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <sstream>
#include <deque>
#define ll long long
using namespace std;
const int maxn=100000;
const int mod=1000000007;
int n,m;
int factorial(int n){
int an... | a.cc: In function 'int main()':
a.cc:39:21: error: redeclaration of 'int out'
39 | int out=(2*out)%mod;
| ^~~
a.cc:38:21: note: 'int out' previously declared here
38 | int out=((ans_n*ans_m))%mod;
| ^~~
|
s778220834 | p03681 | C++ | #include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <sstream>
#include <deque>
#define ll long long
using namespace std;
const int maxn=100000;
const int mod=1000000007;
int n,m;
int factorial(int n){
int an... | a.cc: In function 'int main()':
a.cc:35:17: error: 'ans_n' was not declared in this scope
35 | ans_n=factorial(n);
| ^~~~~
a.cc:36:17: error: 'ans_m' was not declared in this scope
36 | ans_m=factorial(m);
| ^~~~~
a.cc:38:17: error: 'out'... |
s527705608 | p03681 | C++ | #include <stdio.h>
#include <math.h>
#include <algorithm>
long long int f(long long num)
{
if (num == 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
long long int ans = 1;
if (N == M) ans *= 2;
printf("... | a.cc: In function 'int main()':
a.cc:20:69: error: expected ')' before ';' token
20 | printf("%lld\n", ((((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
| ~ ^
| )
|
s604798866 | p03681 | C++ | #include <stdio.h>
#include <math.h>
#include <algorithm>
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
long long ans = 1;
if (N == M) ans * 2;
printf("%lld\n... | a.cc: In function 'int main()':
a.cc:20:66: error: expected ';' before ')' token
20 | printf("%lld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
| ^
| ;
|
s041912543 | p03681 | C++ | #include <stdio.h>
#include <math.h>
#include <algorithm>
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n"... | a.cc: In function 'int main()':
a.cc:20:65: error: expected ';' before ')' token
20 | printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
| ^
| ;
|
s326306046 | p03681 | C++ | #include <stdio.h>
#include <math.h>
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 100... | a.cc: In function 'int main()':
a.cc:19:65: error: expected ';' before ')' token
19 | printf("%ld\n", ((ans * f(N)) % 1000000007) * f(M)) % 1000000007);
| ^
| ;
|
s417009044 | p03681 | C++ | #include <stdio.h>
#include <math>
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007);
}
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 10000... | a.cc:2:10: fatal error: math: No such file or directory
2 | #include <math>
| ^~~~~~
compilation terminated.
|
s879552247 | p03681 | C++ | #include <stdio.h>
#include <math.h>
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007)
}
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 1000... | a.cc: In function 'long long int f(long long int)':
a.cc:7:41: error: expected ';' before '}' token
7 | return (num * f(num - 1)) % (1000000007)
| ^
| ;
8 | }
| ~
a.cc: In fu... |
s902957687 | p03681 | C++ | #include <stdio.h>
#include <math>
long long int f(long long num)
{
if (num = 1) return 1;
return (num * f(num - 1)) % (1000000007)
}
int main()
{
long long int N, M;
scanf("%lld%lld", &N, &M);
if (abs(N - M) > 1) printf("-1\n");
else
{
long long ans = 1;
if (N == M) ans * 2;
printf("%ld\n", ((ans * f(N)) % 10000000... | a.cc:2:10: fatal error: math: No such file or directory
2 | #include <math>
| ^~~~~~
compilation terminated.
|
s614806549 | p03681 | C++ | # define vint(v,n) vector<int> v(n); REP(i,n) scanf("%d", &v[i]);
# define string(x) string x; cin >> x;
using namespace std;
namespace utils{
template <typename T> void print(vector<vector<T>> mat) {
REP (i, mat.size()) {
REP (j, mat[0].size()) cout << mat[i][j] << ' ';
cout << endl;
}
}
t... | a.cc:7:30: error: variable or field 'print' declared void
7 | template <typename T> void print(vector<vector<T>> mat) {
| ^~~~~
a.cc:7:36: error: 'vector' was not declared in this scope
7 | template <typename T> void print(vector<vector<T>> mat) {
| ... |
s906473031 | p03681 | C++ | #include<iostream>
using namespace std;
int factorial(int long long);
int main(){
int n,m;
cin>>n>>m;
if(n-m==0){
cout<<(2*factorial(n)*factorial(m))%1000000007<<endl;
}
else if(n-m==1 || n-m==-1){
cout<<(factorial(n)*factorial(m))%1000000007<<endl;
}
else{
cout<<"0"<<endl;
}
return 0;
}
int factorial(lo... | a.cc:18:28: error: expected ',' or '...' before 'M'
18 | int factorial(long longint M){
| ^
a.cc: In function 'int factorial(long int)':
a.cc:20:14: error: 'M' was not declared in this scope
20 | some=M;
| ^
|
s763342544 | p03681 | Java | import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
long n = scanner.nextInt();
long m = scanner.nextInt();
int ans = 1;
if(Math.abs(n,m) >= 2){
System.out.println(0);
}else if (... | Main.java:11: error: no suitable method found for abs(long,long)
if(Math.abs(n,m) >= 2){
^
method Math.abs(int) is not applicable
(actual and formal argument lists differ in length)
method Math.abs(long) is not applicable
(actual and formal argument lists differ in length)
method Math... |
s537377245 | p03681 | C++ | #include<iostream>
#include<vector>
#include<cstdlib>
#include<gmpxx.h>
mpz_class fact(int);
using namespace std;
int main(){
int n,m;
int c = 100000000+7;
cin >> n >> m;
if(n==m){
cout << (fact(n)*2*2)%c << endl;
}
else if(abs(n-m)==1){
cout << (fact(n)*fact(m))%c << endl;
}
else {
cout << 0 << endl;
... | /usr/bin/ld: /tmp/ccU5bANH.o: in function `__gmp_binary_multiplies::eval(__mpz_struct*, __mpz_struct const*, __mpz_struct const*)':
a.cc:(.text._ZN23__gmp_binary_multiplies4evalEP12__mpz_structPKS0_S3_[_ZN23__gmp_binary_multiplies4evalEP12__mpz_structPKS0_S3_]+0x27): undefined reference to `__gmpz_mul'
/usr/bin/ld: /tm... |
s066302244 | p03681 | C | #include <stdio.h>
int kaijou(x);
int main(void){
int n,m;
float x;
scanf("%d %d",&n,&m);
if((n-m)>1||(n-m)<-1)
printf("0\n");
else{
x=kaijou(n)*kaijou(m)*2;
if(x>1.0e9 + 7)
printf("%d\n",x%1.0e9+7);
else
printf("%d\n",x);
}
return 0;
}
int kaijou(x){
int a=1;
int i;
fo... | main.c:3:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
3 | int kaijou(x);
| ^~~
main.c: In function 'main':
main.c:14:22: error: invalid operands to binary % (have 'float' and 'double')
14 | printf("%d\n",x%1.0e9+7);
| ... |
s607517790 | p03681 | C++ | #include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
if(n*m%2==0){
cout<<"0"<<endl;
}
if(n*m%2!=0){
int sum=a*b*2
cout<<sum%1000000007<<endl;
}
/*int n,a[100000],ans=0,count=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(a[i]==j+1)... | a.cc: In function 'int main()':
a.cc:10:25: error: 'a' was not declared in this scope
10 | int sum=a*b*2
| ^
a.cc:10:27: error: 'b' was not declared in this scope
10 | int sum=a*b*2
| ^
|
s786144505 | p03681 | C | #include<stdio.h>
#include<string.h>
#include<math.h>
int plzh(long long a)
{
const long long maple = 1e9+7;
if(a==0||a==1)
return 1;
else
return(a*plzh(a-1)%maple);
}
int main()
{
long long x,m,n;
while(scanf("%lld%lld",&m,&n)!=EOF)
{
if(fabs(m-n)>1)
printf("0\n");
else if(m!=n)
{
x=plzh(m)*plzh(n)%... | main.c: In function 'main':
main.c:21:43: error: 'maple' undeclared (first use in this function)
21 | x=plzh(m)*plzh(n)%maple;
| ^~~~~
main.c:21:43: note: each undeclared identifier is reported only once for each function it appears in
|
s659211580 | p03681 | C++ | #include<iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
if(n*m%2==0){
cout<<"0"<<endl;
}
if(n*m%2!=0){
cout<<(a*b*2)%1000000007<<endl;
}
/*int n,a[100000],ans=0,count=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(a[i]==j+1){
count+... | a.cc: In function 'int main()':
a.cc:10:24: error: 'a' was not declared in this scope
10 | cout<<(a*b*2)%1000000007<<endl;
| ^
a.cc:10:26: error: 'b' was not declared in this scope
10 | cout<<(a*b*2)%1000000007<<endl;
| ^
|
s076248899 | p03681 | C++ | #include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
if (abs(n - m) > 1) {
cout << 0 << endl;
return 0;
}
long nr = 1, mr = 0;
for (int i = n; i > 1; i++) {
nr *= i;
}
for (int i = 0; i < n + 1; i++) {
mr *= (m - i) / (n + 1 - i);
}
long n = 1;
for (int i = 0; i < 9; i++) {... | a.cc: In function 'int main()':
a.cc:18:14: error: conflicting declaration 'long int n'
18 | long n = 1;
| ^
a.cc:5:13: note: previous declaration as 'int n'
5 | int n, m;
| ^
|
s516278199 | p03681 | C++ | # coding: utf-8
# Here your code !
n,m=input().split()
l=[1]
for i in range(1,100001):
l.append(l[i-1]*(i)%1000000007)
n=int(n)
m=int(m)
if n==m:
print(l[n]*l[m]*2%1000000007)
elif (n-m==1):
print(l[n]*l[m])
else:
print(0) | a.cc:1:3: error: invalid preprocessing directive #coding
1 | # coding: utf-8
| ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Here
2 | # Here your code !
| ^~~~
a.cc:4:1: error: 'n' does not name a type
4 | n,m=input().split()
| ^
|
s114108772 | p03681 | C | #include <stdio.h>
#define int64 long long int
int64 F[100005];
const int md = 1000000007;
int n, m;
int abs (int x) { return x < 0 ? -x : x; }
int main ()
{
F[0] = 1;
for (int i = 1; i < 100005; i++) F[i] = F[i - 1] * i, F[i] %= md;
scanf ("%d %d", &n, &m);
if (abs (n - m) => 2) {
puts ("0");
return 0;
}
i... | main.c: In function 'main':
main.c:14:26: error: expected expression before '>' token
14 | if (abs (n - m) => 2) {
| ^
|
s514896812 | p03681 | C++ | from math import *
a,b = map(int, input().split())
if abs(a-b) > 1 :
print(0)
else :
print((1 if abs(a-b) else 2)*factorial(a)*factorial(b)%1000000007)
| a.cc:1:1: error: 'from' does not name a type
1 | from math import *
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.