submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s263021859
p00019
C++
#include<string> #include <stdio.h> #include <math.h> #include <cctype> #include<queue> #include<stack> #include<cstdio> using namespace std; int main(){ long long int ans; int n; cin>>n; ans=1; for(int i=1;i<=n;i++){ ans*=i; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'cin' was not declared in this scope 12 | cin>>n; | ^~~ a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 7 | #include<cstdio> +++ |+#include <iostream> 8 | using nam...
s785180915
p00019
C++
print(["1","1","2","6","24","120","720","5040","40320","362880","3628800","39916800","479001600","6227020800","87178291200","1307674368000","20922789888000","355687428096000","6402373705728000","121645100408832000","2432902008176640000","51090942171709440000"][int(input())])
a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token 1 | print(["1","1","2","6","24","120","720","5040","40320","362880","3628800","39916800","479001600","6227020800","87178291200","1307674368000","20922789888000","355687428096000","6402373705728000","121645100408832000","243290200...
s628208032
p00019
C++
#include <iostream> using namespace std; int main () { int n, a=1,i; cin >> n: for(i=n;i>1;i--) { a *= n; } cout << a << endl; }
a.cc: In function 'int main()': a.cc:6:13: error: expected ';' before ':' token 6 | cin >> n: | ^ | ; a.cc:7:20: error: expected ';' before ')' token 7 | for(i=n;i>1;i--) { | ^ | ;
s298838577
p00019
C++
#include <iostream> using namespace std; int main () { int n, a=1,i; cin >> n: for(i=n;i>1;i--) { a *= n; } cout << a << endl; }
a.cc: In function 'int main()': a.cc:6:13: error: expected ';' before ':' token 6 | cin >> n: | ^ | ; a.cc:7:20: error: expected ';' before ')' token 7 | for(i=n;i>1;i--) { | ^ | ;
s763918045
p00019
C++
#include <iostream> int main(){ long long int ans = 1; int n; cin >> n; for(int i=1; i<=n; i++) ans*=i; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> n; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard ...
s493793531
p00019
C++
void factorial(int n) { int answer = 1; for (int i = n; i != 0; i--) { answer *= i; } cout << answer << endl; }
a.cc: In function 'void factorial(int)': a.cc:8:5: error: 'cout' was not declared in this scope 8 | cout << answer << endl; | ^~~~ a.cc:8:23: error: 'endl' was not declared in this scope 8 | cout << answer << endl; | ^~~~
s309774058
p00019
C++
int factorial(int n) { int answer = 1; for (int i = n; i != 0; i--) { answer *= i; } std::cout << answer << std::endl; }
a.cc: In function 'int factorial(int)': a.cc:8:10: error: 'cout' is not a member of 'std' 8 | std::cout << answer << std::endl; | ^~~~ a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int fa...
s611644191
p00019
C++
#include <iostream> using namespace std; int main(int argc, *char argv[]) { int answer = 1; int n = argv[1]; for (int i = n; i != 0; i--) { answer *= i; } cout << answer; return 0; }
a.cc:5:20: error: expected identifier before '*' token 5 | int main(int argc, *char argv[]) { | ^ a.cc:5:21: error: expected ',' or '...' before 'char' 5 | int main(int argc, *char argv[]) { | ^~~~ a.cc:5:5: warning: second argument of 'int main(int, int*)' sho...
s647852367
p00019
C++
#include <iostream> using namespace std; int main() { long long answer = 1`; int n; cin >> n; for (int i = n; i != 0; i--) { answer *= i; } cout << answer; return 0; }
a.cc:6:25: error: stray '`' in program 6 | long long answer = 1`; | ^
s835511985
p00019
C++
#include <iostream> using namespace std; int main() { int n; int i; int anser = 1; cin >> n for (i = 1; i <= n; i++){ anser *= i; } cout << anser; return (0); }
a.cc: In function 'int main()': a.cc:10:17: error: expected ';' before 'for' 10 | cin >> n | ^ | ; 11 | 12 | for (i = 1; i <= n; i++){ | ~~~ a.cc:12:32: error: expected ';' before ')' token 12 | for (i = 1; i <= n; i++)...
s017985150
p00019
C++
main = readLn >>= print . product . flip take [1..]
a.cc:1:48: error: too many decimal points in number 1 | main = readLn >>= print . product . flip take [1..] | ^~~ a.cc:1:1: error: 'main' does not name a type 1 | main = readLn >>= print . product . flip take [1..] | ^~~~
s792100815
p00019
C++
#include <cstdio> int main(void) { int n; int i; long sum; sum = 1; scanf("%d", &n); for (i = 1; i <= n; i++){ sum *= i; } printf("%d\n", sum); } return (0); }
a.cc:19:9: error: expected unqualified-id before 'return' 19 | return (0); | ^~~~~~ a.cc:20:1: error: expected declaration before '}' token 20 | } | ^
s164149770
p00019
C++
#include <iostream> using namespace std; int main() { int n; long long int ans = 1; int num; cin >> n; for(int i = n+1; i>1; i--) { ans *= (i-1); } cout << ans << endl return 0; }
a.cc: In function 'int main()': a.cc:17:28: error: expected ';' before 'return' 17 | cout << ans << endl | ^ | ; 18 | 19 | return 0; | ~~~~~~
s752079701
p00019
C++
#include <iostream> using namespace std; int main() { int n long long ans; cin >> n; ans = 1; for (int i = 1; i <= n; i++){ ans *= i; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:3: error: expected initializer before 'long' 7 | long long ans; | ^~~~ a.cc:8:10: error: 'n' was not declared in this scope 8 | cin >> n; | ^ a.cc:9:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 9 | ans = 1; | ...
s255299284
p00019
C++
import scala.io.StdIn._ object Main extends App { println((1 to readInt()).map(_.toLong).product) }
a.cc:1:1: error: 'import' does not name a type 1 | import scala.io.StdIn._ | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s966055752
p00019
C++
#include<iostream> #include<stdio.h> using namespace std; int factorial(int n) { return (n > 0 ? n*factorial(n - 1) : 1); } int main() { int n; scanf_s("%d", &n); printf("%d \n", factorial(n)); return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 14 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s988220046
p00019
C++
#include<iostream> #include<stdio.h> using namespace std; long long factorial(int n) { return (n > 0 ? n*factorial(n - 1) : 1); } int main() { int n; scanf_s("%d", &n); printf("%lld \n", factorial(n)); return 0; }
a.cc: In function 'int main()': a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 14 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s053092603
p00019
C++
#include <stdio.h> int main(){ int n; int i; long long ans=1; cin >> n; for(i=0; i<n; i++){ ans = ans * (i+1); } cout << ans <<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin >> n; | ^~~ a.cc:12:9: error: 'cout' was not declared in this scope 12 | cout << ans <<endl; | ^~~~ a.cc:12:23: error: 'endl' was not declared in this scope 12 | co...
s880676512
p00019
C++
#include <stdio.h> int main(){ int n; int i; long long ans=1; cin >> n; for(i=0; i<n; i++){ ans = ans * (i+1); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | cin >> n; | ^~~ a.cc:12:9: error: 'cout' was not declared in this scope 12 | cout << ans << endl; | ^~~~ a.cc:12:24: error: 'endl' was not declared in this scope 12 | c...
s943073651
p00019
C++
#include <iostream> #include<math.h> #include<iomanip> #include<vector> #include<algorithm> #include<functional> using namespace std; int main() { int a=0,b=0,i=0; cin >> a; b=1; for(i=0;i<a;i++){ b=b*(i+1); }#include <iostream> #include<math.h> #include<iomanip> #include<vector> #include...
a.cc:17:6: error: stray '#' in program 17 | }#include <iostream> | ^ a.cc: In function 'int main()': a.cc:17:7: error: 'include' was not declared in this scope 17 | }#include <iostream> | ^~~~~~~ a.cc:17:24: error: expected primary-expression before '>' token 17 | }#include <...
s893053150
p00019
C++
#include<cstdio> using namespace std; int ans = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000}; int main(){ int a; scanf("%d", &a); printf("%d\n", ans[a...
a.cc:4:98: error: expected '}' before numeric constant 4 | int ans = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000}; | ~ ...
s884534752
p00019
C++
#include<cstdio> using namespace std; int ans[] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000}; int main(){ int a; scanf("%d", &a); printf("%d\n", ans...
a.cc:4:100: error: expected '}' before numeric constant 4 | int ans[] = {1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800. 87178291200, 1307674368000, 20922789888000, 355687428096000, 6402373705728000, 121645100408832000, 2432902008176640000}; | ~ ...
s881113464
p00019
C++
#include<bits/stdc++.h> using namespace std; int main() { long long n,rslt; rslt=1; cin>>n; for(i=1;i<=n;i++) rslt*=i; cout<<rslt<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:8: error: 'i' was not declared in this scope 8 | for(i=1;i<=n;i++) | ^
s931723711
p00019
C++
#include <iostream> #include <cmath> using namespace std; int main() { int a; cin >> a; out << tgamma(a+1) << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:3: error: 'out' was not declared in this scope 7 | out << tgamma(a+1) << endl; | ^~~
s209338224
p00019
C++
#include <iostream> #include <cmath> using namespace std; int main() { int a = 0; cin >> a; cout << (long long)tgamma((long int)n + 1) << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:39: error: 'n' was not declared in this scope 7 | cout << (long long)tgamma((long int)n + 1) << endl; | ^
s505745095
p00019
C++
#include<iostream> using namespace std; int main(){ unsigned __int64 a=1; int i,n; cin>>n; for(i=n;i>0;i--){ a*=i; } cout<<a<<endl; return 0; }
a.cc: In function 'int main()': a.cc:4:26: error: expected initializer before 'a' 4 | unsigned __int64 a=1; | ^ a.cc:8:17: error: 'a' was not declared in this scope 8 | a*=i; | ^ a.cc:10:15: error: 'a' was not declared in this scope ...
s480329541
p00019
C++
#include <iostream> using namespace std; int main(){ int n; unsigned long ans = 1; cin >> n; for (int i = 1; i <= n; i++) { ans *= i } cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: expected ';' before '}' token 9 | ans *= i | ^ | ; 10 | } | ~ a.cc:11:13: error: 'i' was not declared in this scope 11 | cout << i << endl; | ^
s947341838
p00019
C++
#include <iostream> using namespace std; int main(){ int n; unsigned long ans = 1; cin >> n; for (int i = 1; i <= n; i++) { ans *= i } cout << i << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: expected ';' before '}' token 9 | ans *= i | ^ | ; 10 | } | ~ a.cc:11:13: error: 'i' was not declared in this scope 11 | cout << i << endl; | ^
s278925890
p00019
C++
#include <bits/stdc++.h> int fact(int x) { if(x == 1) return 1; else return x * fact(x-1); } int main() { int n; cin >> n; cout << fact(n) << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:8: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | int n; cin >> n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:...
s516937552
p00019
C++
//#define scanf_s scanf //#define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 81 #define _MAX 100 #define ABC 26 int main(void) { int n, ans = 1; scanf_s("%d", &n); for (int i = 1; i <= n; ++i) { ans *= i; } printf("%d\n", ans); }
a.cc: In function 'int main()': a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 14 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s877311458
p00019
C++
#include<stdio.h> int ke(int x) { if(x == 1)return 1; else return x*ke(x-1); } int main() { int a; cin >> a; printf("%d",ke(a)); return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'cin' was not declared in this scope 10 | cin >> a; | ^~~
s234267640
p00019
C++
#include <iostream> using namespace std; int fact(int n){ if(n==2) return 2; else return n*fact(n-1); } int main() { int n,f; cin >> n; f=fact(n); cout <<< f << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:10: error: expected primary-expression before '<' token 14 | cout <<< f << endl; | ^ a.cc:14:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 14 | cout <<< f << endl; | ~~^~~~~~...
s679838704
p00019
C++
#include <iostream> using namespace std; int main() { int n; unsigned long long int re = 1; cin >> n; while(n >= 2) { re *= n; n--; } cout << re << endl; return 0; }#include <iostream> using namespace std; int main() { int n; int re = 1; cin >> n; while(n >= 2) { re *= n; n--; } cout ...
a.cc:19:2: error: stray '#' in program 19 | }#include <iostream> | ^ a.cc:19:3: error: 'include' does not name a type 19 | }#include <iostream> | ^~~~~~~ a.cc:23:5: error: redefinition of 'int main()' 23 | int main() { | ^~~~ a.cc:5:5: note: 'int main()' previously defined here 5 |...
s356721549
p00019
C++
#include <iostream> using namespace std; int main() { int n; unsigned long long int re = 1; cin >> n; while(n >= 2) { re *= n; n--; } cout << re << endl; return 0; }#include <iostream> using namespace std; int main() { int n; int re = 1; cin >> n; while(n >= 2) { re *= n; n--; } cout ...
a.cc:19:2: error: stray '#' in program 19 | }#include <iostream> | ^ a.cc:19:3: error: 'include' does not name a type 19 | }#include <iostream> | ^~~~~~~ a.cc:23:5: error: redefinition of 'int main()' 23 | int main() { | ^~~~ a.cc:5:5: note: 'int main()' previously defined here 5 |...
s755173614
p00019
C++
#include <iostream> int main() { long long fact[21] = {}; fact[0] = 1; int a; cin >> a; for (int i = 1; i <= a; ++i) fact[i] = i * fact[i - 1]; cout << fact[a] << endl; }
a.cc: In function 'int main()': a.cc:7:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | int a; cin >> a; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s560954089
p00019
C++
#include<iostream> #include<stdio.h> #include<string> #include<math.h> #include<iomanip> #include<algorithm> #include<string.h> #include<cctype> #include<map> #include<set> #include<vector> #include<sstream> #include<stack> using namespace std; int main() { long long int n; long long result...
a.cc: In function 'int main()': a.cc:22:10: error: expected ';' before 'while' 22 | cin>>n | ^ | ; 23 | while(n--) | ~~~~~
s957734843
p00019
C++
include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int n; int ans=1; for(int i=1;i<=n;i++){ ans*=i; } printf(" %d",ans); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g...
s076511401
p00019
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; long k=1; cin>>n; int i; for(i=1;i<=n;i++){ k*=(long)i; } cout<<k<<endl; return(0); } Compile Error Logs: You are not authorized to see the message. Status Judge: 1/1 C++ CPU: 00.00 sec Memory: 30...
a.cc:28:6: error: stray '#' in program 28 | Case # Verdict CPU Time Memory In Out Case Name | ^ a.cc:29:7: error: stray '#' in program 29 | Case #1: : Accepted 00.00 sec 3056 KB | ^ a.cc:37:13: error: stray '#' in program 37 | Judge Input #1 ( | ) Judge Output #1 ( | ) | ...
s196687356
p00019
C++
#include <cstdio> using namespace std; long long fact(int n){ if(n==2) return 2; return fact(n-1)*n; } int main(void){ int n; cin >> n; cout << fact(n) << endl; }
a.cc: In function 'int main()': a.cc:10:3: error: 'cin' was not declared in this scope 10 | cin >> n; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <cstdio> +++ |+#include <iostream> 2 | using namespace st...
s692377659
p00019
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; typedef long long ll; int main(){ ll n,ans=1; cin >> n; while(n--){ ans*=n; } cout << n << endl return 0; }
a.cc: In function 'int main()': a.cc:12:22: error: expected ';' before 'return' 12 | cout << n << endl | ^ | ; 13 | return 0; | ~~~~~~
s052895182
p00019
C++
#include<iostream> using namespace std; int main() { int n; cin>>n; doublr ans=1; for(int i=1;i<=n;i++) ans*=i; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: 'doublr' was not declared in this scope; did you mean 'double'? 6 | doublr ans=1; | ^~~~~~ | double a.cc:8:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 8 | ans*=i; | ^~~ | abs a.cc:9:9: error: 'ans'...
s049178452
p00019
C++
#include <stdio.h> int main(void){ int n,i,P; P=1; n<=1&&n<=20 scanf("%d",&n); for(i=1;i<=n;i++){ P=P*i; } printf("%d\n",P); return 0; }
a.cc: In function 'int main()': a.cc:5:15: error: expected ';' before 'scanf' 5 | n<=1&&n<=20 | ^ | ; 6 | scanf("%d",&n); | ~~~~~
s860784036
p00019
C++
#include<iostream> n,i; main(){ std::cin>>n; for(i=n;--n;) i*=n; std::cout<<i;}
a.cc:2:1: error: 'n' does not name a type 2 | n,i; | ^ a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:4:13: error: 'n' was not declared in this scope 4 | std::cin>>n; | ^ a.cc:5:7: ...
s721174135
p00019
C++
#include<iostream> main(n,i){ std::cin>>n; for(i=n;--n;) i*=n; std::cout<<i;}
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(n,i){ | ^
s344767942
p00019
C++
#include <iostream> main(){long long n,i;for(std::cin>>n,i=n;i>1;n*=--i);std::cout<<n<<endl;}
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(){long long n,i;for(std::cin>>n,i=n;i>1;n*=--i);std::cout<<n<<endl;} | ^~~~ a.cc: In function 'int main()': a.cc:2:68: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 2 | main(){long long...
s602218437
p00019
C++
#include<iostream> using namespace std; int main() { int n; __int64 ans=1; cin >> n ; for(int i=1;i<=n;i++) { ans*=i; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 8 | __int64 ans=1; | ^~~~~~~ | __int64_t a.cc:14:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | ans*=i; | ...
s441732417
p00019
C++
import java.util.Scanner; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println(fact(sc.nextInt())); } private static long fact(long n) { if (n == 1) return 1; return fact(n - 1) * n; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:15: error: expected ':' before 'static' 5 | public static void main(String args[]) | ^~~~~~~ | : a....
s611570832
p00019
C++
nclude<iostream> using namespace std; int function(int n){ if(n > 1) return n * function(n-1); else return 1; } int main(){ int n; cin >> n; cout << function(n) << endl; }
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude<iostream> | ^~~~~~ a.cc: In function 'int main()': a.cc:12:3: error: 'cin' was not declared in this scope 12 | cin >> n; | ^~~ a.cc:13:3: error: 'cout' was not declared in this scope 13 | cout << function(n) << endl; | ^~~~ a....
s617058445
p00019
C++
nclude<iostream> using namespace std; int function(int n){ if(n > 1) return n * function(n-1); else return 1; } int main(){ int n; cin >> n; cout << function(n) << endl; }
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude<iostream> | ^~~~~~ a.cc: In function 'int main()': a.cc:12:3: error: 'cin' was not declared in this scope 12 | cin >> n; | ^~~ a.cc:13:3: error: 'cout' was not declared in this scope 13 | cout << function(n) << endl; | ^~~~ a....
s367546964
p00019
C++
nclude<iostream> using namespace std; int function(int n){ if(n > 1) return n * function(n-1); else return 1; } int main(){ int n; cin >> n; cout << function(n) << endl; return 0; }
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude<iostream> | ^~~~~~ a.cc: In function 'int main()': a.cc:12:3: error: 'cin' was not declared in this scope 12 | cin >> n; | ^~~ a.cc:13:3: error: 'cout' was not declared in this scope 13 | cout << function(n) << endl; | ^~~~ a....
s263894763
p00019
C++
#include<stdio.h> #include<stdlib.h> int main(){ int cnt ,i,kaeru; double num; char total[10]; gets(total); kaeru= atoi(total); num = 1; for( i = kaeru ; i >= 1 ; i-- ){ num *= i; } printf("%f",num); return 0; }
a.cc: In function 'int main()': a.cc:8:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(total); | ^~~~ | getw
s608382632
p00019
C++
n;main(i){for(n=scanf("%d",&i);i;n*=i--);printf("%d\n",n);}
a.cc:1:1: error: 'n' does not name a type 1 | n;main(i){for(n=scanf("%d",&i);i;n*=i--);printf("%d\n",n);} | ^ a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token 1 | n;main(i){for(n=scanf("%d",&i);i;n*=i--);printf("%d\n",n);} | ^
s882915839
p00019
C++
c;main(){c=!puts("2432902008176640000");}
a.cc:1:1: error: 'c' does not name a type 1 | c;main(){c=!puts("2432902008176640000");} | ^ a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | c;main(){c=!puts("2432902008176640000");} | ^~~~ a.cc: In function 'int main()': a.cc:1:10: error: 'c' was not decla...
s294683351
p00019
C++
void main(){printf("%d\n",120);}
a.cc:1:1: error: '::main' must return 'int' 1 | void main(){printf("%d\n",120);} | ^~~~ a.cc: In function 'int main()': a.cc:1:13: error: 'printf' was not declared in this scope 1 | void main(){printf("%d\n",120);} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this i...
s095589410
p00019
C++
main(){printf("%d\n",120);return 0;}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){printf("%d\n",120);return 0;} | ^~~~ a.cc: In function 'int main()': a.cc:1:8: error: 'printf' was not declared in this scope 1 | main(){printf("%d\n",120);return 0;} | ^~~~~~ a.cc:1:1: note: 'pri...
s701140350
p00019
C++
#include <iostream> using namespace std; __int64 fact(int num); int input_int(); int main() { cout << fact(input_int()) << endl; return (0); } __int64 fact(int num) { return ((num == 1) ? 1 : fact(num - 1) * num); } int input_int(void) { int in; cin >> in; return (in); }
a.cc:4:1: error: '__int64' does not name a type; did you mean '__int64_t'? 4 | __int64 fact(int num); | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:9:17: error: 'fact' was not declared in this scope 9 | cout << fact(input_int()) << endl; | ^~~~ a.cc: At glo...
s919840238
p00019
C++
#include <iostream> using namespace std; __int64 fact(int num); int input_int(); int main() { cout << fact(input_int()) << endl; return (0); } __int64 fact(int num) { return ((num == 1) ? 1 : fact(num - 1) * num); } int input_int() { int in; cin >> in; return (in); }
a.cc:4:1: error: '__int64' does not name a type; did you mean '__int64_t'? 4 | __int64 fact(int num); | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:9:17: error: 'fact' was not declared in this scope 9 | cout << fact(input_int()) << endl; | ^~~~ a.cc: At glo...
s102835945
p00019
C++
main(){puts("2432902008176640000");}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){puts("2432902008176640000");} | ^~~~ a.cc: In function 'int main()': a.cc:1:8: error: 'puts' was not declared in this scope 1 | main(){puts("2432902008176640000");} | ^~~~
s524155846
p00019
C++
main(i){printf("%d\n",rand(3));}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(i){printf("%d\n",rand(3));} | ^
s574243420
p00019
C++
main(i){printf("%d\n",rand());}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(i){printf("%d\n",rand());} | ^
s461307451
p00019
C++
nclude<iostream> using namespace std; int main(){ int n,i,ans; while(cin >> n){ ans=1; for(i=0;i<n;i++){ ans=ans*(n-i); } cout << ans << endl; } }
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude<iostream> | ^~~~~~ a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope 7 | while(cin >> n){ | ^~~ a.cc:15:5: error: 'cout' was not declared in this scope 15 | cout << ans << endl; | ...
s457390193
p00019
C++
nclude<iostream> using namespace std; int main(){ int n,i; long long asn; while(cin >> n){ ans=1; for(i=0;i<n;i++){ ans=ans*(n-i); } cout << ans << endl; } }
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude<iostream> | ^~~~~~ a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope 8 | while(cin >> n){ | ^~~ a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'asn'? 10 | ans=1; |...
s709474898
p00019
C++
#include<iostream> using namespace std; int main(){ int n,i; long long asn; while(cin >> n){ ans=1; for(i=0;i<n;i++){ ans=ans*(n-i); } cout << ans << endl; } }
a.cc: In function 'int main()': a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'asn'? 10 | ans=1; | ^~~ | asn
s743516509
p00019
C++
#include <iostream> using namespace std; int main(void) { int a,b; cin >> a; for(i=a;i>0;i--) { b*=i; } cout << b; return 0; }
a.cc: In function 'int main()': a.cc:8:6: error: 'i' was not declared in this scope 8 | for(i=a;i>0;i--) | ^
s417330004
p00019
C++
include<iostream> using namespace std; int main(){ int n,s=1; cin >> n; for(int i=0;n-i > 0;i++) s=s*(n-i); cout << s <<endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> n; | ^~~ a.cc:8:3: error: 'cout' was not declared in this scope 8 | cout << s <<endl; | ^~~~ a.cc:8:15: e...
s306823940
p00019
C++
#include<iostream> using namespace std; int main(){ int n; long long sum = 1; for(int i=1; i<=n; i++){ sum*=i; } sout <<sum<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'sout' was not declared in this scope 9 | sout <<sum<<endl; | ^~~~
s712141515
p00019
C++
#include<iostream> int main() { using namespace std; int num,factorial=1; cout<<"Enter the number: "; cin>>num; for(int i=1;i<=num;i++) { factorial=factorial*i; } cout<<<<factorial<<endl; cin.get(); return 0; }
a.cc: In function 'int main()': a.cc:16:15: error: expected primary-expression before '<<' token 16 | cout<<<<factorial<<endl; | ^~
s539442495
p00019
C++
#include <iostream> using namespace std; int main() { int n,fac=1; n<=20; cin>>n; for(int i=1;i<=num;i++) { fac=n*i; } cout<<fac<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:16: error: 'num' was not declared in this scope; did you mean 'enum'? 9 | for(int i=1;i<=num;i++) | ^~~ | enum
s142828147
p00019
C++
#include<iostream> __int64 fact( int n ) { if( n == 1 ) return 1; else return n * fact( n - 1 ); } int main() { int x; std::cin >> x; std::cout << fact( x ) << std::endl; return 0; }
a.cc:3:1: error: '__int64' does not name a type; did you mean '__int64_t'? 3 | __int64 fact( int n ) | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:13:22: error: 'fact' was not declared in this scope 13 | std::cout << fact( x ) << std::endl; | ^~~~
s269100900
p00019
C++
#include<iostream> using namespace std; int n,a,ans; int !(int x){ if(x<1){return 1;} if(x>=1){ a=!(x-1)*x; return a;}} int solve(){ cin>>n; ans=!(n); cout<<ans<<endl;}
a.cc:4:5: error: expected unqualified-id before '!' token 4 | int !(int x){ | ^ a.cc: In function 'int solve()': a.cc:13:17: warning: no return statement in function returning non-void [-Wreturn-type] 13 | cout<<ans<<endl;} | ^
s917226646
p00019
C++
#include<iostream> using namespase std; int main(){ int n; while(cin>>n){ long long pro = 1; for(int i=1;i<=n;i++){ pro*=i; } cout << pro << endl; } return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namespase' 2 | using namespase std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | while(cin>>n){ | ^~~ | std::cin In file included from a....
s752705425
p00019
C++
#include<stdio.h> int fact(int n){ if(n>1) return n*fact(n-1); return 1; } main(){ int x; scanf("%d",&x) printf("%d\n",fact(x)); }
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:9:19: error: expected ';' before 'printf' 9 | scanf("%d",&x) | ^ | ; 10 | printf("%d\n",fact(x)); |...
s483579331
p00019
C++
#include<stdio.h>int fact(int n){ if(n>1) return n*fact(n-1); return 1;}main(){int x; scanf("%d",&x); printf("%d\n",fact(x));}
a.cc:1:22: warning: extra tokens at end of #include directive 1 | #include<stdio.h>int fact(int n){ if(n>1) return n*fact(n-1); return 1;}main(){int x; scanf("%d",&x); printf("%d\n",fact(x));} | ^~~~ a.cc:1:9: fatal error: stdio.h>in: No such file or directory 1 | #incl...
s570379995
p00019
C++
void main(a,i){ long long n=scanf("%d",&a); for(i=0;i++<a;)n*=i; printf("%llu\n",n); }
a.cc:1:6: error: variable or field 'main' declared void 1 | void main(a,i){ | ^~~~ a.cc:1:11: error: 'a' was not declared in this scope 1 | void main(a,i){ | ^ a.cc:1:13: error: 'i' was not declared in this scope 1 | void main(a,i){ | ^
s164363618
p00019
C++
int main(a,i){ long long n=scanf("%d",&a); for(i=0;i++<a;)n*=i; printf("%llu\n",n); return 0; }
a.cc:1:5: error: cannot declare '::main' to be a global variable 1 | int main(a,i){ | ^~~~ a.cc:1:10: error: 'a' was not declared in this scope 1 | int main(a,i){ | ^ a.cc:1:12: error: 'i' was not declared in this scope 1 | int main(a,i){ | ^ a.cc:1:13: error: expre...
s437031799
p00019
C++
#include<iostream> using namespace std; long long ans=1; long long factorial(int n){ // 再起関数 if(n==1){ return ans; }else{ ans = n*factorial(n-1); } } int main(){ int n; cin >> n; if(n<0){ cout << "計算できません。" << endl; }else if(n==0 || n==1){ cout << 1 << endl; }else{ cout << fact...
a.cc: In function 'int main()': a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:14:11: note: to match this '{' 14 | int main(){ | ^ a.cc: In function 'long long int factorial(int)': a.cc:10:9: warning: control reaches end of non-void function [-Wreturn-type] 10 | ans =...
s328405065
p00019
C++
#include<iostream> using namespace std; long long factorial(long long n){ // 再帰関数 if(n==1){ return 1; }else{ return n*=factorial(n-1); } } int main(){ int n; cin >> n; if(n>=1 && n<=20){ cout << factorial(n) << endl; // 再帰 else{ cout << "計算できません。" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:3: error: expected '}' before 'else' 19 | else{ | ^~~~ a.cc:16:20: note: to match this '{' 16 | if(n>=1 && n<=20){ | ^
s876512294
p00019
C++
main(){puts("2432902008176640000");return 0;}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){puts("2432902008176640000");return 0;} | ^~~~ a.cc: In function 'int main()': a.cc:1:8: error: 'puts' was not declared in this scope 1 | main(){puts("2432902008176640000");return 0;} | ^~~~
s744460337
p00019
C++
main(){printf("2432902008176640000\n");return;}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){printf("2432902008176640000\n");return;} | ^~~~ a.cc: In function 'int main()': a.cc:1:8: error: 'printf' was not declared in this scope 1 | main(){printf("2432902008176640000\n");return;} | ^~~~~...
s235670900
p00019
C++
main(){printf("2432902008176640000\n");return 0;}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){printf("2432902008176640000\n");return 0;} | ^~~~ a.cc: In function 'int main()': a.cc:1:8: error: 'printf' was not declared in this scope 1 | main(){printf("2432902008176640000\n");return 0;} | ^...
s325535143
p00019
C++
main()printf("2432902008176640000\n");return 0;
a.cc:1:7: error: expected constructor, destructor, or type conversion before 'printf' 1 | main()printf("2432902008176640000\n");return 0; | ^~~~~~ a.cc:1:39: error: expected unqualified-id before 'return' 1 | main()printf("2432902008176640000\n");return 0; | ...
s075193357
p00019
C++
main(){printf("2432902008176640000\n");}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){printf("2432902008176640000\n");} | ^~~~ a.cc: In function 'int main()': a.cc:1:8: error: 'printf' was not declared in this scope 1 | main(){printf("2432902008176640000\n");} | ^~~~~~ a.cc:1:1: no...
s715297435
p00019
C++
#include <stdio.h> typedef long long LL; LL a[21]; void init(){ a[1] = 1; for (int i=2; i<=20; ++i){ a[i] = a[i-1]*i; } } void solve(LL n){ printf("%lld\n", a[n]); } int main (){ __int64 n; init(); while (~scanf("%lld", &n)){ solve(n); } return 0; }
a.cc: In function 'int main()': a.cc:19:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 19 | __int64 n; | ^~~~~~~ | __int64_t a.cc:21:32: error: 'n' was not declared in this scope 21 | while (~scanf("%lld", &n)){ | ...
s416891878
p00019
C++
#include <iostream> using namespace std; factorial(int n){ return (--n) ? factorial(n):1; } int main(void){ int n; cin >> n; cout << factorial(n) << endl; return 0; }
a.cc:3:1: error: ISO C++ forbids declaration of 'factorial' with no type [-fpermissive] 3 | factorial(int n){ | ^~~~~~~~~
s125418297
p00019
C++
#include <iostream> using namespace std; factorial(int n){ return ((--n) ? factorial(n):1); } int main(void){ int n; cin >> n; cout << factorial(n) << endl; return 0; }
a.cc:3:1: error: ISO C++ forbids declaration of 'factorial' with no type [-fpermissive] 3 | factorial(int n){ | ^~~~~~~~~
s351485178
p00019
C++
#include <iostream> using namespace std; int factorial(int n){ if(n > 0){ return n*factorial(n-1); } else { return 1; } } int main(){ int n; cin>>n; if(n<1||n<20)break; cout<< factorial(n)<<endl; }
a.cc: In function 'int main()': a.cc:15:16: error: break statement not within loop or switch 15 | if(n<1||n<20)break; | ^~~~~
s718355513
p00019
C++
#include <iostream> using namespace std; long factorial(long n){ if(n > 0){ return n*factorial(n-1); } else { return 1; } } int main(){ long n; cin>>n; cout<< factorial(n)>>endl; }
a.cc: In function 'int main()': a.cc:16:22: error: no match for 'operator>>' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 16 | cout<< factorial(n)>>endl; | ~~~~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/inc...
s851045702
p00019
C++
#include<iostream> using namespace std; int main() { cin>>n; int ans = 1; for(int i=1; i<=n; i++) ans *= i; printf("%d\n", ans); }
a.cc: In function 'int main()': a.cc:4:6: error: 'n' was not declared in this scope 4 | cin>>n; | ^
s098150274
p00019
C++
#include<iostream> using namespace std; int main() { cin>>n; int ans = 1; for(int i=1; i<=n; i++) ans *= i; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:4:6: error: 'n' was not declared in this scope 4 | cin>>n; | ^
s520671317
p00019
C++
#include <iostream> using namespace std; int fact(n){ if(n == 1) return 1; else return n * fact(n-1); } int main(){ int n; cin >> n; cout << fact(n) << endl; return 0; }
a.cc:5:10: error: 'n' was not declared in this scope 5 | int fact(n){ | ^ a.cc: In function 'int main()': a.cc:13:17: error: 'fact' cannot be used as a function 13 | cout << fact(n) << endl; | ~~~~^~~
s308015917
p00019
C++
#include <iostream> using namespace std; int main(){ int n; while(cin >> n){ for(int i=1;n<1;n--) i *= n; cout << i; } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'i' was not declared in this scope 9 | cout << i; | ^
s989852669
p00019
C++
using namespace std; int f(int x){ if(x==0){ return 1; }else{ return x*f(x-1); } } int main(){ long int a,r; while(cin >> a){ r=f(a); cout << r << endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:15: error: 'cin' was not declared in this scope 13 | while(cin >> a){ | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace st...
s628733711
p00019
C++
p (1..gets.to_i).inject(:*)
a.cc:1:4: error: too many decimal points in number 1 | p (1..gets.to_i).inject(:*) | ^~~~~~~~~~~~ a.cc:1:3: error: expected constructor, destructor, or type conversion before '(' token 1 | p (1..gets.to_i).inject(:*) | ^
s987389991
p00019
C++
#include<iostream> main(){ int i,n,r; r=1; cin>>n; for(i=1;i<=n;++i){ r=r*i; } cout<<r<<endl; }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>n; | ^~~ | std::cin In file included from a.cc:1: /usr/include...
s525493569
p00019
C++
#include<iostream> using namespace std; main(){ int i,n; r; r=1; cin>>n; for(i=1;i<=n;++i){ r=r*i; } cout<<r<<endl; }
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:1: error: 'r' was not declared in this scope 6 | r; | ^
s643957865
p00019
C++
#include <iostream> #include <cstdlib> #include <windows.h> using namespace std; float factorial(float n); int main() { long long n; do { cout<< "Enter value : " ; cin >> n; }while(n>20); cout<< factorial(n) << endl; return 0; } float factorial(float n) { int x...
a.cc:3:10: fatal error: windows.h: No such file or directory 3 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s486530083
p00019
C++
#include <iostream> #include <cstdlib> #include <windows.h> using namespace std; float factorial(float n); int main() { float n; do { cout<< "Enter value : " ; cin >> n; }while(n>20); cout<< factorial(n) << endl; return 0; } float factorial(float n) { int x; ...
a.cc:3:10: fatal error: windows.h: No such file or directory 3 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s126968274
p00019
C++
#include <iostream> #include <cstdlib> #include <windows.h> using namespace std; int main() { long long n; do { cout<< "Enter value : " ; cin >> n; }while(n>20); int x; long long sum=1; for(x=1; x<=n; x++) { sum = sum*x; } cout<< sum << endl; ...
a.cc:3:10: fatal error: windows.h: No such file or directory 3 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s762832809
p00019
C++
#include <iostream> #include <cstdlib> #include <windows.h> using namespace std; int main() { long long n; do { cin >> n; }while(n>20); int x; long long sum=1; for(x=1; x<=n; x++) { sum = sum*x; } cout<< sum << endl; return 0; }
a.cc:3:10: fatal error: windows.h: No such file or directory 3 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s660428365
p00019
C++
#include <iostream> #include <cstdlib> #include <windows.h> using namespace std; int main() { long long n; do { cin >> n; }while(n>20); int x; long long sum=1; for(x=1; x<=n; x++) { sum = sum*x; } cout<< sum << endl; return 0; }
a.cc:3:10: fatal error: windows.h: No such file or directory 3 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.