submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s056638948 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t n;
cin>>n;
int64_t count=1;
for(int i=1;i<=n;i++){
count=(i*count)%1000000007;
}
int64_t ans=count
cout<<ans;
}
| a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'cout'
12 | cout<<ans;
| ^~~~
|
s724811055 | p03796 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
long long ans=1,n;
int main(){
scanf("%lld",&n);
for(long long i=1;i<=n;i++) ans=ans*i%1000000007;
printf("%lld",a);
return 0;
} | a.cc: In function 'int main()':
a.cc:11:19: error: 'a' was not declared in this scope
11 | printf("%lld",a);
| ^
|
s686907536 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N,i;
double d;
long long int a,c;
cin>>N;
a=1;
for(i=1;i<=N;i++){
a=a*i;
}
d=1e9;
c= a % (d+7);
cout<<c;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
13 | c= a % (d+7);
| ~ ^ ~~~~~
| | |
| | double
| long long int
|
s399184931 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
long long ans = 1;
cin >> n;
for (int i = 1; i <= n; i++) {
ans = (i * ans) % 1000000007;
}
| a.cc: In function 'int main()':
a.cc:12:4: error: expected '}' at end of input
12 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s812889019 | p03796 | C++ | #include <iostream>
using namespace std;
int main() {
const int a = pow(10,9) + 7;
int n;
unsigned long long int ret=1;
cin >> n;
for (int i = 1; i <= n; i++) {
ret = ret*i%a;
}
cout << ret << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:23: error: 'pow' was not declared in this scope
5 | const int a = pow(10,9) + 7;
| ^~~
|
s151871844 | p03796 | C++ | #include <iostream>
using namespace std;
#define mod 1000000007
int main(){
int N;
cin >> N;
int ans = 1;
for(int i = 1; i <= N; i++){
ans *= i;
ans %= MOD;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:12: error: 'MOD' was not declared in this scope
11 | ans %= MOD;
| ^~~
|
s678400001 | p03796 | C++ | #include <iostream>
using namespace std;
define MOD 1000000007;
int main(){
int N;
cin >> N;
int ans = 1;
for(int i = 1; i <= N; i++){
ans *= i;
ans %= MOD;
}
cout << ans << endl;
} | a.cc:3:1: error: 'define' does not name a type
3 | define MOD 1000000007;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:11:12: error: 'MOD' was not declared in this scope
11 | ans %= MOD;
| ^~~
|
s872117633 | p03796 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
//#define MOD 1000000007 //S.size()
using namespace std;
typedef unsigned long long ll;
const long long mod = 10e9 + 7
int main(void){
int N;
cin >> N;
long long ans = 1;
for(long long i = 1; i <= N; i++){
ans *= i;
ans %= mod;
}
cout << ans << endl;
return 0;
}
| a.cc:8:1: error: expected ',' or ';' before 'int'
8 | int main(void){
| ^~~
|
s256088826 | p03796 | C | #include<stdio.h>
int main(){
double n,x,ans;
scanf("%lf", &n);
for(x=1; x<=n; x++){
sum=1;
sum=sum*x;
}
ans=sum%1000000007;
printf("%lf\n", ans);
return 0;
} | main.c: In function 'main':
main.c:6:5: error: 'sum' undeclared (first use in this function)
6 | sum=1;
| ^~~
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
|
s561114640 | p03796 | C++ | #include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
const int mod=100000007
int fact(int k){
int sum=1;
for (int i=1;i<=k;i++){
sum*=i;
sum%=mod;
}
return sum;
}
signed main(){
int a;
cin>>a;
cout<<fact(a);
} | a.cc:2:13: error: expected ',' or ';' before 'long'
2 | #define int long long
| ^~~~
a.cc:9:1: note: in expansion of macro 'int'
9 | int fact(int k){
| ^~~
a.cc: In function 'int main()':
a.cc:20:9: error: 'fact' was not declared in this scope
20 | cout<<fact(a);
| ^~~~
|
s534522276 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
int n;
cin>>n;
ll ans=1;
rep1(i,n){
ans=ans*i%((ll)pow(10,9)+7));
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:18:31: error: expected ';' before ')' token
18 | ans=ans*i%((ll)pow(10,9)+7));
| ^
| ;
|
s730556723 | p03796 | C++ | #include<iostream>
using namespace std;
#define MOD 1000000000 + 7
int main(){
int N;
cin >> N ;
functional(N,N);
}
//First rem must be N
int functional(int N, int rem){
int next = rem * N-1;
int reminder = next % MOD;
if(N - 1 == 1) return reminder;
else functional(N-1, reminder);
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'functional' was not declared in this scope
8 | functional(N,N);
| ^~~~~~~~~~
a.cc: In function 'int functional(int, int)':
a.cc:17:20: warning: control reaches end of non-void function [-Wreturn-type]
17 | else functional(N-1, reminder);
| ~~~~~~~~~~^~~~~~~~~~~~~~~
|
s305747340 | p03796 | C++ | // template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REP_AB(i, a, b) for (ll i = ll(a); i <= ll(b); ++i)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
#define REVERSE(v) reverse(ALL(v))
// true / false
#define BIN_SEARCH(v, a) binary_search(ALL(v), a)
// index
#define BIN_LEFT(v, a) (lower_bound(ALL(v), a) - v.begin())
#define BIN_RIGHT(v, a) (upper_bound(ALL(v), a) - v.begin())
#define BIN_INSERT(v, a) (v.insert(v.begin() + BIN_LEFT(v, a), a))
#define DEL(v, i) v.erase(v.begin() + i)
#define INSERT(v, i, a) v.insert(v.begin() + i, a)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a / gcd(a, b)) * b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// template end
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
ll n, ans = 1;
in >> n;
REP(i, n){
ans = ans * (i + 1) % MOD
}
out << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:41:5: error: expected ';' before '}' token
41 | }
| ^
|
s799160107 | p03796 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
using namespace std;
int main() {
int N;
cin >> N;
int power = 0;
for (int i = 1; i < N + 1; ++i)
{
power = (power * i) % int(pow(10.0, 9.0)) + 7;
}
cout << power
} | a.cc: In function 'int main()':
a.cc:18:18: error: expected ';' before '}' token
18 | cout << power
| ^
| ;
19 | }
| ~
|
s289833138 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<char,char> PCC;
typedef pair<ll,ll> PLL;
typedef pair<char,int> PCI;
typedef pair<int,char> PIC;
typedef pair<ll,int> PLI;
typedef pair<int,ll> PIL;
typedef pair<ll,char> PLC;
typedef pair<char,ll> PCL;
inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}
int main(void){
SPEEDUP
cout << setprecision(15);
int N;cin >> N;
ll ans = 1;
repp(i,1,N+1){
ans *= (ll)i;
ans %= 1e9+7;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:39:9: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
39 | ans %= 1e9+7;
| ~~~~^~~~~~~~
a.cc:39:9: note: in evaluation of 'operator%=(ll {aka long long int}, double)'
|
s476135971 | p03796 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1000000007
//S.size()
using namespace std;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;
typedef unsigned long long ll;
int main(void){
ll N; cin>>N;
ll num = 1;
for(ll i = 1; i <= N; i++)num = (num*i) % INF
cout<<num<<endl;
}
| a.cc: In function 'int main()':
a.cc:21:3: error: expected ';' before 'cout'
21 | cout<<num<<endl;
| ^~~~
|
s129512739 | p03796 | C | #include <stdio.h>
int main(){
int n,r=1;
for(scanf("%d",&n);n;n--)r=(r*n)%(1e9+7);
printf("%d",r);
return 0;
} | main.c: In function 'main':
main.c:4:35: error: invalid operands to binary % (have 'int' and 'double')
4 | for(scanf("%d",&n);n;n--)r=(r*n)%(1e9+7);
| ~~~~~^~~~~~~~
| | |
| int double
|
s075340781 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n;
double power=1;
for(int i=1;i<=n;i++){
power*=i;
}
cout<<power%(10e9+7)<<endl;
} | a.cc: In function 'int main()':
a.cc:10:14: error: invalid operands of types 'double' and 'double' to binary 'operator%'
10 | cout<<power%(10e9+7)<<endl;
| ~~~~~^~~~~~~~~
| | |
| double double
|
s744334530 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n;
long long power=1;
for(int i=1;i<=n;i++){
power*=i;
}
cout<<power%(10e9+7)<<endl;
} | a.cc: In function 'int main()':
a.cc:10:14: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
10 | cout<<power%(10e9+7)<<endl;
| ~~~~~^~~~~~~~~
| | |
| | double
| long long int
|
s312388913 | p03796 | C | #include<stdio.h>
int main(){
long long int ans=1,k;
scanf("%d",&k);
for(i=1;i<=k;i++){
ans*=i;
}
k%=((10e9)+7);
printf("%lld\n",k);
return 0;
}
| main.c: In function 'main':
main.c:8:7: error: 'i' undeclared (first use in this function)
8 | for(i=1;i<=k;i++){
| ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:4: error: invalid operands to binary % (have 'long long int' and 'double')
12 | k%=((10e9)+7);
| ^~~~~~~~~~~~
| |
| double
|
s558857608 | p03796 | C++ | iostream>
using namespace std;
int main(){
int N;
long long ans=1;
double res;
cin >> N;
for(int i=1; i<=N; i++){
ans=(ans*i)%1000000007;
}
cout << ans << endl;
}
| a.cc:1:1: error: 'iostream' does not name a type
1 | iostream>
| ^~~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
8 | cin >> N;
| ^~~
a.cc:14:5: error: 'cout' was not declared in this scope
14 | cout << ans << endl;
| ^~~~
a.cc:14:20: error: 'endl' was not declared in this scope
14 | cout << ans << endl;
| ^~~~
|
s607511829 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define INF 2e9
#define ll long long
int main(){
int n;
cin>>n;
int i;
int ans = 1;
if(i=1; i<=n; i++){
ans = (ans*i)%1000000007;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:17: error: expected ')' before ';' token
16 | if(i=1; i<=n; i++){
| ~ ^
| )
a.cc:16:22: error: expected ';' before ')' token
16 | if(i=1; i<=n; i++){
| ^
| ;
|
s648143233 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int n;cin>>n;
long long ret = 1;
for(int i = 1; n >= i; i++){
ret = (ret * i)%1000000007;
}
cout << ret << endl; | a.cc: In function 'int main()':
a.cc:9:23: error: expected '}' at end of input
9 | cout << ret << endl;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s978446250 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int n;cin>>n;
long long ret = 1;
for(int i = 1; n >= i; i++){
ret = (ret * i)%1000000007;
}
cout << endl; | a.cc: In function 'int main()':
a.cc:9:16: error: expected '}' at end of input
9 | cout << endl;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s985724956 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/
/*alias*/
#define F first
#define S second
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int
/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}
/*struct*/
struct aaa {
aaa() {
cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
};
}aaaaaaa;
/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right
#define int long long
//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//chcp 65001
signed main()
{
int n; cin >> n;
for(int i = 0, i_len = (int)n; i < i_len; ++i){
n*=i;
n%=1e9+7;
}
cout << n << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:59:18: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
59 | n%=1e9+7;
| ~^~~~~~~
a.cc:59:18: note: in evaluation of 'operator%=(long long int, double)'
|
s026903829 | p03796 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;
int mod = 10000007;
int ctoi(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
return 0;
}
char upper(char c){
return c-0x20;
}
char lower(char c){
return c+0x20;
}
int main() {
int n; cin >> n;
int p = 1;
rep(i,n){
p = (p*i)%mod
}
cout << p << endl;
} | a.cc: In function 'int main()':
a.cc:33:30: error: expected ';' before '}' token
33 | p = (p*i)%mod
| ^
| ;
34 | }
| ~
|
s468882603 | p03796 | C++ | #include<iostream>
using namespace std;
int main() {
int N;
cin >> N;
int power = 1;
for(int i = 1;i < N + 1;i++) {
power = power * i;
}
cout << power % 10 ^ 9 + 7 << endl;
} | a.cc: In function 'int main()':
a.cc:11:30: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
11 | cout << power % 10 ^ 9 + 7 << endl;
| ~~~~~~^~~~~~~
|
s651392321 | p03796 | C++ | #include<iostream>
using namespace std;
int main(){
int N;cin >> N; int ans = 1;
for(int i = 1; i <= N; i++){
ans *= i;
ans = a % 1000000007;}
cout << ans << endl;
return 0;}
| a.cc: In function 'int main()':
a.cc:9:12: error: 'a' was not declared in this scope
9 | ans = a % 1000000007;}
| ^
|
s305231065 | p03796 | C++ | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
int N;
cin >> N;
int X=1;
for (int i=0; i<N; i++) {
X *= (i+1);
}
cout << X % (pow(10,5)+7);
return 0
}
| a.cc: In function 'int main()':
a.cc:13:13: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
13 | cout << X % (pow(10,5)+7);
| ~ ^ ~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
a.cc:15:11: error: expected ';' before '}' token
15 | return 0
| ^
| ;
16 | }
| ~
|
s898506864 | p03796 | C++ | import math;print(math.factorial(int(input()))%(7+1e9)) | a.cc:1:1: error: 'import' does not name a type
1 | import math;print(math.factorial(int(input()))%(7+1e9))
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:1:18: error: expected constructor, destructor, or type conversion before '(' token
1 | import math;print(math.factorial(int(input()))%(7+1e9))
| ^
|
s239245928 | p03796 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
long long power=1;
int tnum;
cin>>tnum;
for (int i = 1; i <tnum+1 ; i++)
{
power=(power*i)%(long long(1e9+7));
}
cout<<power;
}
| a.cc: In function 'int main()':
a.cc:11:24: error: expected primary-expression before 'long'
11 | power=(power*i)%(long long(1e9+7));
| ^~~~
a.cc:11:24: error: expected ')' before 'long'
11 | power=(power*i)%(long long(1e9+7));
| ~^~~~
| )
|
s593388029 | p03796 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
long long power=1;
int tnum;
cin>>tnum;
for (int i = 1; i <tnum+1 ; i++)
{
power=(power*i)%(1e9+7);
}
cout<<power;
}
| a.cc: In function 'int main()':
a.cc:11:22: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
11 | power=(power*i)%(1e9+7);
| ~~~~~~~~~^~~~~~~~
| | |
| | double
| long long int
|
s677086085 | p03796 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
int power=1;
int tnum;
cin<<tnum;
for (int i = 1; i <tnum+1 ; i++)
{
power=power*tnum;
}
cout<<(power)/10^9+7;
}
| a.cc: In function 'int main()':
a.cc:8:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | cin<<tnum;
| ~~~^~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:7: note: candidate: 'operator<<(int, int)' (built-in)
8 | cin<<tnum;
| ~~~^~~~~~
a.cc:8:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:8:4: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
8 | cin<<tnum;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:8:9: required from here
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:14:20: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
14 | cout<<(power)/10^9+7;
| ~~~~~~~~~~~~~~~~^~~~
| | |
| | int
| std::basic_ostream<char>
a.cc:14:20: note: candidate: 'operator^(int, int)' (built-in)
14 | cout<<(power)/10^9+7;
| ~~~~~~~~~~~~~~~~^~~~
a.cc:14:20: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
/usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)'
146 | operator^(byte __l, byte __r) noexcept
| ^~~~~~~~
/us |
s824464163 | p03796 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
int power=1;
int tnum;
cin<<tnum;
for (int i = 1; i <tnum+1 ; i++)
{
power=power*tnum;
}
cout<<(power)/10^9+7;
}
| a.cc: In function 'int main()':
a.cc:8:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | cin<<tnum;
| ~~~^~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:7: note: candidate: 'operator<<(int, int)' (built-in)
8 | cin<<tnum;
| ~~~^~~~~~
a.cc:8:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:8:4: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
8 | cin<<tnum;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:8:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:8:9: required from here
8 | cin<<tnum;
| ^~~~
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:14:20: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
14 | cout<<(power)/10^9+7;
| ~~~~~~~~~~~~~~~~^~~~
| | |
| | int
| std::basic_ostream<char>
a.cc:14:20: note: candidate: 'operator^(int, int)' (built-in)
14 | cout<<(power)/10^9+7;
| ~~~~~~~~~~~~~~~~^~~~
a.cc:14:20: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
/usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)'
146 | operator^(byte __l, byte __r) noexcept
| ^~~~~~~~
/us |
s123404943 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
const unsigned int DIV_NUM = pow(10,9) + 7;
int main() {
int N;
cin >> N;
unsigned int ans = 1;
for (int i = 1; i < N + 1; ++i) {
ans = ans* i % DIV_NUM
}
cout << ans << '\n';
} | a.cc: In function 'int main()':
a.cc:10:27: error: expected ';' before '}' token
10 | ans = ans* i % DIV_NUM
| ^
| ;
11 | }
| ~
|
s541543866 | p03796 | C++ | #include <iostream>
using namespace std;
const unsigned int DIV_NUM = pow(10,9) + 7;
int main() {
int N;
cin >> N;
unsigned int ans = 1;
for (int i = 1; i < N + 1; ++i) {
ans = ans* i % DIV_NUM
}
cout << ans << '\n';
} | a.cc:3:30: error: 'pow' was not declared in this scope
3 | const unsigned int DIV_NUM = pow(10,9) + 7;
| ^~~
a.cc: In function 'int main()':
a.cc:9:27: error: expected ';' before '}' token
9 | ans = ans* i % DIV_NUM
| ^
| ;
10 | }
| ~
|
s624040268 | p03796 | C++ | #include <iostream>
using namespace std;
const unsigned int DIV_NUM = pow(10,9) + 7;
int main() {
int N;
cin >> N;
unsigned int ans = 1;
for (i = 1; i < N + 1; ++i) {
ans = ans* i % DIV_NUM
}
cout << ans << '\n';
} | a.cc:3:30: error: 'pow' was not declared in this scope
3 | const unsigned int DIV_NUM = pow(10,9) + 7;
| ^~~
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
8 | for (i = 1; i < N + 1; ++i) {
| ^
|
s077434482 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ll n,ans=1;
cin>>n;
for(ll i=1;i<n+1;i++){
ans*=i;
ans%=1E9+7;
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:12: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
10 | ans%=1E9+7;
| ~~~^~~~~~~
a.cc:10:12: note: in evaluation of 'operator%=(ll {aka long long int}, double)'
|
s503175320 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
long long ans = 1;
for(int i = 0; i < N; i++){
ans = ans * ( 1 + i );
}
cout << ans % (pow(10, 9) + 7) << endl;
} | a.cc: In function 'int main()':
a.cc:15:13: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
15 | cout << ans % (pow(10, 9) + 7) << endl;
| ~~~ ^ ~~~~~~~~~~~~~~~~
| | |
| long long int __gnu_cxx::__promote<double>::__type {aka double}
|
s839296904 | p03796 | C++ | #include <iostream>
using namespace std;
int main()
{
long long int N, power;
power = 1;
cin >> N;
for (int i = 1; i <= N; i++)
{
power = (i * power) % ((int)pow(10, 9) + 7);
}
cout << power << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:45: error: 'pow' was not declared in this scope; did you mean 'power'?
15 | power = (i * power) % ((int)pow(10, 9) + 7);
| ^~~
| power
|
s737428519 | p03796 | Java | import java.util.Scanner;
public class Main{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
long n = scan.nextLong();
long power = 1;
for(int i = 1; i <= n; i++){
power *= i;
power %= 1000000007
}
System.out.println(power);
}
}
| Main.java:12: error: ';' expected
power %= 1000000007
^
1 error
|
s774226988 | p03796 | C | #include <stdio.h>
int main(void){
int n;
int counter;
double ans;
scanf("%d",&n);
ans=n;
for(counter=1;counter!=n;counter++){
ans=(ans*counter)%100000007;
}
printf("%lf",ans);
return 0;
} | main.c: In function 'main':
main.c:9:20: error: invalid operands to binary % (have 'double' and 'int')
9 | ans=(ans*counter)%100000007;
| ~~~~~~~~~~~~~^
| |
| double
|
s621775086 | p03796 | C | #include <stdio.h>
int main(void){
int n;
int counter;
double ans;
scanf("%d",&n);
ans=n;
for(counter=1;counter!=n;counter++){
ans=(ans*count)%100000007;
}
printf("%lf",ans);
return 0;
} | main.c: In function 'main':
main.c:9:12: error: 'count' undeclared (first use in this function); did you mean 'counter'?
9 | ans=(ans*count)%100000007;
| ^~~~~
| counter
main.c:9:12: note: each undeclared identifier is reported only once for each function it appears in
|
s443517836 | p03796 | C | #include <stdio.h>
int main(void){
int n;
int count;
double ans;
scanf("%d",&n);
ans=n;
for(counter=1;counter!=n;counter++){
ans=(ans*count)%100000007;
}
printf("%lf",ans);
return 0;
} | main.c: In function 'main':
main.c:8:7: error: 'counter' undeclared (first use in this function); did you mean 'count'?
8 | for(counter=1;counter!=n;counter++){
| ^~~~~~~
| count
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:18: error: invalid operands to binary % (have 'double' and 'int')
9 | ans=(ans*count)%100000007;
| ~~~~~~~~~~~^
| |
| double
|
s014204630 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
long long A = 1000000007
int main() {
int N; cin >> N;
long long pwr = 1;
for (int i = 1; i<=N; i++) {pwr *= i; pwr % A;}
cout << pwr << "\n";
}
| a.cc:5:1: error: expected ',' or ';' before 'int'
5 | int main() {
| ^~~
|
s424616312 | p03796 | C++ | def training_camp(N: int) -> int:
MOD = 10 ** 9 + 7
ret = 1
for n in range(N):
ret = (ret * (n + 1)) % MOD
return ret
if __name__ == "__main__":
N = int(input())
ans = training_camp(N)
print(ans)
| a.cc:1:1: error: 'def' does not name a type
1 | def training_camp(N: int) -> int:
| ^~~
|
s713853984 | p03796 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#define _CRT_SECURE_NO_WARNINGS
#define TLong long long
int main(int argc, char const *argv[])
{
TLong n;
TLong p = 1;
for (int i = 2; i <= n; ++i)
{
p = (p * i % 10e+9) + 7;
}
printf("%d\n", p);
return 0;
} | main.c: In function 'main':
main.c:16:28: error: invalid operands to binary % (have 'long long int' and 'double')
16 | p = (p * i % 10e+9) + 7;
| ~~~~~ ^
| |
| long long int
|
s386911566 | p03796 | C++ | #include<iostream>
using namespace std;
int main() {
int N;
cin >> N;
int power = 1;
for(int i = 0;i < N;i++) {
power = power * i;
}
cout << power % ( 10 ^ 9 + 7 ) << endl; | a.cc: In function 'int main()':
a.cc:12:42: error: expected '}' at end of input
12 | cout << power % ( 10 ^ 9 + 7 ) << endl;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s006605077 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int F = 1;
for (int i = 1; i =< N; i++) {
F = F * i % 1000000007;
}
cout << F << endl;
} | a.cc: In function 'int main()':
a.cc:8:22: error: expected primary-expression before '<' token
8 | for (int i = 1; i =< N; i++) {
| ^
|
s744614871 | p03796 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
long long p=1,b=1;
cin>>N;
for(int i=0;i<9;++i)b*=10;
for(int i=1;i<=N;++i){
p*=i%(b+7);
cout<<p<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:2: error: expected '}' at end of input
13 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s081175590 | p03796 | C++ | #include<iostream>
using namespace std;
int main(){
int N,ans=0;
int count=0;
long long p=1,b=1;
cin>>N;
for(int i=0;i<9;++i)b*=10;
for(int i=1;i<=N;++i){
p*=i;
if(p>=b+7){
ans+=p%(b+7);
p=1;count=1;
}
}
if(count)cout<<ans%(b+7)<<endl;
else count<<p%(b+7)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:28: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
18 | else count<<p%(b+7)<<endl;
| ~~~~~~~~~~~~~~^~~~~~
|
s756202957 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
long long mod=10e9+7;
long long tmp=1;
for(int i=1;i<=n;i++){
tmp=((tmp%mon)*i)%mod;
}
cout<<tmp%mod<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: 'mon' was not declared in this scope; did you mean 'mod'?
10 | tmp=((tmp%mon)*i)%mod;
| ^~~
| mod
|
s388851186 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
long long mod=10e9+7;
tmp=1;
for(int i=1;i<=n;i++){
tmp=(tmp*i)%mod;
}
cout<<tmp%mod<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:4: error: 'tmp' was not declared in this scope; did you mean 'tm'?
8 | tmp=1;
| ^~~
| tm
|
s566684369 | p03796 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int N, answ;
cin >> N;
answ = 1;
for(int i=0;i<N;i++){
answ*=((i+1)%(pow(10,9)+7));
}
cout << answ << endl;
}
| a.cc: In function 'int main()':
a.cc:15:23: error: 'pow' was not declared in this scope
15 | answ*=((i+1)%(pow(10,9)+7));
| ^~~
|
s171778608 | p03796 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int N, answ;
cin >> N;
answ = 1;
for(int i=0;i<N;i++){
answ*=((i+1)%(10**9+7));
}
cout << answ;
}
| a.cc: In function 'int main()':
a.cc:15:26: error: invalid type argument of unary '*' (have 'int')
15 | answ*=((i+1)%(10**9+7));
| ^~
|
s488834528 | p03796 | C++ | #include <iostream>
using namespace std;
int main() {
__int64 N, power = 1;
cin >> N;
for (int i = 1; i <= N; i++) {
power = (power * i) % 1000000007;
}
cout << power << endl;
} | a.cc: In function 'int main()':
a.cc:5:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
5 | __int64 N, power = 1;
| ^~~~~~~
| __int64_t
a.cc:6:16: error: 'N' was not declared in this scope
6 | cin >> N;
| ^
a.cc:8:17: error: 'power' was not declared in this scope
8 | power = (power * i) % 1000000007;
| ^~~~~
a.cc:10:17: error: 'power' was not declared in this scope
10 | cout << power << endl;
| ^~~~~
|
s652728714 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int answer = 1;
for (int i = 1; i <= N; i++) {
answer = answer * i % (pow(10, 9.0) + 7));
}
cout << answer << endl;
}
| a.cc: In function 'int main()':
a.cc:9:25: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
9 | answer = answer * i % (pow(10, 9.0) + 7));
| ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
|
s608760879 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int answer = 1;
for (int i = 1, i <= N; i++) {
answer = answer * i % (pow(10,9) + 7));
}
cout << answer << endl;
}
| a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '<=' token
8 | for (int i = 1, i <= N; i++) {
| ^~~
| ;
a.cc:8:21: error: expected primary-expression before '<=' token
8 | for (int i = 1, i <= N; i++) {
| ^~
a.cc:9:25: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
9 | answer = answer * i % (pow(10,9) + 7));
| ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
|
s622804339 | p03796 | C | #include<stdio.h>
int main(){
long long int n,ans;
scanf("%lld",&n);
for(long long int i = 2;i < n;i++){
ans *= i;
}
prinf("%lld",ans % 1000000007);
return 0;
} | main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
8 | prinf("%lld",ans % 1000000007);
| ^~~~~
| printf
|
s422673542 | p03796 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
int cs=pow(10,9)+7;
__int64 sum=1;
int i=1;
while(n--){
sum*=i;
sum%=cs;
i++;
}
cout<<sum%cs;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
8 | __int64 sum=1;
| ^~~~~~~
| __ynf64
a.cc:11:17: error: 'sum' was not declared in this scope
11 | sum*=i;
| ^~~
a.cc:15:15: error: 'sum' was not declared in this scope
15 | cout<<sum%cs;
| ^~~
|
s181921871 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
double product = 1.0;
double ans;
for(int i = 1; i <= a; ++i)
{
product *= i;
}
ans = fmod(product, pow(10, 9) + 7);
cout << ans << endl;
} | a.cc:7:15: error: extended character is not valid in an identifier
7 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:7:15: error: '\U00003000a' was not declared in this scope
7 | cin >> a;
| ^~~
|
s343098340 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
double product = 1.0;
double ans;
for(int i = 1; i <= a; ++i)
{
product *= 1;
}
ans = fmod(product, pow(10, 9) + 7);
cout << ans << endl;
} | a.cc:7:15: error: extended character is not valid in an identifier
7 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:7:15: error: '\U00003000a' was not declared in this scope
7 | cin >> a;
| ^~~
|
s389045301 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
double product = 1.0;
double ans;
for(int i = 1; i <= a; ++i)
{
product *= 1;
}
ans = fmod(product, pow(10, 9) + 7);
cout << ans << endl;
} | a.cc:7:15: error: extended character is not valid in an identifier
7 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:7:15: error: '\U00003000a' was not declared in this scope
7 | cin >> a;
| ^~~
|
s459547473 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
int product = 1;
int ans;
for(int i = 1; i <= a; ++i)
{
product *= 1;
}
ans = product % (pow(10.0, 9.0) + 7.0);
cout << ans << endl;
} | a.cc:7:15: error: extended character is not valid in an identifier
7 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:7:15: error: '\U00003000a' was not declared in this scope
7 | cin >> a;
| ^~~
a.cc:14:17: error: invalid operands of types 'int' and 'double' to binary 'operator%'
14 | ans = product % (pow(10.0, 9.0) + 7.0);
| ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
| | |
| int double
|
s161726206 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
int product = 1;
int ans;
for(int i = 1; i <= a; ++i)
{
product *= 1;
}
ans = product % (pow(10, 9) + 7);
cout << ans << endl;
} | a.cc:7:15: error: extended character is not valid in an identifier
7 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:7:15: error: '\U00003000a' was not declared in this scope
7 | cin >> a;
| ^~~
a.cc:14:17: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
14 | ans = product % (pow(10, 9) + 7);
| ~~~~~~~ ^ ~~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
|
s956059110 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
int product = 1;
int ans;
for(int i = 1; i <= a; ++i)
{
product *= 1;
}
ans = product % (pow(10, 9) + 7.0)
cout << ans << endl;
} | a.cc:7:15: error: extended character is not valid in an identifier
7 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:7:15: error: '\U00003000a' was not declared in this scope
7 | cin >> a;
| ^~~
a.cc:14:17: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
14 | ans = product % (pow(10, 9) + 7.0)
| ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
|
s483264231 | p03796 | C++ | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int a;
cin >> a;
int product = 1;
int ans;
for(int i = 1; i <= a; ++i)
{
product *= 1;
}
ans = product % (pow(10, 9) + 7)
cout << ans << endl;
} | a.cc:7:15: error: extended character is not valid in an identifier
7 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:7:15: error: '\U00003000a' was not declared in this scope
7 | cin >> a;
| ^~~
a.cc:14:17: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
14 | ans = product % (pow(10, 9) + 7)
| ~~~~~~~ ^ ~~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
|
s040871993 | p03796 | C++ | #include <iostream>
using namespace std;
int main() {
int a;
cin >> a;
int product = 1;
int ans;
for(int i = 1; i <= a; ++i)
{
product *= 1;
}
ans = product % (pow(10, 9) + 7)
cout << ans << endl;
} | a.cc:6:15: error: extended character is not valid in an identifier
6 | cin >> a;
| ^
a.cc: In function 'int main()':
a.cc:6:15: error: '\U00003000a' was not declared in this scope
6 | cin >> a;
| ^~~
a.cc:13:20: error: 'pow' was not declared in this scope
13 | ans = product % (pow(10, 9) + 7)
| ^~~
|
s946085661 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
long long a[114514];
a[1]=1;
for(int i=2;i<100000;i++){
a[i]=(a[i-1]*i))%1000000007;
}
cout<<a[n]<<endl;
} | a.cc: In function 'int main()':
a.cc:9:24: error: expected ';' before ')' token
9 | a[i]=(a[i-1]*i))%1000000007;
| ^
| ;
|
s492611680 | p03796 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
int main()
{
// 整数の入力
int N;
int result = 1;
cin >> N;
for (int i = 0; i < N; i++) {
result = 2*result;
}
cout << result % (pow(10, 9) + 7) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:18:24: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
18 | cout << result % (pow(10, 9) + 7) << endl;
| ~~~~~~ ^ ~~~~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__type {aka double}
|
s201514678 | p03796 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
int main()
{
// 整数の入力
int N;
int result = 1;
cin >> N;
for (int i = 0; i < N; i++) {
result = 2*resilt;
}
cout << result % (double(10, 9) + 7) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:20: error: 'resilt' was not declared in this scope; did you mean 'result'?
15 | result = 2*resilt;
| ^~~~~~
| result
a.cc:18:39: error: expression list treated as compound expression in functional cast [-fpermissive]
18 | cout << result % (double(10, 9) + 7) << endl;
| ^
a.cc:18:24: error: invalid operands of types 'int' and 'double' to binary 'operator%'
18 | cout << result % (double(10, 9) + 7) << endl;
| ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
| | |
| int double
|
s971228101 | p03796 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<math.h>
#include<algorithm>
#include<numeric>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<ULL> VULL;
class MYCP {
public:
//数値を区切って文字列にする
static string MakeString_LongLong(vector<long long> const& numbers, string const& str) {
if (numbers.size() == 0)return "";
string result = "" + to_string(numbers[0]);
for (long long i = 1; i < numbers.size(); i++) {
result += str;
result += to_string(numbers[i]);
}
return result;
}
//空白で区切る為のオーバーロード
static string MakeString_LongLong(vector<long long> const& numbers) {
if (numbers.size() == 0)return "";
string result = "" + to_string(numbers[0]);
for (long long i = 1; i < numbers.size(); i++) {
result += " ";
result += to_string(numbers[i]);
}
return result;
}
//文字列の配列を改行を挟んでまとめる
static string MakeString_VectorString(vector<string> const& str) {
string result = "";
for (long long i = 0; i < str.size(); i++) {
result += str[i] + "\n";
}
return result;
}
//文字列を必要な個数だけ読み取る
static vector<string> MyReadLineSplit(LL n) {
vector<string> str(n);
for (long long i = 0; i < n; i++) {
std::cin >> str[i];
}
return str;
}
//数値を必要な個数だけ読み取る
static vector<long long> ReadInts(long long number) {
vector<long long> a(number);
for (int i = 0; i < number; i++) {
std::cin >> a[i];
}
return a;
}
//渡された自然数が素数ならtureを返す
static bool PrimeCheck_Int(long long number) {
if (number < 2)return false;
for (ULL i = 2; i*i <= number; i++) {
if (number%i == 0)return false;
}
return true;
}
//渡された数値以下の素数表を作る
static vector<long long> MakePrimeList(long long n) {
vector<long long> list;
LL i, j, p;
bool flag;
for (i = 2; i <= n; i++) {
flag = true;
for (j = 0; j < list.size(); j++) {
if (!(list[j] * list[j] <= i))break;
if (i%list[j] == 0) {
flag = false;
break;
}
}
if (flag)list.push_back(i);
}
return list;
}
//文字列の分割
static vector<string> split(string const& str, char sep)
{
vector<std::string> v; // 分割結果を格納するベクター
auto first = str.begin(); // テキストの最初を指すイテレータ
while (first != str.end()) { // テキストが残っている間ループ
auto last = first; // 分割文字列末尾へのイテレータ
while (last != str.end() && *last != sep) // 末尾 or セパレータ文字まで進める
last++;
v.push_back(string(first, last)); // 分割文字を出力
if (last != str.end())
last++;
first = last; // 次の処理のためにイテレータを設定
}
return v;
}
//合計を求める
static LL Sum(vector<LL> a) {
LL i, sum = 0;
for (i = 0; i < a.size(); i++) {
sum += a[i];
}
return sum;
}
//小文字ならtrueを返す
static bool Komoji(char a) {
if (a >= 'a'&&a <= 'z')return true;
return false;
}
//大文字ならtrueを返す
static bool Oomoji(char a) {
if (a >= 'A'&&a <= 'Z')return true;
return false;
}
static LL GreatestCommonFactor(LL a, LL b) {
LL temp;
if (a < b) {
temp = b;
b = a;
a = temp;
}
while (true)
{
temp = a % b;
a = b;
b = temp;
if (b == 0)break;
}
return a;
}
static LL LeastCommonMultiple(LL a, LL b) {
return (a / GreatestCommonFactor(a, b))*b;
}
};
//累積和を求めるクラス
class Syakutori {
private:
vector<LL> list;
public:
void MakeArray(vector<LL> data) {
LL i;
list = data;
list.push_back(0);
list[0] = 0;
for (i = 1; i < list.size(); i++) {
list[i] = list[i - 1] + data[i - 1];
}
}
LL Sum(LL start, LL end) {
if (end < start) {
cout << "startがendより大きいです";
return 0;
}
if (start < 0 || end >= list.size()) {
cout << "範囲が異常";
return 0;
}
return list[end] - list[start];
}
};
string strnum = "0123456789";
string alpS = "abcdefghijklmnopqrstuvwxyz";
string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int sizealp = (int)(alpS.size());
int main(void) {
LL n;
cin >> n;
LL pw=1;
for (int i = 1; i <= n; i++) {
pw *= i;
}
cout << pw%(10e9+7) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:224:19: error: invalid operands of types 'LL' {aka 'long long int'} and 'double' to binary 'operator%'
224 | cout << pw%(10e9+7) << endl;
| ~~^~~~~~~~~
| | |
| | double
| LL {aka long long int}
|
s869101070 | p03796 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
int ene =1;
int mod = 1000000007
for (int i = 1; i<= N; i++){
ene*=i;
ene %=mod;
}
cout <<ene << endl;
}
| a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'for'
10 | for (int i = 1; i<= N; i++){
| ^~~
a.cc:10:19: error: 'i' was not declared in this scope
10 | for (int i = 1; i<= N; i++){
| ^
|
s616598062 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
int X=1;
cin >> N;
for (int i=0; i<N; ++i) X*=(i+1)%=1000000007;
cout << X << endl;
}
| a.cc: In function 'int main()':
a.cc:8:34: error: lvalue required as left operand of assignment
8 | for (int i=0; i<N; ++i) X*=(i+1)%=1000000007;
| ~~^~~
|
s575831858 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int N;
int X=1;
cin >> N:
for (int i=0; i<N; ++i) X*=(i+1)%=1000000007;
cout << X << endl;
}
| a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before ':' token
7 | cin >> N:
| ^
| ;
a.cc:8:19: error: 'i' was not declared in this scope
8 | for (int i=0; i<N; ++i) X*=(i+1)%=1000000007;
| ^
|
s197607334 | p03796 | C++ | #include <iostream>
using namespace std;
int main(){
int N,X;
int X=1;
cin >> N:
for (int i=0; i<N; ++i) X*=(i+1)%=1000000007;
cout << X << endl;
}
| a.cc: In function 'int main()':
a.cc:6:9: error: redeclaration of 'int X'
6 | int X=1;
| ^
a.cc:5:11: note: 'int X' previously declared here
5 | int N,X;
| ^
a.cc:7:13: error: expected ';' before ':' token
7 | cin >> N:
| ^
| ;
a.cc:8:19: error: 'i' was not declared in this scope
8 | for (int i=0; i<N; ++i) X*=(i+1)%=1000000007;
| ^
|
s555898850 | p03796 | C | #include<stdio.h>
int main(void)
{
int n = 0,ans = 1;
scanf("%d",&n);
for(int i = 1;i <= n;i++)
{
ans *= i;
if(ans >= 1000000007)
{
ans = ans % 1000000007
}
}
printf("%d",ans);
return 0;
}
| main.c: In function 'main':
main.c:12:29: error: expected ';' before '}' token
12 | ans = ans % 1000000007
| ^
| ;
13 | }
| ~
|
s613138026 | p03796 | C++ | #include<stdio.h>
int main(void)
{
int n = 0,ans = 1;
scanf("%d",&n);
for(int i = 1;i <= n;i++)
{
ans *= i;
if(ans >= 1000000007)
{
ans = ans % 1000000007
}
}
printf("%d",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:29: error: expected ';' before '}' token
12 | ans = ans % 1000000007
| ^
| ;
13 | }
| ~
|
s519174657 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
int main(){
int n;
ll ans = 1;
cin >> n;
for(int i=1;i<=n;i++){
ans = (ans * i) % MOD
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:11:3: error: expected ';' before '}' token
11 | }
| ^
|
s493860435 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
int main(){
int n;
ll ans = 1;
cin >> n;
for(int i=1;i<=n;i++){
ans = (and * i) % MOD
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:10:16: error: expected identifier before '*' token
10 | ans = (and * i) % MOD
| ^
|
s731748379 | p03796 | C++ | #include <iostream>
using namespace std;
int main()
{
cin >> N;
unsigned long long int power = 1;
for (int i = 1; i <= N; ++i) {
power *= i;
}
cout << power % (1000000007) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:10: error: 'N' was not declared in this scope
7 | cin >> N;
| ^
|
s552364435 | p03796 | C++ | #ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;
typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;
/*
__attribute__((constructor))
void initial()
{
cin.tie(NULL);
ios::sync_with_stdio(false);
}
*/
int main()
{
cin.tie(NULL);
ios::sync_with_stdio(false);
int A;
cin >> A;
int ori = 1;
for (int i = 1; i <= N; i++)
{
ori = (ori * i) % MOD;
}
cout << ori << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:38:30: error: 'N' was not declared in this scope
38 | for (int i = 1; i <= N; i++)
| ^
|
s372417519 | p03796 | C | #include<stdio.h>
long long int ans;
int N, i;
int MOD = 1000000007;
int main(){
scanf("%d\n", &N);
p=1;
for(i=2; i<N; ++i){
ans *= i;
ans %= MOD;
}
printf("%lld\n", ans);
}
| main.c: In function 'main':
main.c:7:3: error: 'p' undeclared (first use in this function)
7 | p=1;
| ^
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
|
s264079203 | p03796 | C | #include<stdio.h>
long long int ans;
int N, i;
int MOD = 1000000007;
int main(){
scanf("%d\n", &N);
p=1;
for(i=2; i<N; ++i){
ans *= i;
ans %= MOD;
}
printf("%d\n", ans);
}
| main.c: In function 'main':
main.c:7:3: error: 'p' undeclared (first use in this function)
7 | p=1;
| ^
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
|
s117358982 | p03796 | C++ | #include<bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define MOD (int)1e9+(int)7
#define INF 2147483647
typedef long long ll;
typedef unsigned long long ull;
//dark power
/#define int ll
//define Error、大抵は、セミコロン忘れとか、Defineは関係ない
/*
vector<int> d(100000);
vector<int> b(100000);
class UnionFind{
public:
UnionFind(signed n){rep(i,n){d[i]=i;b[i]=0;}}
signed find(signed x){
if(d[x]==x){
return x;
}else{
return d[x]=find(d[x]);
}
}
UnionFind(signed n){rep(i,n){d[i]=i;b[i]=0;}}
void unite(signed x,signed y){
x=find(x);
y=find(y);
if(x==y)return;
if(b[x]<b[y]){
d[x]=y;
}else{
d[y]=x;
if(b[x]==b[y])b[x]++;
}
}
bool same(signed x,signed y){return (find(x)==find(y));}
};
*/
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin>>n;
int sum=0;
rep(i,1,n+1)sum=(i*sum)%MOD;
cout<<sum<<endl;
return 0;
}
| a.cc:14:2: error: stray '#' in program
14 | /#define int ll
| ^
a.cc:14:1: error: expected unqualified-id before '/' token
14 | /#define int ll
| ^
|
s061029092 | p03796 | C++ | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define PI 3.14159265359
int main(){
iostream::sync_with_stdio(false);
int N;
long long ans = 1;
for(int i=1; i<=N: i++){
ans *= i;
ans %= 1000000007;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:36:18: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
36 | for(int i=1; i<=N: i++){
| ^
a.cc:36:22: error: found ':' in nested-name-specifier, expected '::'
36 | for(int i=1; i<=N: i++){
| ^
| ::
a.cc:36:21: error: 'N' is not a class, namespace, or enumeration
36 | for(int i=1; i<=N: i++){
| ^
a.cc:42:5: error: expected primary-expression before 'return'
42 | return 0;
| ^~~~~~
a.cc:40:25: error: expected ')' before 'return'
40 | cout << ans << endl;
| ^
| )
41 |
42 | return 0;
| ~~~~~~
a.cc:36:8: note: to match this '('
36 | for(int i=1; i<=N: i++){
| ^
|
s632828305 | p03796 | C++ | #include<iostream>
using namespace std;
int main() {
int n;
cin >> n;
_int64 power = 1;
for (int i = 1; i <= n; i++) {
power *= i;
if (power > 1000000007)
power = power % 1000000007;
}
cout << power << endl;
} | a.cc: In function 'int main()':
a.cc:7:9: error: '_int64' was not declared in this scope
7 | _int64 power = 1;
| ^~~~~~
a.cc:9:17: error: 'power' was not declared in this scope
9 | power *= i;
| ^~~~~
a.cc:13:17: error: 'power' was not declared in this scope
13 | cout << power << endl;
| ^~~~~
|
s079678149 | p03796 | Java | import java.util.Scanner;
public class training {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n;
long power = 1;
long t = (long)(Math.pow(10, 9) + 7);
n = sc.nextInt();
sc.close();
for(int i = 1; i <= n; ++i) {
power *= (i % t);
power %= t;
}
System.out.println(power);
}
}
| Main.java:3: error: class training is public, should be declared in a file named training.java
public class training {
^
1 error
|
s908527589 | p03796 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <stdio.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPL(i,f,n) for(int i=f, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin >> N;
ll ans = 1;
for (int i = 1; i <= N;i++) ans = ans*i%1000000007
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:22:59: error: expected ';' before 'cout'
22 | for (int i = 1; i <= N;i++) ans = ans*i%1000000007
| ^
| ;
23 | cout << ans << endl;
| ~~~~
|
s296590005 | p03796 | C | #include <stdio.h>
int main(){
int i,n;
long ans=1;
scanf("%d",&n);
for(i=1;i<=n;i++){
ans=ans*i;
ans=ans%1000000007
}
printf("%ld\n",ans);
return 0;
} | main.c: In function 'main':
main.c:9:35: error: expected ';' before '}' token
9 | ans=ans%1000000007
| ^
| ;
10 | }
| ~
|
s293926831 | p03796 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main() {
unsigned long long i, N, res = 1;
cin >> N;
for (i = 1; i <= N; i++) {
res = res*i % (pow(10,9) + 7);
}
cout << res << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: invalid operands of types 'long long unsigned int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
10 | res = res*i % (pow(10,9) + 7);
| ~~~~~ ^ ~~~~~~~~~~~~~~~
| | |
| | __gnu_cxx::__promote<double>::__type {aka double}
| long long unsigned int
|
s720885673 | p03796 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main() {
unsigned long long N, res = 1;
cin >> N;
for (int i = 1; i <= N; i++) {
res = res*i % (pow(10,9) + 7);
}
cout << res << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:17: error: invalid operands of types 'long long unsigned int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
10 | res = res*i % (pow(10,9) + 7);
| ~~~~~ ^ ~~~~~~~~~~~~~~~
| | |
| | __gnu_cxx::__promote<double>::__type {aka double}
| long long unsigned int
|
s342354440 | p03796 | C++ | #include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
long long p = 1;
for (double i = 1; i <= n; i++) {
p = i * p % 1000000007;
}
cout << p << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:27: error: invalid operands of types 'double' and 'int' to binary 'operator%'
10 | p = i * p % 1000000007;
| ~~~~~ ^ ~~~~~~~~~~
| | |
| | int
| double
|
s047576858 | p03796 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
ll N,inf = 1e9+7;
int main(){
cin >> N;
ll ans = 1;
for(ll 1=1;i<=N;i++){
ans = (ans*i)%inf;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:9:10: error: expected unqualified-id before numeric constant
9 | for(ll 1=1;i<=N;i++){
| ^
a.cc:9:9: error: expected ';' before numeric constant
9 | for(ll 1=1;i<=N;i++){
| ^~
| ;
a.cc:9:10: error: lvalue required as left operand of assignment
9 | for(ll 1=1;i<=N;i++){
| ^
a.cc:9:14: error: 'i' was not declared in this scope
9 | for(ll 1=1;i<=N;i++){
| ^
a.cc:9:18: error: expected ')' before ';' token
9 | for(ll 1=1;i<=N;i++){
| ~ ^
| )
a.cc:9:19: error: 'i' was not declared in this scope
9 | for(ll 1=1;i<=N;i++){
| ^
|
s908447317 | p03796 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
ll N,inf = 1e9+7;
int main(){
cin >> N;
ll ans = 1:
for(ll 1=1;i<=N;i++){
ans = (ans*i)%inf;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:8:13: error: expected ',' or ';' before ':' token
8 | ll ans = 1:
| ^
a.cc:9:14: error: 'i' was not declared in this scope
9 | for(ll 1=1;i<=N;i++){
| ^
|
s949437099 | p03796 | C | #include<cstdio>
int main()
{
long n,m;
scanf("%ld",&n);
m=1;
for(int i=1;i<=n;i++)
{
m*=i;
}
if(m==0)
{
printf("10e9+7\n");
}
else printf("%d\n",m);
} | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s892651954 | p03796 | C | #include<cstdio>
int main()
{
long n,m;
scanf("%ld",&n);
m=1;
for(int i=1;i<=n;i++)
{
m*=i;
}
if(m==0)
{
printf("10e9+7\n");
}
else printf("%d\n",m);
} | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s757874337 | p03796 | C | long n,m;
scanf("%ld",&n);
m=1;
for(int i=1;i<=n;i++)
{
m*=i;
}
if(m==0)
{
printf("10e9+7\n");
}
else printf("%d\n",m);
} | main.c:2:15: error: expected declaration specifiers or '...' before string constant
2 | scanf("%ld",&n);
| ^~~~~
main.c:2:21: error: expected declaration specifiers or '...' before '&' token
2 | scanf("%ld",&n);
| ^
main.c:3:9: warning: data definition has no type or storage class
3 | m=1;
| ^
main.c:3:9: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:3:9: error: conflicting types for 'm'; have 'int'
main.c:1:16: note: previous declaration of 'm' with type 'long int'
1 | long n,m;
| ^
main.c:4:9: error: expected identifier or '(' before 'for'
4 | for(int i=1;i<=n;i++)
| ^~~
main.c:4:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
4 | for(int i=1;i<=n;i++)
| ^~
main.c:4:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
4 | for(int i=1;i<=n;i++)
| ^~
main.c:8:9: error: expected identifier or '(' before 'if'
8 | if(m==0)
| ^~
main.c:12:9: error: expected identifier or '(' before 'else'
12 | else printf("%d\n",m);
| ^~~~
main.c:13:1: error: expected identifier or '(' before '}' token
13 | }
| ^
|
s187175648 | p03796 | C++ | long n,m;
scanf("%ld",&n);
m=1;
for(int i=1;i<=n;i++)
{
m*=i;
}
if(m==0)
{
printf("10e9+7\n");
}
else printf("%d\n",m);
} | a.cc:2:14: error: expected constructor, destructor, or type conversion before '(' token
2 | scanf("%ld",&n);
| ^
a.cc:3:9: error: 'm' does not name a type
3 | m=1;
| ^
a.cc:4:9: error: expected unqualified-id before 'for'
4 | for(int i=1;i<=n;i++)
| ^~~
a.cc:4:21: error: 'i' does not name a type
4 | for(int i=1;i<=n;i++)
| ^
a.cc:4:26: error: 'i' does not name a type
4 | for(int i=1;i<=n;i++)
| ^
a.cc:8:9: error: expected unqualified-id before 'if'
8 | if(m==0)
| ^~
a.cc:12:9: error: expected unqualified-id before 'else'
12 | else printf("%d\n",m);
| ^~~~
a.cc:13:1: error: expected declaration before '}' token
13 | }
| ^
|
s240400435 | p03796 | C | #include<stdio.h>
#include<cmath>
int main(){
int i,j,N;
int a=1;
scanf("%d",&N);
for(i=1;i<=N;i++)
{
a=a*i;
}
j=pow(10,9)+7;
a=a%j;
printf("%d\n",a);
return 0;
}
| main.c:2:9: fatal error: cmath: No such file or directory
2 | #include<cmath>
| ^~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.