submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s676527202 | p03796 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
#define Max(a) (*max_element(ALL(a)))
#define Min(a) (*min_element(ALL(a)))
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll ans = 1;
for(ll i=1;i<=n;i++){
ans *= i;
ans %= MOD;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:24:17: error: 'n' was not declared in this scope
24 | for(ll i=1;i<=n;i++){
| ^
|
s778984190 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin>>N;
int j=1;
for(int i=0; i<N; i++){
j*=(i+1);
j%=1000000007
}
cout<<j<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before '}' token
9 | j%=1000000007
| ^
| ;
10 | }
| ~
|
s872875083 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin>>N;
int j=1;
for(int i=0; i<N; i++){
j*=(i+1);
j=j%1000000007
}
cout<<j<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '}' token
9 | j=j%1000000007
| ^
| ;
10 | }
| ~
|
s366387730 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin>>N;
int j=1;
for(int i=0; i<N; i++){
j*=(i+1);
j=j%10**9+7
}
cout<<j<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:12: error: invalid type argument of unary '*' (have 'int')
9 | j=j%10**9+7
| ^~
|
s043351061 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll, vl/*, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); ++i)
#define rep2(i, n) for(ll i = 1; i <= ll(n); ++i)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); ++i)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); ++i)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n ans=1;
cin >> n;
rep2(i, n) (ans*=i)%=MOD;
cout << ans << newl;
} | a.cc: In function 'int main()':
a.cc:32:8: error: expected initializer before 'ans'
32 | ll n ans=1;
| ^~~
a.cc:33:10: error: 'n' was not declared in this scope; did you mean 'yn'?
33 | cin >> n;
| ^
| yn
a.cc:34:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
34 | rep2(i, n) (ans*=i)%=MOD;
| ^~~
| abs
a.cc:35:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
35 | cout << ans << newl;
| ^~~
| abs
|
s249329534 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n;
cin >> n;
ll power = 1;
for (int i = 0; i < n; i++) {
power *= i + 1;
power %= 1e9+7;
}
cout << power << endl;
}
| a.cc: In function 'int main()':
a.cc:15:11: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
15 | power %= 1e9+7;
| ~~~~~~^~~~~~~~
a.cc:15:11: note: in evaluation of 'operator%=(ll {aka long long int}, double)'
|
s986202966 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
long long int a,b;
b=1;
cin>>a;
for(int i=0;i<a;i++){
b*=i;
}
cout<<(b%(1000000000+7))
} | a.cc: In function 'int main()':
a.cc:11:27: error: expected ';' before '}' token
11 | cout<<(b%(1000000000+7))
| ^
| ;
12 | }
| ~
|
s005231217 | p03796 | C++ | #include<cstdio>
long long s=1,n,t=1;
int main()
{
scanf("%lld",&n);
for(;t<n;t++)
{
s*=t,s%=1ll*(1e9+7);
}
printf("%lld",s);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:23: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
8 | s*=t,s%=1ll*(1e9+7);
| ~^~~~~~~~~~~~~
a.cc:8:23: note: in evaluation of 'operator%=(long long int, double)'
|
s593181678 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
ll n;
cin>>n;
ll ans=1;
for(int i=1;i<=n;i++)ans=(ans*i)%1000000007;
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
5 | ll n;
| ^~
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
6 | cin>>n;
| ^
| yn
a.cc:7:5: error: expected ';' before 'ans'
7 | ll ans=1;
| ^~~~
| ;
a.cc:8:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | for(int i=1;i<=n;i++)ans=(ans*i)%1000000007;
| ^~~
| abs
a.cc:9:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
9 | cout<<ans<<endl;
| ^~~
| abs
|
s155769574 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n;
cin>>n;
long long ans=1;
for(int i=1;i<=n;i++)ans=(ans*i)%1000000007;
cour<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:3: error: 'cour' was not declared in this scope
9 | cour<<ans<<endl;
| ^~~~
|
s070759269 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
ll n;
cin>>n;
ll ans=1;
for(int i=1;i<=n;i++)ans=(ans*i)%1000000007;
cour<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
5 | ll n;
| ^~
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
6 | cin>>n;
| ^
| yn
a.cc:7:5: error: expected ';' before 'ans'
7 | ll ans=1;
| ^~~~
| ;
a.cc:8:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | for(int i=1;i<=n;i++)ans=(ans*i)%1000000007;
| ^~~
| abs
a.cc:9:3: error: 'cour' was not declared in this scope
9 | cour<<ans<<endl;
| ^~~~
a.cc:9:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
9 | cour<<ans<<endl;
| ^~~
| abs
|
s093622445 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int power = 1;
for(int i = 0; i < N; i++){
power *= i
}
int ans;
ans = power % 1000000007;
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before '}' token
10 | power *= i
| ^
| ;
11 | }
| ~
|
s347852326 | p03796 | C | #include<stdio.h>
int main(void)
{
double N,i,p;
p=1;
scanf("%lf",&N);
for(i=1;i<=N;i++)
p=p*i;
printf("%lf\n",p%1000000007);
return 0;
}
| main.c: In function 'main':
main.c:12:25: error: invalid operands to binary % (have 'double' and 'int')
12 | printf("%lf\n",p%1000000007);
| ^
|
s245547960 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int cal(int N, int X){
if(N <= 0) return 1;
return N % X * cal(N - 1);
}
int main(){
int N;
cin >> N;
cout << cal(N, 1000000007) << endl;
}
| a.cc: In function 'int cal(int, int)':
a.cc:6:21: error: too few arguments to function 'int cal(int, int)'
6 | return N % X * cal(N - 1);
| ~~~^~~~~~~
a.cc:4:5: note: declared here
4 | int cal(int N, int X){
| ^~~
|
s555663056 | p03796 | C++ | #include<bits\stdc++.h>
using namespace std;
int cal(int N, int X){
if(N <= 0) return 1;
return N % X * cal(N - 1);
}
int main(){
int N;
cin >> N;
cout << cal(N, 1000000007) << endl;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s689129610 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int ans=1;
int n;
cin >> n;
int div = pow(10,9) + 9;
for(int 1 = n;i == n+1;i++){
ans = ((ans) * i % div) % div;
}
std::cout << ans;
} | a.cc: In function 'int main()':
a.cc:9:11: error: expected unqualified-id before numeric constant
9 | for(int 1 = n;i == n+1;i++){
| ^
a.cc:9:10: error: expected ';' before numeric constant
9 | for(int 1 = n;i == n+1;i++){
| ^~
| ;
a.cc:9:11: error: lvalue required as left operand of assignment
9 | for(int 1 = n;i == n+1;i++){
| ^
a.cc:9:17: error: 'i' was not declared in this scope
9 | for(int 1 = n;i == n+1;i++){
| ^
a.cc:9:25: error: expected ')' before ';' token
9 | for(int 1 = n;i == n+1;i++){
| ~ ^
| )
a.cc:9:26: error: 'i' was not declared in this scope
9 | for(int 1 = n;i == n+1;i++){
| ^
|
s174890546 | p03796 | C++ | #include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define sort(s) sort(s.begin(),s.end())
#define reverse(v) reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF UnionFind
#define rt (a); return (a);
#define Pint pair<int,int>
#define keta(a) fixed << setprecision(a)
constexpr auto INF = 1000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで!
//2のn乗を求めるよ!!!
int ni(int n) {
if (n == 0)return 1;
int x = ni(n / 2);
x *= x;
if (n % 2 == 1)x *= 2;
return x;
}
//フィボナッチ数列のx番目を求めるよ!
llint f(int x, vector<llint>& s) {
if (x == 0)return 0;
if (x == 1)return 1;
if (s[x] != 0)return s[x];
return s[x] = f(x - 1, s) + f(x - 2, s);
}
//aとbの最大公約数を求めるよ!
llint gcd(llint a, llint b) {
if (a < b)swap(a, b);
if (b == 0)return a;
return gcd(b, a % b);
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1) res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
// mod. m での a の逆元 a^{-1} を計算するよ!
long long modinv(long long a, long long m) {
long long b = m, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b; swap(a, b);
u -= t * v; swap(u, v);
}
u %= m;
if (u < 0) u += m;
return u;
}
//aCbをmod.mで割った余りを求める
ll int c(ll int a, ll int b, ll int m) {
ll int ans = 1;
for (ll int i = 0; i < b; i++) {
ans *= a - i;
ans %= m;
}
for (ll int i = 1; i <= b; i++) {
ans *= modinv(i, m);
ans %= m;
}
return ans;
}
//m進数のn桁を全列挙やで
void dfs(int m, int n, llint k, hei(llint) a) {
stack<string> st;
st.push("");
while (!st.empty()) {
string now = st.top();
st.pop();
if (now.size() == n) {
cout << now << endl;
}
else {
for (int i = m - 1; i >= 0; i--) {
string next = now + to_string(i);
st.push(next);
}
}
}
}
void press(vector<int>& v) { v.erase(unique((v).begin(), (v).end()), v.end()); }
void press(vector<char>& v) { v.erase(unique((v).begin(), (v).end()), v.end()); }
struct UnionFind {
vector<int> par; // par[i]:iの親の番号 (例) par[3] = 2 : 3の親が2
UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
for (int i = 0; i < N; i++) par[i] = i;
}
int size(int a) {
return par[root(a)];
}
int root(int x) { // データxが属する木の根を再帰で得る:root(x) = {xの木の根}
if (par[x] == x) return x;
return par[x] = root(par[x]);
}
void unite(int x, int y) { // xとyの木を併合
int rx = root(x); //xの根をrx
int ry = root(y); //yの根をry
if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時:xの根rxをyの根ryにつける
}
bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
int rx = root(x);
int ry = root(y);
return rx == ry;
}
};
struct segmenttree {
hei(int) seg;
int s;
segmenttree(int n) :seg(n * 2 - 1) {
for (int i = 0; i < n * 2 - 1; i++)seg[i] = 0;
s = n;
}
//k番目の値をaに変更
void update(int k, int a) {
k += s - 1;
seg[k] += a;
while (k > 0) {
k = (k - 1) / 2;
seg[k] = min(seg[k * 2 + 1], seg[k * 2 + 2]);
}
}
//最初はquery(a,b,0,0,n)で呼ぶよ!!!!
int query(int a, int b, int k, int l, int r) {
if (r <= a || b <= l)return 1000000;
if (a <= l && r <= b)return seg[k];
else {
int v1 = query(a, b, k * 2 + 1, l, (l + r) / 2);
int v2 = query(a, b, k * 2 + 2, (l + r) / 2, r);
return min(v1, v2);
}
}
};
int main() {
int n;
int ans = 0;
rep(i, 2, n + 1) {
ans *= i;
ans %= mod
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:187:27: error: expected ';' before '}' token
187 | ans %= mod
| ^
| ;
188 | }
| ~
|
s238346193 | p03796 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;
using static _20200413.abc055_b.Cin;
using static _20200413.abc055_b.Util;
using Pair = _20200413.abc055_b.VTuple<long, long>;
/// <summary>
/// abc055
/// B - Training Camp
/// https://atcoder.jp/contests/abc055/tasks/abc055_b
/// </summary>
namespace _20200413.abc055_b
{
public class Program
{
public static void Main(string[] args)
{
int N = ri;
Mint power = 1;
for (int i = 1; i <= N; i++)
{
power *= i;
}
Console.WriteLine(power);
}
}
/// <summary>
/// 競プロライブラリ
/// https://github.com/ha2ne2/ABC/tree/master/Lib
/// </summary>
public struct Mint:System.IComparable<Mint>,System.IEquatable<Mint>{public static readonly long MOD=(long)1e9+7;public long Value;public Mint(long val){Value=val%MOD;if(Value<0)Value+=MOD;}private static Mint Ctor(long val){return new Mint(){Value=val};}public static Mint operator+(Mint a,Mint b){long res=a.Value+b.Value;if(res>MOD)res-=MOD;return Ctor(res);}public static Mint operator-(Mint a,Mint b){long res=a.Value-b.Value;if(res<0)res+=MOD;return Ctor(res);}public static Mint operator*(Mint a,Mint b){long res=a.Value*b.Value;if(res>MOD)res%=MOD;return Ctor(res);}public static Mint operator/(Mint a,Mint b){return a*Inv(b);}public override bool Equals(object obj){return obj is Mint&&Value==((Mint)obj).Value;}public override int GetHashCode(){return Value.GetHashCode();}public override string ToString(){return Value.ToString();}public static implicit operator Mint(long a){return new Mint(a);}public static explicit operator long(Mint a){return a.Value;}public static Mint Pow(Mint a,long n){if(n==0)return new Mint(1);Mint b=Pow(a,n>>1);b*=b;if((n&1)==1)b*=a;return b;}public static Mint Inv(Mint n){long a=n.Value;long b=MOD;long x=1;long u=0;while(b!=0){long k=a/b;long _x=u;u=x-k*u;x=_x;long _a=a;a=b;b=_a-(k*b);}return new Mint(x);}public bool Equals(Mint other){return Value==other.Value;}public int CompareTo(Mint other){return Comparer<long>.Default.Compare(Value,other.Value);}}public class HashMap<K,V>:System.Collections.Generic.Dictionary<K,V>{private V DefaultValue;private static Func<V>CreateInstance=System.Linq.Expressions.Expression.Lambda<Func<V>>(System.Linq.Expressions.Expression.New(typeof(V))).Compile();public HashMap(){}public HashMap(V defaultValue){DefaultValue=defaultValue;}new public V this[K i]{get{V v;if(TryGetValue(i,out v)){return v;}else{return base[i]=DefaultValue!=null?DefaultValue:CreateInstance();}}set{base[i]=value;}}}public struct VTuple<T1,T2>:System.IComparable<VTuple<T1,T2>>,System.IEquatable<VTuple<T1,T2>>{public T1 Item1;public T2 Item2;public T1 First{get{return Item1;}}public T2 Second{get{return Item2;}}public VTuple(T1 item1,T2 item2){Item1=item1;Item2=item2;}public override bool Equals(object obj){return obj is VTuple<T1,T2>&&Equals((VTuple<T1,T2>)obj);}public override int GetHashCode(){int h1=Item1!=null?Item1.GetHashCode():0;int h2=Item2!=null?Item2.GetHashCode():0;return HashHelpers.CombineHashCodes(h1,h2);}public override string ToString(){return"("+Item1?.ToString()+", "+Item2?.ToString()+")";}public bool Equals(VTuple<T1,T2>other){return EqualityComparer<T1>.Default.Equals(Item1,other.Item1)&&EqualityComparer<T2>.Default.Equals(Item2,other.Item2);}public int CompareTo(VTuple<T1,T2>other){int c=Comparer<T1>.Default.Compare(Item1,other.Item1);if(c!=0)return c;return Comparer<T2>.Default.Compare(Item2,other.Item2);}}public struct VTuple3<T1,T2,T3>:System.IComparable<VTuple3<T1,T2,T3>>,System.IEquatable<VTuple3<T1,T2,T3>>{public T1 Item1;public T2 Item2;public T3 Item3;public VTuple3(T1 item1,T2 item2,T3 item3){Item1=item1;Item2=item2;Item3=item3;}public override bool Equals(object obj){return obj is VTuple3<T1,T2,T3>&&Equals((VTuple3<T1,T2,T3>)obj);}public override int GetHashCode(){int h1=Item1!=null?Item1.GetHashCode():0;int h2=Item2!=null?Item2.GetHashCode():0;int h3=Item3!=null?Item3.GetHashCode():0;return HashHelpers.CombineHashCodes(h1,h2,h3);}public override string ToString(){return"("+Item1?.ToString()+", "+Item2?.ToString()+", "+Item3?.ToString()+")";}public bool Equals(VTuple3<T1,T2,T3>other){return EqualityComparer<T1>.Default.Equals(Item1,other.Item1)&&EqualityComparer<T2>.Default.Equals(Item2,other.Item2)&&EqualityComparer<T3>.Default.Equals(Item3,other.Item3);}public int CompareTo(VTuple3<T1,T2,T3>other){int c=Comparer<T1>.Default.Compare(Item1,other.Item1);if(c!=0)return c;c=Comparer<T2>.Default.Compare(Item2,other.Item2);if(c!=0)return c;return Comparer<T3>.Default.Compare(Item3,other.Item3);}}public struct VTuple4<T1,T2,T3,T4>:System.IComparable<VTuple4<T1,T2,T3,T4>>,System.IEquatable<VTuple4<T1,T2,T3,T4>>{public T1 Item1;public T2 Item2;public T3 Item3;public T4 Item4;public VTuple4(T1 item1,T2 item2,T3 item3,T4 item4){Item1=item1;Item2=item2;Item3=item3;Item4=item4;}public override bool Equals(object obj){return obj is VTuple4<T1,T2,T3,T4>&&Equals((VTuple4<T1,T2,T3,T4>)obj);}public override int GetHashCode(){int h1=Item1!=null?Item1.GetHashCode():0;int h2=Item2!=null?Item2.GetHashCode():0;int h3=Item3!=null?Item3.GetHashCode():0;int h4=Item3!=null?Item4.GetHashCode():0;return HashHelpers.CombineHashCodes(h1,h2,h3,h4);}public override string ToString(){return"("+Item1?.ToString()+", "+Item2?.ToString()+", "+Item3?.ToString()+", "+Item4?.ToString()+")";}public bool Equals(VTuple4<T1,T2,T3,T4>other){return EqualityComparer<T1>.Default.Equals(Item1,other.Item1)&&EqualityComparer<T2>.Default.Equals(Item2,other.Item2)&&EqualityComparer<T3>.Default.Equals(Item3,other.Item3)&&EqualityComparer<T4>.Default.Equals(Item4,other.Item4);}public int CompareTo(VTuple4<T1,T2,T3,T4>other){int c=Comparer<T1>.Default.Compare(Item1,other.Item1);if(c!=0)return c;c=Comparer<T2>.Default.Compare(Item2,other.Item2);if(c!=0)return c;c=Comparer<T3>.Default.Compare(Item3,other.Item3);if(c!=0)return c;return Comparer<T4>.Default.Compare(Item4,other.Item4);}}public static class HashHelpers{public static readonly int RandomSeed=new System.Random().Next(int.MinValue,int.MaxValue);public static int Combine(int h1,int h2){uint rol5=((uint)h1<<5)|((uint)h1>>27);return((int)rol5+h1)^h2;}public static int CombineHashCodes(int h1,int h2){return Combine(Combine(RandomSeed,h1),h2);}public static int CombineHashCodes(int h1,int h2,int h3){return Combine(CombineHashCodes(h1,h2),h3);}public static int CombineHashCodes(int h1,int h2,int h3,int h4){return Combine(CombineHashCodes(h1,h2,h3),h4);}}public static class Cin{public static int ri{get{return ReadInt();}}public static int[]ria{get{return ReadIntArray();}}public static long rl{get{return ReadLong();}}public static long[]rla{get{return ReadLongArray();}}public static double rd{get{return ReadDouble();}}public static double[]rda{get{return ReadDoubleArray();}}public static string rs{get{return ReadString();}}public static string[]rsa{get{return ReadStringArray();}}public static int ReadInt(){return int.Parse(Next());}public static long ReadLong(){return long.Parse(Next());}public static double ReadDouble(){return double.Parse(Next());}public static string ReadString(){return Next();}public static int[]ReadIntArray(){Tokens=null;return Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);}public static long[]ReadLongArray(){Tokens=null;return Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);}public static double[]ReadDoubleArray(){Tokens=null;return Array.ConvertAll(Console.ReadLine().Split(' '),double.Parse);}public static string[]ReadStringArray(){Tokens=null;return Console.ReadLine().Split(' ');}public static void ReadCol(out long[]a,long N){a=new long[N];for(int i=0;i<N;i++){a[i]=ReadLong();}}public static void ReadCols(out long[]a,out long[]b,long N){a=new long[N];b=new long[N];for(int i=0;i<N;i++){a[i]=ReadLong();b[i]=ReadLong();}}public static void ReadCols(out long[]a,out long[]b,out long[]c,long N){a=new long[N];b=new long[N];c=new long[N];for(int i=0;i<N;i++){a[i]=ReadLong();b[i]=ReadLong();c[i]=ReadLong();}}public static int[,]ReadIntTable(int h,int w){Tokens=null;int[,]ret=new int[h,w];for(int i=0;i<h;i++){for(int j=0;j<w;j++){ret[i,j]=ReadInt();}}return ret;}public static long[,]ReadLongTable(long h,long w){Tokens=null;long[,]ret=new long[h,w];for(int i=0;i<h;i++){for(int j=0;j<w;j++){ret[i,j]=ReadLong();}}return ret;}public static char[,]ReadCharTable(int h,int w){Tokens=null;char[,]res=new char[h,w];for(int i=0;i<h;i++){string s=ReadString();for(int j=0;j<w;j++){res[i,j]=s[j];}}return res;}private static string[]Tokens;private static int Pointer;private static string Next(){if(Tokens==null||Tokens.Length<=Pointer){Tokens=Console.ReadLine().Split(' ');Pointer=0;}return Tokens[Pointer++];}}public static class Util{public static readonly long INF=(long)1e17;public readonly static long MOD=(long)1e9+7;public readonly static int[]DXY4={0,1,0,-1,0};public readonly static int[]DXY8={1,1,0,1,-1,0,-1,-1,1};public static void DontAutoFlush(){if(Console.IsOutputRedirected)return;var sw=new System.IO.StreamWriter(Console.OpenStandardOutput()){AutoFlush=false};Console.SetOut(sw);}public static void Flush(){Console.Out.Flush();}public static T[]Sort<T>(T[]array){Array.Sort<T>(array);return array;}public static T[]SortDecend<T>(T[]array){Array.Sort<T>(array);Array.Reverse(array);return array;}public static void Swap<T>(ref T a,ref T b){T _a=a;a=b;b=_a;}public static long GCD(long a,long b){while(b!=0){long _a=a;a=b;b=_a%b;}return a;}public static long LCM(long a,long b){if(a==0||b==0)return 0;return a*b/GCD(a,b);}public static void ChMax(ref long a,long b){if(a<b)a=b;}public static void ChMin(ref long a,long b){if(a>b)a=b;}public static void ChMax(ref int a,int b){if(a<b)a=b;}public static void ChMin(ref int a,int b){if(a>b)a=b;}public static void FillArray<T>(T[]array,T value){int max=array.Length;for(int i=0;i<max;i++){array[i]=value;}}public static void FillArray<T>(T[,]array,T value){int max0=array.GetLength(0);int max1=array.GetLength(1);for(int i=0;i<max0;i++){for(int j=0;j<max1;j++){array[i,j]=value;}}}public static void FillArray<T>(T[,,]array,T value){int max0=array.GetLength(0);int max1=array.GetLength(1);int max2=array.GetLength(2);for(int i=0;i<max0;i++){for(int j=0;j<max1;j++){for(int k=0;k<max2;k++){array[i,j,k]=value;}}}}public static long[]Accumulate(long[]array){long[]acc=new long[array.Length+1];for(int i=0;i<array.Length;i++){acc[i+1]=acc[i]+array[i];}return acc;}public static double[]Accumulate(double[]array){double[]acc=new double[array.Length+1];for(int i=0;i<array.Length;i++){acc[i+1]=acc[i]+array[i];}return acc;}}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'static'
4 | using static System.Math;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'static'
5 | using static _20200413.abc055_b.Cin;
| ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'static'
6 | using static _20200413.abc055_b.Util;
| ^~~~~~
a.cc:7:14: error: '_20200413' does not name a type
7 | using Pair = _20200413.abc055_b.VTuple<long, long>;
| ^~~~~~~~~
a.cc:14:20: error: expected '{' before '.' token
14 | namespace _20200413.abc055_b
| ^
a.cc:14:20: error: expected unqualified-id before '.' token
|
s045827187 | p03796 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;
using static _20200413.abc055_b.Cin;
using static _20200413.abc055_b.Util;
using Pair = _20200413.abc055_b.VTuple<long, long>;
/// <summary>
/// abc055
/// B - Training Camp
/// https://atcoder.jp/contests/abc055/tasks/abc055_b
/// </summary>
namespace _20200413.abc055_b
{
public class Program
{
public static void Main(string[] args)
{
int N = ri;
Mint power = 1;
for (int i = 1; i <= N; i++)
{
power *= i;
}
Console.WriteLine(power);
}
}
/// <summary>
/// 競プロライブラリ
/// https://github.com/ha2ne2/ABC/tree/master/Lib
/// </summary>
public struct Mint:System.IComparable<Mint>,System.IEquatable<Mint>{public static readonly long MOD=(long)1e9+7;public long Value;public Mint(long val){Value=val%MOD;if(Value<0)Value+=MOD;}private static Mint Ctor(long val){return new Mint(){Value=val};}public static Mint operator+(Mint a,Mint b){long res=a.Value+b.Value;if(res>MOD)res-=MOD;return Ctor(res);}public static Mint operator-(Mint a,Mint b){long res=a.Value-b.Value;if(res<0)res+=MOD;return Ctor(res);}public static Mint operator*(Mint a,Mint b){long res=a.Value*b.Value;if(res>MOD)res%=MOD;return Ctor(res);}public static Mint operator/(Mint a,Mint b){return a*Inv(b);}public override bool Equals(object obj){return obj is Mint&&Value==((Mint)obj).Value;}public override int GetHashCode(){return Value.GetHashCode();}public override string ToString(){return Value.ToString();}public static implicit operator Mint(long a){return new Mint(a);}public static explicit operator long(Mint a){return a.Value;}public static Mint Pow(Mint a,long n){if(n==0)return new Mint(1);Mint b=Pow(a,n>>1);b*=b;if((n&1)==1)b*=a;return b;}public static Mint Inv(Mint n){long a=n.Value;long b=MOD;long x=1;long u=0;while(b!=0){long k=a/b;long _x=u;u=x-k*u;x=_x;long _a=a;a=b;b=_a-(k*b);}return new Mint(x);}public bool Equals(Mint other){return Value==other.Value;}public int CompareTo(Mint other){return Comparer<long>.Default.Compare(Value,other.Value);}}public class HashMap<K,V>:System.Collections.Generic.Dictionary<K,V>{private V DefaultValue;private static Func<V>CreateInstance=System.Linq.Expressions.Expression.Lambda<Func<V>>(System.Linq.Expressions.Expression.New(typeof(V))).Compile();public HashMap(){}public HashMap(V defaultValue){DefaultValue=defaultValue;}new public V this[K i]{get{V v;if(TryGetValue(i,out v)){return v;}else{return base[i]=DefaultValue!=null?DefaultValue:CreateInstance();}}set{base[i]=value;}}}public struct VTuple<T1,T2>:System.IComparable<VTuple<T1,T2>>,System.IEquatable<VTuple<T1,T2>>{public T1 Item1;public T2 Item2;public T1 First{get{return Item1;}}public T2 Second{get{return Item2;}}public VTuple(T1 item1,T2 item2){Item1=item1;Item2=item2;}public override bool Equals(object obj){return obj is VTuple<T1,T2>&&Equals((VTuple<T1,T2>)obj);}public override int GetHashCode(){int h1=Item1!=null?Item1.GetHashCode():0;int h2=Item2!=null?Item2.GetHashCode():0;return HashHelpers.CombineHashCodes(h1,h2);}public override string ToString(){return"("+Item1?.ToString()+", "+Item2?.ToString()+")";}public bool Equals(VTuple<T1,T2>other){return EqualityComparer<T1>.Default.Equals(Item1,other.Item1)&&EqualityComparer<T2>.Default.Equals(Item2,other.Item2);}public int CompareTo(VTuple<T1,T2>other){int c=Comparer<T1>.Default.Compare(Item1,other.Item1);if(c!=0)return c;return Comparer<T2>.Default.Compare(Item2,other.Item2);}}public struct VTuple3<T1,T2,T3>:System.IComparable<VTuple3<T1,T2,T3>>,System.IEquatable<VTuple3<T1,T2,T3>>{public T1 Item1;public T2 Item2;public T3 Item3;public VTuple3(T1 item1,T2 item2,T3 item3){Item1=item1;Item2=item2;Item3=item3;}public override bool Equals(object obj){return obj is VTuple3<T1,T2,T3>&&Equals((VTuple3<T1,T2,T3>)obj);}public override int GetHashCode(){int h1=Item1!=null?Item1.GetHashCode():0;int h2=Item2!=null?Item2.GetHashCode():0;int h3=Item3!=null?Item3.GetHashCode():0;return HashHelpers.CombineHashCodes(h1,h2,h3);}public override string ToString(){return"("+Item1?.ToString()+", "+Item2?.ToString()+", "+Item3?.ToString()+")";}public bool Equals(VTuple3<T1,T2,T3>other){return EqualityComparer<T1>.Default.Equals(Item1,other.Item1)&&EqualityComparer<T2>.Default.Equals(Item2,other.Item2)&&EqualityComparer<T3>.Default.Equals(Item3,other.Item3);}public int CompareTo(VTuple3<T1,T2,T3>other){int c=Comparer<T1>.Default.Compare(Item1,other.Item1);if(c!=0)return c;c=Comparer<T2>.Default.Compare(Item2,other.Item2);if(c!=0)return c;return Comparer<T3>.Default.Compare(Item3,other.Item3);}}public struct VTuple4<T1,T2,T3,T4>:System.IComparable<VTuple4<T1,T2,T3,T4>>,System.IEquatable<VTuple4<T1,T2,T3,T4>>{public T1 Item1;public T2 Item2;public T3 Item3;public T4 Item4;public VTuple4(T1 item1,T2 item2,T3 item3,T4 item4){Item1=item1;Item2=item2;Item3=item3;Item4=item4;}public override bool Equals(object obj){return obj is VTuple4<T1,T2,T3,T4>&&Equals((VTuple4<T1,T2,T3,T4>)obj);}public override int GetHashCode(){int h1=Item1!=null?Item1.GetHashCode():0;int h2=Item2!=null?Item2.GetHashCode():0;int h3=Item3!=null?Item3.GetHashCode():0;int h4=Item3!=null?Item4.GetHashCode():0;return HashHelpers.CombineHashCodes(h1,h2,h3,h4);}public override string ToString(){return"("+Item1?.ToString()+", "+Item2?.ToString()+", "+Item3?.ToString()+", "+Item4?.ToString()+")";}public bool Equals(VTuple4<T1,T2,T3,T4>other){return EqualityComparer<T1>.Default.Equals(Item1,other.Item1)&&EqualityComparer<T2>.Default.Equals(Item2,other.Item2)&&EqualityComparer<T3>.Default.Equals(Item3,other.Item3)&&EqualityComparer<T4>.Default.Equals(Item4,other.Item4);}public int CompareTo(VTuple4<T1,T2,T3,T4>other){int c=Comparer<T1>.Default.Compare(Item1,other.Item1);if(c!=0)return c;c=Comparer<T2>.Default.Compare(Item2,other.Item2);if(c!=0)return c;c=Comparer<T3>.Default.Compare(Item3,other.Item3);if(c!=0)return c;return Comparer<T4>.Default.Compare(Item4,other.Item4);}}public static class HashHelpers{public static readonly int RandomSeed=new System.Random().Next(int.MinValue,int.MaxValue);public static int Combine(int h1,int h2){uint rol5=((uint)h1<<5)|((uint)h1>>27);return((int)rol5+h1)^h2;}public static int CombineHashCodes(int h1,int h2){return Combine(Combine(RandomSeed,h1),h2);}public static int CombineHashCodes(int h1,int h2,int h3){return Combine(CombineHashCodes(h1,h2),h3);}public static int CombineHashCodes(int h1,int h2,int h3,int h4){return Combine(CombineHashCodes(h1,h2,h3),h4);}}public static class Cin{public static int ri{get{return ReadInt();}}public static int[]ria{get{return ReadIntArray();}}public static long rl{get{return ReadLong();}}public static long[]rla{get{return ReadLongArray();}}public static double rd{get{return ReadDouble();}}public static double[]rda{get{return ReadDoubleArray();}}public static string rs{get{return ReadString();}}public static string[]rsa{get{return ReadStringArray();}}public static int ReadInt(){return int.Parse(Next());}public static long ReadLong(){return long.Parse(Next());}public static double ReadDouble(){return double.Parse(Next());}public static string ReadString(){return Next();}public static int[]ReadIntArray(){Tokens=null;return Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);}public static long[]ReadLongArray(){Tokens=null;return Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);}public static double[]ReadDoubleArray(){Tokens=null;return Array.ConvertAll(Console.ReadLine().Split(' '),double.Parse);}public static string[]ReadStringArray(){Tokens=null;return Console.ReadLine().Split(' ');}public static void ReadCol(out long[]a,long N){a=new long[N];for(int i=0;i<N;i++){a[i]=ReadLong();}}public static void ReadCols(out long[]a,out long[]b,long N){a=new long[N];b=new long[N];for(int i=0;i<N;i++){a[i]=ReadLong();b[i]=ReadLong();}}public static void ReadCols(out long[]a,out long[]b,out long[]c,long N){a=new long[N];b=new long[N];c=new long[N];for(int i=0;i<N;i++){a[i]=ReadLong();b[i]=ReadLong();c[i]=ReadLong();}}public static int[,]ReadIntTable(int h,int w){Tokens=null;int[,]ret=new int[h,w];for(int i=0;i<h;i++){for(int j=0;j<w;j++){ret[i,j]=ReadInt();}}return ret;}public static long[,]ReadLongTable(long h,long w){Tokens=null;long[,]ret=new long[h,w];for(int i=0;i<h;i++){for(int j=0;j<w;j++){ret[i,j]=ReadLong();}}return ret;}public static char[,]ReadCharTable(int h,int w){Tokens=null;char[,]res=new char[h,w];for(int i=0;i<h;i++){string s=ReadString();for(int j=0;j<w;j++){res[i,j]=s[j];}}return res;}private static string[]Tokens;private static int Pointer;private static string Next(){if(Tokens==null||Tokens.Length<=Pointer){Tokens=Console.ReadLine().Split(' ');Pointer=0;}return Tokens[Pointer++];}}public static class Util{public static readonly long INF=(long)1e17;public readonly static long MOD=(long)1e9+7;public readonly static int[]DXY4={0,1,0,-1,0};public readonly static int[]DXY8={1,1,0,1,-1,0,-1,-1,1};public static void DontAutoFlush(){if(Console.IsOutputRedirected)return;var sw=new System.IO.StreamWriter(Console.OpenStandardOutput()){AutoFlush=false};Console.SetOut(sw);}public static void Flush(){Console.Out.Flush();}public static T[]Sort<T>(T[]array){Array.Sort<T>(array);return array;}public static T[]SortDecend<T>(T[]array){Array.Sort<T>(array);Array.Reverse(array);return array;}public static void Swap<T>(ref T a,ref T b){T _a=a;a=b;b=_a;}public static long GCD(long a,long b){while(b!=0){long _a=a;a=b;b=_a%b;}return a;}public static long LCM(long a,long b){if(a==0||b==0)return 0;return a*b/GCD(a,b);}public static void ChMax(ref long a,long b){if(a<b)a=b;}public static void ChMin(ref long a,long b){if(a>b)a=b;}public static void ChMax(ref int a,int b){if(a<b)a=b;}public static void ChMin(ref int a,int b){if(a>b)a=b;}public static void FillArray<T>(T[]array,T value){int max=array.Length;for(int i=0;i<max;i++){array[i]=value;}}public static void FillArray<T>(T[,]array,T value){int max0=array.GetLength(0);int max1=array.GetLength(1);for(int i=0;i<max0;i++){for(int j=0;j<max1;j++){array[i,j]=value;}}}public static void FillArray<T>(T[,,]array,T value){int max0=array.GetLength(0);int max1=array.GetLength(1);int max2=array.GetLength(2);for(int i=0;i<max0;i++){for(int j=0;j<max1;j++){for(int k=0;k<max2;k++){array[i,j,k]=value;}}}}public static long[]Accumulate(long[]array){long[]acc=new long[array.Length+1];for(int i=0;i<array.Length;i++){acc[i+1]=acc[i]+array[i];}return acc;}public static double[]Accumulate(double[]array){double[]acc=new double[array.Length+1];for(int i=0;i<array.Length;i++){acc[i+1]=acc[i]+array[i];}return acc;}}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'static'
4 | using static System.Math;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'static'
5 | using static _20200413.abc055_b.Cin;
| ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'static'
6 | using static _20200413.abc055_b.Util;
| ^~~~~~
a.cc:7:14: error: '_20200413' does not name a type
7 | using Pair = _20200413.abc055_b.VTuple<long, long>;
| ^~~~~~~~~
a.cc:14:20: error: expected '{' before '.' token
14 | namespace _20200413.abc055_b
| ^
a.cc:14:20: error: expected unqualified-id before '.' token
|
s505408166 | p03796 | C++ | import math
N = int(input())
print(math.factorial(N) % (10**9+7)) | 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'
|
s773164391 | p03796 | C++ | # frozen_string_literal: true
n = gets.to_i
tmp = 1
1.upto(n) do |i|
tmp *= i
tmp %= (10**9 + 7)
end
puts tmp | a.cc:1:3: error: invalid preprocessing directive #frozen_string_literal
1 | # frozen_string_literal: true
| ^~~~~~~~~~~~~~~~~~~~~
a.cc:3:1: error: 'n' does not name a type
3 | n = gets.to_i
| ^
|
s082265670 | p03796 | C++ | import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *
def lcm(x, y):
return (x * y) // math.gcd(x, y)
if __name__ == '__main__':
n =int(input())
ans =1
for i in range(1,n):
ans = ans *i
ans = ans % (10**9 +7)
print(ans)
| a.cc:17:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
17 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s255091381 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)
const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
ll N,ans=1;
cin >> N;
for (ll i = 0; i < N; i++) {
ans*=(i+1);
ans=ans%MOD
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:22:16: error: expected ';' before '}' token
22 | ans=ans%MOD
| ^
| ;
23 | }
| ~
|
s782303551 | p03796 | C++ | #include <iostream>
#include <sstream>
#include <iterator>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#define YESNO(x) x ? printf("YES") : printf("NO")
#define YesNo(x) x ? printf("Yes") : printf("No")
using namespace std;
//ABC055B - Training Camp
//give up
int Main() {
static const char EMPTY = '.';
static const char BLACK = '#';
int N;
long ans = 1;
long div = (int)pow(10, 9) + 7;
cin >> N;
int i;
for (i = 1;i <= N;i++) {
ans *= i;
ans %= div;
}
ans %= div;
cout << ans;
return 0;
}
int main()
{
Main();
return 0;
} | a.cc: In function 'int Main()':
a.cc:21:25: error: 'pow' was not declared in this scope
21 | long div = (int)pow(10, 9) + 7;
| ^~~
|
s351258802 | p03796 | C++ | #include <iostream>
#include <sstream>
#include <iterator>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#define YESNO(x) x ? printf("YES") : printf("NO")
#define YesNo(x) x ? printf("Yes") : printf("No")
using namespace std;
//ABC055B - Training Camp
int Main() {
static const char EMPTY = '.';
static const char BLACK = '#';
int N;
long long ans = 1;
long long div = (int)pow(10, 9) + 7;
cin >> N;
int i;
for (i = 1;i <= N;i++) {
ans *= i;
ans %= div;
}
ans %= div;
cout << ans;
return 0;
}
int main()
{
Main();
return 0;
} | a.cc: In function 'int Main()':
a.cc:20:30: error: 'pow' was not declared in this scope
20 | long long div = (int)pow(10, 9) + 7;
| ^~~
|
s694460422 | p03796 | C++ | #include<bits/stdc++.h>
const int MOD=1e9+7;
using namespace std;
int main(){
int n;
cin >> n;
ll ans=1;
for(int i=1;i<=n;i++){
ans*=i;
ans%=MOD;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
7 | ll ans=1;
| ^~
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
9 | ans*=i;
| ^~~
| abs
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | cout << ans << endl;
| ^~~
| abs
|
s815553084 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
typedef long long ll;
//isPrime
//modpow modinv
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1) res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
long long modinv(long long a,long long mod){
return modpow(a,mod-2,mod);
}
long long int modfact(long long int n,long long int mod){
if(n){
return n*modfact(n-1,mod)%mod;
}else{
return 1;
}
}
int main() {
cout << fixed << setprecision(10);
ll n;
cin >> n;
cout << modfact(n,mod) << endl;
} | a.cc: In function 'int main()':
a.cc:36:21: error: 'mod' was not declared in this scope; did you mean 'modf'?
36 | cout << modfact(n,mod) << endl;
| ^~~
| modf
|
s033351697 | p03796 | C | #include <stdio.h>
int main(){
int x,ans=0;
scanf("%d",&x);
for(int i=1;i<=x;i++){
ans=(ans * i)%(1000000000+7)
}
printf("%d",ans);
} | main.c: In function 'main':
main.c:6:33: error: expected ';' before '}' token
6 | ans=(ans * i)%(1000000000+7)
| ^
| ;
7 | }
| ~
|
s666699586 | p03796 | C++ | #include <iostream>
const int M = 1e9 + 7;
int solve(int N) {
long long ans = 1;
for (int i = 1; i <= N; ++i) {
ans = ans * i;
if (ans % M)
ans = ans % M;
assert(ans != 0);
}
ans = ans % M;
return ans;
}
void test() {
assert(solve(3) == 6);
assert(solve(10) == 3628800);
assert(solve(100000) == 457992974);
std::cout << "done" << std::endl;
}
int main() {
int N;
std::cin >> N;
// test();
std::cout << solve(N) << std::endl;
}
| a.cc: In function 'int solve(int)':
a.cc:11:5: error: 'assert' was not declared in this scope
11 | assert(ans != 0);
| ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
1 | #include <iostream>
+++ |+#include <cassert>
2 |
a.cc: In function 'void test()':
a.cc:18:3: error: 'assert' was not declared in this scope
18 | assert(solve(3) == 6);
| ^~~~~~
a.cc:18:3: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
|
s729302890 | p03796 | C++ | import math
n = int(input())
print(math.factorial(n) % (10**9 + 7))
| 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'
|
s806148084 | p03796 | C++ |
#include <bits/stdc++.h>
using namespace std;
int main(){
int64_t n;
cin>>n;
int64_t p= 1;
for (int i = 1; i <= n; i++){
p=p*i%(10000000007);
cout<<p<<endl;
} | a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
11 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s540227658 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
long long int pow=1;
for(i=1;i<=n;i++)
{
pow*=i;
}
cout<<pow;
} | a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
8 | for(i=1;i<=n;i++)
| ^
|
s208295996 | p03796 | C++ | #include <iostream>
#include <cstdint>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
int N;
cin >> N;
int mod = 10e9 + 7;
int64_t p = 1;
for (i = 1; i <= N; ++i) p = p * i % mod;
cout << p << endl;
}
| a.cc: In function 'int main()':
a.cc:10:18: warning: overflow in conversion from 'double' to 'int' changes value from '1.0000000007e+10' to '2147483647' [-Woverflow]
10 | int mod = 10e9 + 7;
| ~~~~~^~~
a.cc:12:8: error: 'i' was not declared in this scope
12 | for (i = 1; i <= N; ++i) p = p * i % mod;
| ^
|
s002729101 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int64_t power = 1;
for(int i = 1; i <= N; i++){
power *= i;
power = power%1000000007
}
cout << power << endl;
}
| a.cc: In function 'int main()':
a.cc:10:29: error: expected ';' before '}' token
10 | power = power%1000000007
| ^
| ;
11 | }
| ~
|
s165888858 | p03796 | C++ | #include <bits.stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int64_t power;
for(int i = 1; i <= N; i++){
power *= i;
}
cout << power%1000000007 << endl;
} | a.cc:1:10: fatal error: bits.stdc++.h: No such file or directory
1 | #include <bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s671692552 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
unsigned GetDigit(int num){
int digit=0;
while(num!=0){
num /= 10;
digit++;
}
return digit;
}
int main() {
int N;
int ans = 1;
cin >> N;
for(int i=1;i<=N;i++)
ans = ans*i;
cout << ans << endl;
if(GetDigit(ans)>=9){
cout << ans%1000000007 << endl;
}else{
cout << ans << endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
unsigned GetDigit(int num){
int digit=0;
while(num!=0){
num /= 10;
digit++;
}
return digit;
}
int main() {
int N;
int ans = 1;
cin >> N;
for(int i=1;i<=N;i++)
ans = ans*i;
if(GetDigit(ans)>=9){
cout << ans%1000000007 << endl;
}else{
cout << ans << endl;
}
return 0;
} | a.cc:32:10: error: redefinition of 'unsigned int GetDigit(int)'
32 | unsigned GetDigit(int num){
| ^~~~~~~~
a.cc:4:10: note: 'unsigned int GetDigit(int)' previously defined here
4 | unsigned GetDigit(int num){
| ^~~~~~~~
a.cc:41:5: error: redefinition of 'int main()'
41 | int main() {
| ^~~~
a.cc:13:5: note: 'int main()' previously defined here
13 | int main() {
| ^~~~
|
s984303867 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int N,ans;
ans = 1;
for(long long int i = 1; i < N+1; i++){
ans *= i;
}
cout << ans % (pow(10,9) + 7);
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:17: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
13 | cout << ans % (pow(10,9) + 7);
| ~~~ ^ ~~~~~~~~~~~~~~~
| | |
| long long int __gnu_cxx::__promote<double>::__type {aka double}
|
s937405244 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
//入力
int N;
cin >> N;
//計算
int64_t ans=1;
for(int i=0;i<N;i++){
ans*=(i+1);
ans%=(pow(10,9)+7);
}
//出力
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:14:12: error: invalid operands of types 'int64_t' {aka 'long int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
14 | ans%=(pow(10,9)+7);
| ~~~^~~~~~~~~~~~~~~
a.cc:14:12: note: in evaluation of 'operator%=(int64_t {aka long int}, __gnu_cxx::__promote<double>::__type {aka double})'
|
s401864701 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int kaijou(int n){
if(n==1)return 1;
return n*kaijou(n-1);
}
int main(){
long long power = 1,x;
int n;
cin >> n;
x = powl(10,9)+7;
long long a = kaijou(n);
cout << a(int) % x(int) << endl;
}
| a.cc: In function 'int main()':
a.cc:16:13: error: expected primary-expression before 'int'
16 | cout << a(int) % x(int) << endl;
| ^~~
a.cc:16:16: error: 'a' cannot be used as a function
16 | cout << a(int) % x(int) << endl;
| ^
a.cc:16:22: error: expected primary-expression before 'int'
16 | cout << a(int) % x(int) << endl;
| ^~~
a.cc:16:25: error: 'x' cannot be used as a function
16 | cout << a(int) % x(int) << endl;
| ^
|
s131152191 | p03796 | C++ | #include <iostream>
using namespace std;
int main(void) {
int i;
cin >> i;
double power = 1;
for (int a=1; a<=i; i++) {
power = i * power % 1000000007;
}
cout << power << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:23: error: invalid operands of types 'double' and 'int' to binary 'operator%'
10 | power = i * power % 1000000007;
| ~~~~~~~~~ ^ ~~~~~~~~~~
| | |
| double int
|
s855874406 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
int power = 1;
for (i=1;i<=N;++i){
power = (power*i) % (10^9 + 7);
}
cout << power;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:8: error: 'i' was not declared in this scope
6 | for (i=1;i<=N;++i){
| ^
|
s869285760 | p03796 | C | #include <iostream>
using namespace std;
int main() {
long long int n, i, p = 1, M = 1000000007;
cin>>n;
for (i = 1; i <= n; i++)
p = (p * i) % M;
cout<<p;
return 0;
} | main.c:1:14: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s792207975 | p03796 | C | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
const unsigned int M=1000000007;
unsigned long long r=1;
int n;
cin>>n;
for( int i=1;i<=n;i++){
r=(r*i)%M;
}
cout<<r<<endl;
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s303441851 | p03796 | C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
long long int fact(long long int x);
int main()
{ long long int k,s;
long long int n;
scanf("%lld",&n);
k=fact(n);
s=s%(pow(10,9)+7);
printf("%lld",s);
return 0;
}
long long int fact(long long int x)
{ if(x==0 || x==1)
return 1;
else
return x*fact(x-1);
} | main.c: In function 'main':
main.c:10:4: error: invalid operands to binary % (have 'long long int' and 'double')
10 | s=s%(pow(10,9)+7);
| ^~~~~~~~~~~~~~
| |
| double
|
s639562580 | p03796 | C | #include<stdi.h>
int main()
{
int i;
long n;
scanf("%lld",&n);
i=0;
while(i>=n)
{
ans*=i;
}
printf("%ld",ans%(1000000000+7));
} | main.c:1:9: fatal error: stdi.h: No such file or directory
1 | #include<stdi.h>
| ^~~~~~~~
compilation terminated.
|
s429136677 | p03796 | C | #include <stdio.h>
#include <stdlib.h>
long long int(long long int x);
int main()
{ long long int k,s;
long long int n;
scanf("%lld",&n);
k=fact(n);
s=s%(pow(10,9)+7);
printf("%lld",s);
return 0;
}
long long int(long long int x)
{ if(x==0 || x==1)
return 1;
else
return x*fact(x-1);
} | main.c:3:15: error: expected identifier or '(' before 'long'
3 | long long int(long long int x);
| ^~~~
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'fact' [-Wimplicit-function-declaration]
8 | k=fact(n);
| ^~~~
main.c:9:6: error: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
9 | s=s%(pow(10,9)+7);
| ^~~
main.c:3:1: note: include '<math.h>' or provide a declaration of 'pow'
2 | #include <stdlib.h>
+++ |+#include <math.h>
3 | long long int(long long int x);
main.c:9:6: warning: incompatible implicit declaration of built-in function 'pow' [-Wbuiltin-declaration-mismatch]
9 | s=s%(pow(10,9)+7);
| ^~~
main.c:9:6: note: include '<math.h>' or provide a declaration of 'pow'
main.c:9:4: error: invalid operands to binary % (have 'long long int' and 'double')
9 | s=s%(pow(10,9)+7);
| ^~~~~~~~~~~~~~
| |
| double
main.c: At top level:
main.c:13:15: error: expected identifier or '(' before 'long'
13 | long long int(long long int x)
| ^~~~
|
s250200654 | p03796 | C | #include<stdio.h>
int main()
{
int i;
long long n;
scanf("%d",&n);
i=0;
while(i>=n)
{
ans*=i;
}
printf("%d",ans%1000000000+7);
} | main.c: In function 'main':
main.c:10:1: error: 'ans' undeclared (first use in this function)
10 | ans*=i;
| ^~~
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
|
s773409047 | p03796 | C | #include<stdi.h>
int main()
{
int i;
long long n;
scanf("%d",&n);
i=0;
while(i>=n)
{
ans*=i;
}
printf("%d",ans%(1000000000+7));
} | main.c:1:9: fatal error: stdi.h: No such file or directory
1 | #include<stdi.h>
| ^~~~~~~~
compilation terminated.
|
s979565617 | p03796 | C | #include <stdio.h>
#include <stdlib.h>
long long int(long long int x);
int main()
{
long long int n;
scanf("%lld",&n);
printf("%lld",fact(n));
return 0;
}
long long int(long long int x)
{ if(x==0 || x==1)
return 1;
else
return n*fact(n-1);
} | main.c:3:15: error: expected identifier or '(' before 'long'
3 | long long int(long long int x);
| ^~~~
main.c: In function 'main':
main.c:9:15: error: implicit declaration of function 'fact' [-Wimplicit-function-declaration]
9 | printf("%lld",fact(n));
| ^~~~
main.c: At top level:
main.c:12:15: error: expected identifier or '(' before 'long'
12 | long long int(long long int x)
| ^~~~
|
s585467092 | p03796 | C++ | #include<iostream>
using namespace std;
#forでも階乗かける
long fact(int n)
{
if(n==1) return 1;
return (n * fact(n-1)) % (1000000007);
}
int main()
{
int n;
cin >> n;
long ans;
ans = fact(n);
cout << ans << endl;
} | a.cc:4:2: error: invalid preprocessing directive #for\U00003067\U00003082\U0000968e\U00004e57\U0000304b\U00003051\U0000308b
4 | #forでも階乗かける
| ^~~~~~~~~~~~~~~~~
|
s188689275 | p03796 | C++ | #include<bits/stdc++.h>
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,l,n) for(int i=(l);i<(n);i++)
int mod=1000000007;
int main(){
ll power=1;
int N;
cin >> N;
rep(i,N){
power*=i+1;
power/=mod;
}
cout << power << endl;
return 0;
} | a.cc:3:9: error: 'vector' does not name a type
3 | typedef vector<int> vi;
| ^~~~~~
a.cc:4:9: error: 'vector' does not name a type
4 | typedef vector<vector<int>> vvi;
| ^~~~~~
|
s539566139 | p03796 | Java | import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans = 1;
for(int i = 1;i <= n;i++){
ans *= i;
}
ans = ans % (1000000000 + 7);
System.out.println(ans);
}
| Main.java:15: error: reached end of file while parsing
}
^
1 error
|
s056079583 | p03796 | Java | import java.util.*;
import java.lang.Math;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long ans = 1;
for(int i = 1;i <= n;i++){
ans *= i;
}
ans = ans % (Math.pow(10,9) + 7);
System.out.println(ans);
}
} | Main.java:13: error: incompatible types: possible lossy conversion from double to long
ans = ans % (Math.pow(10,9) + 7);
^
1 error
|
s428933317 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;cin >> n;
mod=1000000007;
long long ans=1;
for (int i=1;i<n+1;i++) {
ans *= i;
ans %= mod;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'mod' was not declared in this scope; did you mean 'modf'?
6 | mod=1000000007;
| ^~~
| modf
|
s104985175 | p03796 | C++ | #include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
long long N, answer = 1;
cin >> N;
for (long long i = 1; i <= N; ++i) {
answer = (answer * i) % mod;
}
cout << answer << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:33: error: 'mod' was not declared in this scope; did you mean 'modf'?
13 | answer = (answer * i) % mod;
| ^~~
| modf
|
s311126085 | p03796 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
int res=1;
for(int i=1;i<=n;i++){
res*=i;
res%=(pow(10,9)+7);
}
cout<<res<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:12: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
10 | res%=(pow(10,9)+7);
| ~~~^~~~~~~~~~~~~~~
a.cc:10:12: note: in evaluation of 'operator%=(int, __gnu_cxx::__promote<double>::__type {aka double})'
|
s396870382 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
int main(){
long long int n,ans;
cin >> n;
ans = 0;
rep(i,n){ans = ans*n;}
cout << ans%(pow(10,9)+7) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:14: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
10 | cout << ans%(pow(10,9)+7) << endl;
| ~~~^~~~~~~~~~~~~~
| | |
| long long int __gnu_cxx::__promote<double>::__type {aka double}
|
s521955767 | p03796 | C | #include<stdio.h>
int main(){
int n,i,
long ans=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
ans=ans*i%1000000007;
}
printf("%ld",ans);
return 0;
} | main.c: In function 'main':
main.c:4:5: error: expected identifier or '(' before 'long'
4 | long ans=0;
| ^~~~
main.c:7:9: error: 'ans' undeclared (first use in this function)
7 | ans=ans*i%1000000007;
| ^~~
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
|
s241245191 | p03796 | C | #include<stdio.h>
int main(){
int n,i,
long ans=0;
scanf("%d",&n);
for(i=1;i<=n;i++){
ans=ans*i%1000000007;
}
printf("%d",ans);
return 0;
} | main.c: In function 'main':
main.c:4:5: error: expected identifier or '(' before 'long'
4 | long ans=0;
| ^~~~
main.c:7:9: error: 'ans' undeclared (first use in this function)
7 | ans=ans*i%1000000007;
| ^~~
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
|
s345798767 | p03796 | C++ | #include<iostream>
int main(){
int t,ans=1;std::cin>>t;for(int i=0;i<t;i++) ans=ans*t%(1e9+7);std::cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:3:55: error: invalid operands of types 'int' and 'double' to binary 'operator%'
3 | int t,ans=1;std::cin>>t;for(int i=0;i<t;i++) ans=ans*t%(1e9+7);std::cout<<ans<<endl;
| ~~~~~^~~~~~~~
| | |
| int double
a.cc:3:80: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
3 | int t,ans=1;std::cin>>t;for(int i=0;i<t;i++) ans=ans*t%(1e9+7);std::cout<<ans<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s218310232 | p03796 | C++ | #include <iostream>
using namespace std;
int main() {
long long a,x=1;
cin>>a;
for(int i=0;i<a;i++)
x*=i;
x%=1e9+7;
}
cout<<x%1e9+7<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:10: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
10 | x%=1e9+7;
| ~^~~~~~~
a.cc:10:10: note: in evaluation of 'operator%=(long long int, double)'
a.cc: At global scope:
a.cc:12:17: error: 'cout' does not name a type
12 | cout<<x%1e9+7<<endl;
| ^~~~
a.cc:14:9: error: expected unqualified-id before 'return'
14 | return 0;
| ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s855309498 | p03796 | C++ | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>//常用文件头,不知道的可以记一下
using namespace std;
long long n,m=1,k;//设a初始值为1,不然在之后的阶乘中0乘什么数都等于0
int main()
{
cin>>n
for (long long i=1;i<=n;i++)//这里定义i要用long long,不然用int的话就会......
{
k=i%1000000007;//计算出现在阶乘到多少了
m*=k;//阶乘
}
cout<<m;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before 'for'
9 | cin>>n
| ^
| ;
10 | for (long long i=1;i<=n;i++)//这里定义i要用long long,不然用int的话就会......
| ~~~
a.cc:10:24: error: 'i' was not declared in this scope
10 | for (long long i=1;i<=n;i++)//这里定义i要用long long,不然用int的话就会......
| ^
|
s316397467 | p03796 | C++ | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>//常用文件头,不知道的可以记一下
using namespace std;
long long n,m=1,k;//设a初始值为1,不然在之后的阶乘中0乘什么数都等于0
int main()
{
cin>>n
for(long long i=1;i<=n;i++)//这里定义i要用long long,不然用int的话就会......
{
k=i%1000000007;//计算出现在阶乘到多少了
m*=k;//阶乘
}
cout<<m;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before 'for'
9 | cin>>n
| ^
| ;
10 | for(long long i=1;i<=n;i++)//这里定义i要用long long,不然用int的话就会......
| ~~~
a.cc:10:23: error: 'i' was not declared in this scope
10 | for(long long i=1;i<=n;i++)//这里定义i要用long long,不然用int的话就会......
| ^
|
s934633177 | p03796 | C++ | ```cpp
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>//常用文件头,不知道的可以记一下
using namespace std;
long long n,m=1,k;//设a初始值为1,不然在之后的阶乘中0乘什么数都等于0
int main()
{
cin>>n
for(long long i=1;i<=n;i++)//这里定义i要用long long,不然用int的话就会......
{
k=i%1000000007;//计算出现在阶乘到多少了
m*=k;//阶乘
}
cout<<m;
return 0;
}
```
| a.cc:1:1: error: stray '`' in program
1 | ```cpp
| ^
a.cc:1:2: error: stray '`' in program
1 | ```cpp
| ^
a.cc:1:3: error: stray '`' in program
1 | ```cpp
| ^
a.cc:19:1: error: stray '`' in program
19 | ```
| ^
a.cc:19:2: error: stray '`' in program
19 | ```
| ^
a.cc:19:3: error: stray '`' in program
19 | ```
| ^
a.cc:1:4: error: 'cpp' does not name a type
1 | ```cpp
| ^~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:3:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/stdio.h:34,
from /usr/include/c++/14/cstdio:42,
from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/ |
s910990262 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int a;
cin >> a;
int b =1;
for (int i =1 ;i<=a; i++){
b *= i;
}
cout << b%1000000007 << endl;
| a.cc: In function 'int main()':
a.cc:13:32: error: expected '}' at end of input
13 | cout << b%1000000007 << endl;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s399714352 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int a;
cin a;
int b =1;
for (int i =1 ;i<=a; i++){
b *= i;
}
cout << b%1000000007 << endl;
| a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'a'
6 | cin a;
| ^~
| ;
a.cc:13:32: error: expected '}' at end of input
13 | cout << b%1000000007 << endl;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s490906120 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int a;
cin a;
int b =1;
for (int i =1 i<=a i++){
b *= i;
}
cout << b%1000000007 << endl;
| a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'a'
6 | cin a;
| ^~
| ;
a.cc:10:16: error: expected ';' before 'i'
10 | for (int i =1 i<=a i++){
| ^~
| ;
a.cc:10:21: error: expected ';' before 'i'
10 | for (int i =1 i<=a i++){
| ^~
| ;
a.cc:13:32: error: expected '}' at end of input
13 | cout << b%1000000007 << endl;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s166041972 | p03796 | C | #include<stdio.h>
int main(void){
int a,b,n;
int c=1;
scanf("%d",&n);
for(a=1;a<=n;a++){
c*=a;
b=c;
println("%d\n",b%(10**9+7));
}
return 0;
} | main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'println'; did you mean 'printf'? [-Wimplicit-function-declaration]
9 | println("%d\n",b%(10**9+7));
| ^~~~~~~
| printf
main.c:9:24: error: invalid type argument of unary '*' (have 'int')
9 | println("%d\n",b%(10**9+7));
| ^~
|
s317841666 | p03796 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1e9 + 7;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if(a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
void print(const std::vector<int> &v) {
std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
std::cout << std::endl;
}
int main() {
ll N;
cin >> N;
ll power = 1;
for(int i = 1; i <= N; i++) {
power *= i;
power % = MOD;
}
cout << power % MOD << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:40:17: error: expected primary-expression before '=' token
40 | power % = MOD;
| ^
|
s348240857 | p03796 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 10e9 + 7;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
if(a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
void print(const std::vector<int> &v) {
std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
std::cout << std::endl;
}
int main() {
ll N;
cin >> N;
cout << N % MOD << endl;
return 0;
} | a.cc:12:26: warning: overflow in conversion from 'double' to 'int' changes value from '1.0000000007e+10' to '2147483647' [-Woverflow]
12 | constexpr int MOD = 10e9 + 7;
| ~~~~~^~~
a.cc:12:28: error: overflow in constant expression [-fpermissive]
12 | constexpr int MOD = 10e9 + 7;
| ^
a.cc:12:28: error: overflow in constant expression [-fpermissive]
|
s272442796 | p03796 | Java | import java.util.*;
import java.util.Arrays;
import java.lang.Math;
import java.math.BigInteger;
public class B055 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
BigInteger sum = BigInteger.ONE;
BigInteger kekka = BigInteger.ZERO;
for(int i = 1 ; i <= N; i++){
sum = sum.multiply(new BigInteger(String.valueOf(i)));
}
int b = 1000000007;
kekka = sum.remainder(BigInteger.valueOf(b));
System.out.println(kekka);
}
} | Main.java:6: error: class B055 is public, should be declared in a file named B055.java
public class B055 {
^
1 error
|
s648706666 | p03796 | C++ | #include<iostream>
using namespace std;
int main()
{
int a;
int result = 1;
int mod = 1000000007;
cin >> a;
for(int i=1; i <=a; a++;){
result *= a%mod;
}
cout << result << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:32: error: expected ')' before ';' token
9 | for(int i=1; i <=a; a++;){
| ~ ^
| )
a.cc:9:33: error: expected primary-expression before ')' token
9 | for(int i=1; i <=a; a++;){
| ^
|
s767327676 | p03796 | C++ | #include<iostream>
using namespace std;
int main()
{
int a;
int result = 1;
int mod = 1000000007;
cin >> a;
for(int i=1; i <=a; a++;){
result *= a%mod;
}
cout << reuslt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:32: error: expected ')' before ';' token
9 | for(int i=1; i <=a; a++;){
| ~ ^
| )
a.cc:9:33: error: expected primary-expression before ')' token
9 | for(int i=1; i <=a; a++;){
| ^
a.cc:12:17: error: 'reuslt' was not declared in this scope; did you mean 'result'?
12 | cout << reuslt << endl;
| ^~~~~~
| result
|
s088604557 | p03796 | C++ | #include<iostream>
using namespace std;
int main()
{
int a;
int result = 1;
int mod = 1000000007;
cin >> a;
for(int i=1; i <=a a++;){
result *= a%mod;
}
cout << reuslt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:27: error: expected ';' before 'a'
9 | for(int i=1; i <=a a++;){
| ^~
| ;
a.cc:9:31: error: expected ')' before ';' token
9 | for(int i=1; i <=a a++;){
| ~ ^
| )
a.cc:9:32: error: expected primary-expression before ')' token
9 | for(int i=1; i <=a a++;){
| ^
a.cc:12:17: error: 'reuslt' was not declared in this scope; did you mean 'result'?
12 | cout << reuslt << endl;
| ^~~~~~
| result
|
s280922944 | p03796 | C++ | #include<iostream>
using namespace std;
int main()
{
int a;
int result = 1;
int mod = 1000000007;
cin >> a;
for(int i=1; i <=a a++){
result *= a%mod;
}
cout << reuslt << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:27: error: expected ';' before 'a'
9 | for(int i=1; i <=a a++){
| ^~
| ;
a.cc:12:17: error: 'reuslt' was not declared in this scope; did you mean 'result'?
12 | cout << reuslt << endl;
| ^~~~~~
| result
|
s220831405 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
const int big = 1000000007
int main() {
int N;
cin >> N;
int power = 1;
for (int i = 1; i <= N; i++){
power = (power % big) * i;
}
cout << power % big << endl;
}
| a.cc:8:1: error: expected ',' or ';' before 'int'
8 | int main() {
| ^~~
|
s166933913 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
long long p = 1;
for(int i=0; i<n; i++){
p = p * (i+1);
}
p = p % (pow(10, 9)+7);
cout << p << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:9: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
12 | p = p % (pow(10, 9)+7);
| ~ ^ ~~~~~~~~~~~~~~
| | |
| long long int __gnu_cxx::__promote<double>::__type {aka double}
|
s717360266 | p03796 | C++ | #include <iostream>
using namespace std;
long long int D = 1000000007;
int main(){
long long int I;
cin >> I
long long int ans = 1LL;
for(int i = 1; i <= I; i++){
ans = (ans * i) % D;
}
cout << ans;
} | a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before 'long'
9 | cin >> I
| ^
| ;
10 | long long int ans = 1LL;
| ~~~~
a.cc:12:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | ans = (ans * i) % D;
| ^~~
| abs
a.cc:14:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
14 | cout << ans;
| ^~~
| abs
|
s243416875 | p03796 | C++ | #include<iostream>
using namespace std;
int main(){
int n,ans=1;
cin >>n;
for(int i=1;i<=n;i++){
ans = ans%1e9+7;
ans *= i;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types 'int' and 'double' to binary 'operator%'
7 | ans = ans%1e9+7;
| ~~~^~~~
| | |
| int double
|
s157378072 | p03796 | C++ | #include<iostream>
using namespace std;
int main(){
long long int n,ans=1;
cin >>n;
for(int i=1;i<=n;i++){
ans = ans%1e9+7;
ans *= i;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
7 | ans = ans%1e9+7;
| ~~~^~~~
| | |
| | double
| long long int
|
s107996081 | p03796 | C++ | #include<iostream>
using namespace std;
int main(){
long long int n,ans=1;
cin >>n;
for(int i=1;i<=n;i++){
ans %= 1e9+7;
ans *= i;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:11: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
7 | ans %= 1e9+7;
| ~~~~^~~~~~~~
a.cc:7:11: note: in evaluation of 'operator%=(long long int, double)'
|
s828574656 | p03796 | C | #include<stdio.h>
int main(void){
int n;
long int power = 1;
scanf("%d",&n);
for(int i = 1;i<=n;i++){
power *= i;
power %= 1000000007;
}
printf("%lld",power)
return 0;
}
| main.c: In function 'main':
main.c:10:23: error: expected ';' before 'return'
10 | printf("%lld",power)
| ^
| ;
11 | return 0;
| ~~~~~~
|
s777760100 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
long long n,cnt=1;
int main(){
scanf("%lld",&n);
for(int i=1;i<=n;i++){
cnt*=i;
cnt%=(1e9+7);
}
printf("%lld",cnt);
} | a.cc: In function 'int main()':
a.cc:8:20: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
8 | cnt%=(1e9+7);
| ~~~^~~~~~~~~
a.cc:8:20: note: in evaluation of 'operator%=(long long int, double)'
|
s797386125 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int sum=1;
for(;0<n;n--){
sum *=n;
sum%=pow(10,9)+7;
}
cout<<sum<<endl;
} | a.cc: In function 'int main()':
a.cc:10:8: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
10 | sum%=pow(10,9)+7;
| ~~~^~~~~~~~~~~~~
a.cc:10:8: note: in evaluation of 'operator%=(int, __gnu_cxx::__promote<double>::__type {aka double})'
|
s516735824 | p03796 | C++ | 100000 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 100000
| ^~~~~~
|
s368511078 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t S;
cin>>S;
int64_t G=1;
for(int i=0; i<S; i++){
G*=(i+1);
}
cout<<Gmod(1E9+711)<<endl;
}
| a.cc: In function 'int main()':
a.cc:11:7: error: 'Gmod' was not declared in this scope; did you mean 'fmod'?
11 | cout<<Gmod(1E9+711)<<endl;
| ^~~~
| fmod
|
s286444582 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t S;
cin>>S;
int64_t G=1;
for(int i=0; i<S; i++){
G*=(i+1);
}
cout<<G%(1E9+711)<<endl;
}
| a.cc: In function 'int main()':
a.cc:11:8: error: invalid operands of types 'int64_t' {aka 'long int'} and 'double' to binary 'operator%'
11 | cout<<G%(1E9+711)<<endl;
| ~^~~~~~~~~~
| | |
| | double
| int64_t {aka long int}
|
s921203141 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t S;
cin>>S;
int64_t G=1;
for(int i=0; i<S; i++){
G*=(i+1);
}
cout<<G%(1E9+7)<<endl;
}
| a.cc: In function 'int main()':
a.cc:11:8: error: invalid operands of types 'int64_t' {aka 'long int'} and 'double' to binary 'operator%'
11 | cout<<G%(1E9+7)<<endl;
| ~^~~~~~~~
| | |
| | double
| int64_t {aka long int}
|
s079463793 | p03796 | C++ | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>
using namespace std;
int main() {
int n,power;
for(int i = 0; i < n;i++){
power = power * i;
}
cout << power % (pow(10,9) + 7) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:23: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
18 | cout << power % (pow(10,9) + 7) << endl;
| ~~~~~ ^ ~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
|
s287385148 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n,ans;
ans=1;
cin >> n;
for(int i=1;i<=n;i++){
ans*=i;
}
cout<<ans%pow(10,9)+7<<endl;
}
| a.cc: In function 'int main()':
a.cc:11:12: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
11 | cout<<ans%pow(10,9)+7<<endl;
| ~~~^~~~~~~~~~
| | |
| | __gnu_cxx::__promote<double>::__type {aka double}
| long long int
|
s174512615 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int n,ans;
ans=1;
cin >> n;
for(int i=1;i<=n;i++){
ans*=i;
}
cout<<ans%(pow(10,9)+7)<<endl;
}
| a.cc: In function 'int main()':
a.cc:11:12: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
11 | cout<<ans%(pow(10,9)+7)<<endl;
| ~~~^~~~~~~~~~~~~~
| | |
| long long int __gnu_cxx::__promote<double>::__type {aka double}
|
s196008588 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,ans;
ans=1;
cin >> n;
for(int i=1;i<=n;i++){
ans*=i;
}
cout<<ans<<endl;
} | a.cc:8:3: error: extended character is not valid in an identifier
8 | for(int i=1;i<=n;i++){
| ^
a.cc: In function 'int main()':
a.cc:8:9: error: expected primary-expression before 'int'
8 | for(int i=1;i<=n;i++){
| ^~~
a.cc:8:17: error: 'i' was not declared in this scope
8 | for(int i=1;i<=n;i++){
| ^
|
s563650430 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int128_t S;
cin>>S;
int128_t G=1;
for(int i=0; i<S; i++){
G*=(i+1);
}
cout<<G%(10*10*10*10*10*10*10*10*10+7)<<endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
5 | int128_t S;
| ^~~~~~~~
| int8_t
a.cc:6:8: error: 'S' was not declared in this scope
6 | cin>>S;
| ^
a.cc:7:11: error: expected ';' before 'G'
7 | int128_t G=1;
| ^~
| ;
a.cc:9:5: error: 'G' was not declared in this scope
9 | G*=(i+1);
| ^
a.cc:11:7: error: 'G' was not declared in this scope
11 | cout<<G%(10*10*10*10*10*10*10*10*10+7)<<endl;
| ^
|
s835897746 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t S;
cin>>S;
int128_t G=1;
for(int i=0; i<S; i++){
G*=(i+1);
}
cout<<G%(10*10*10*10*10*10*10*10*10+7)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'int128_t' was not declared in this scope; did you mean 'int8_t'?
7 | int128_t G=1;
| ^~~~~~~~
| int8_t
a.cc:9:5: error: 'G' was not declared in this scope
9 | G*=(i+1);
| ^
a.cc:11:7: error: 'G' was not declared in this scope
11 | cout<<G%(10*10*10*10*10*10*10*10*10+7)<<endl;
| ^
|
s836111184 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t S;
cin>>S;
int64_t G=1;
for(int i=0; i<S; i++)
G*=i;
}
cout<<G%(10*10*10*10*10*10*10*10*10+7)<<endl;
} | a.cc:11:1: error: 'cout' does not name a type
11 | cout<<G%(10*10*10*10*10*10*10*10*10+7)<<endl;
| ^~~~
a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s006506431 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define MOD 10e9+7
int main(){
int N; cin >> N;
long long int power = 1;
for(int i=1;i<N+1;i++){
power = (power*i) % MOD;
}
cout << power;
} | a.cc: In function 'int main()':
a.cc:10:27: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
10 | power = (power*i) % MOD;
| ~~~~~~~~~ ^
| |
| long long int
|
s449414376 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define MOD 10e9+7
int main(){
int N; cin >> N;
long long int power = 1;
for(int i=1;i<N+1;i++){
power = (power*i) %
}
cout << power;
} | a.cc: In function 'int main()':
a.cc:11:5: error: expected primary-expression before '}' token
11 | }
| ^
|
s883490310 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define MOD 10e9+7
int main(){
int N; cin >> N;
power = 1;
for(int i=1;i<N+1;i++){
power = (power*i) %
}
cout << power;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'power' was not declared in this scope
8 | power = 1;
| ^~~~~
a.cc:11:5: error: expected primary-expression before '}' token
11 | }
| ^
|
s813184465 | p03796 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = 1;
int k = (int)Math.pow(10,9)+7
for(int i = 1;i <= n;i++){
m = (m*i)%k;
}
System.out.println(m);
}
} | Main.java:7: error: ';' expected
int k = (int)Math.pow(10,9)+7
^
1 error
|
s895188215 | p03796 | Java | import java.io.InputStream;
import java.util.Scanner;
/**
* AtCoder Beginner Contest 055<br>
* B - Training Camp<br>
* <br>
* <a href="https://atcoder.jp/contests/abc055/tasks/abc055_b">AtCoderへのリンク</a><br>
*/
public class Main {
/**
* エントリポイント
*/
public static void main(String[] args) {
// 入力
int N = input(System.in);
// 演算
long power = proc(N);
// 出力
System.out.println(power);
}
/**
* 入力値を取得
*/
static int input(InputStream in) {
int result = 0;
try (Scanner sc = new Scanner(in)) {
result = sc.nextInt();
}
return result;
}
/**
* 演算を行う
*/
static double proc(int N) {
long power = 1;
// TODO:実装する
double d = 1;
for( long i = 1; i<=N ; ++i )
{
d = d * N;
}
return d % ( 10^9 + 7 );
}
} | Main.java:19: error: incompatible types: possible lossy conversion from double to long
long power = proc(N);
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.