submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s504594921
p03827
C++
#include "iostream" #include <string> using namespace std; int main(){ string s; int a; int b = 0; int c = 0; cin << a; cin << s; for (int i = 0; i < s.size(); i++){ if(s[i] = "I"){ b = b + 1; } if(s[i] = "D"){ b = b - 1; } if(b > c){ c = b; } } cout << c << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | cin << a; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:10:13: note: candidate: 'operator<<(int, int)' (built-in) 10 | cin << a; | ~~~~^~~~ a.cc:10:13: 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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ 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:10:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 10 | cin << a; | ^~~ 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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ 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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:9: required from here 10 | cin << a; | ^ /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:11:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 11 | cin << s; | ~~~ ^~ ~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::istream {aka std::basic_istream<char>} /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits
s312749941
p03827
C++
#include <iostream> #include <string> using namespace std; int main(){ string s; int a; int b = 0; int c = 0; cin << a; cin << s; for (int i = 0; i < s.size(); i++){ if(s[i] = "I"){ b = b + 1; } if(s[i] = "D"){ b = b - 1; } if(b > c){ c = b; } } cout << c << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | cin << a; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:10:13: note: candidate: 'operator<<(int, int)' (built-in) 10 | cin << a; | ~~~~^~~~ a.cc:10:13: 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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ 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:10:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 10 | cin << a; | ^~~ 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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ 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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << a; | ^ /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:10:9: required from here 10 | cin << a; | ^ /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:11:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 11 | cin << s; | ~~~ ^~ ~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::istream {aka std::basic_istream<char>} /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits
s035597576
p03827
C++
#include <iostream> using namespace std; typedef long long int ll; int main(){ string s; ll n; cin >> n >> s; ll x = 0, a = INT_MIN; for(ll i=0 ; i<n ; i++){ if(s[i] == 'I'){ x++; } else { x--; } a = max(a, x); } a = max(a, 0ll); cout << a; return 0; }
a.cc: In function 'int main()': a.cc:9:19: error: 'INT_MIN' was not declared in this scope 9 | ll x = 0, a = INT_MIN; | ^~~~~~~ a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 1 | #include <iostream> +++ |+#include <climits> 2 | using namespace std;
s031628252
p03827
C
Manami:proton manami$ cat b.c #include <stdio.h> int main(void){ int x=0; int N,i; int max=0;; scanf("%d\n",&N); char S; for(i=0; i<N; i++){ scanf("%c", &S); if(S == 'I'){ x++; if(max<x){ max = x; } }else{ x--; } } printf("%d\n",max); return 0; }
main.c:1:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token 1 | Manami:proton manami$ cat b.c | ^ In file included from /usr/include/stdio.h:47, from main.c:2: /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t' 28 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' +++ |+#include <stddef.h> 1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc. /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t' 37 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'? 57 | cookie_read_function_t *read; /* Read bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~ | cookie_seek_function_t /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'? 58 | cookie_write_function_t *write; /* Write bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~~ | cookie_close_function_t /usr/include/stdio.h:314:35: error: unknown type name 'size_t' 314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) | ^~~~~~ /usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 129 | #include <bits/stdio_lim.h> +++ |+#include <stddef.h> 130 | /usr/include/stdio.h:320:47: error: unknown type name 'size_t' 320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW | ^~~~~~ /usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:340:34: error: unknown type name 'size_t' 340 | int __modes, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:346:24: error: unknown type name 'size_t' 346 | size_t __size) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:385:44: error: unknown type name 'size_t' 385 | extern int snprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:389:45: error: unknown type name 'size_t' 389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:690:30: error: unknown type name 'size_t' 690 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:693:28: error: unknown type name 'size_t' 693 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:698:27: error: unknown type name 'size_t' 698 | size_t *__restrict __n, | ^~~~~~ /usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:8: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:46: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:729:22: error: unknown type name 'size_t' 729 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:8: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:53: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:736:23: error: unknown type name 'size_t' 736 | size_t __n, FILE *__restrict __s) __nonnull((4)); | ^~~~~~ /usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:8: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:55: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:757:31: error: unknown type name 'size_t' 757 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:757:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:8: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:62: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:62: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:760:32: error: unknown type name 'size_t' 760 | size_t __n, FILE *__restrict __stream) | ^~~~~~ /usr/include/stdio.h:760:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
s862172143
p03827
C++
#include <iostream> #include <string> using namespace std; int main(){ int x=0, max=0; int n; cin >> n; string s; cin >> s; for(int i=0; i<s.size(); i++){ if(s[i]=='I'){ x += 1; if(x>m) m=x; } if(s[i]=='D'){ x-=1; } } cout << max << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:30: error: 'm' was not declared in this scope 15 | if(x>m) m=x; | ^
s421978287
p03827
C++
#include <iostream> #include <algorithm> #include <cstdio> #include <cmath> #include <string> #include <cctype> #include <stack> #include <queue> #include <vector> #include <cstdlib> #include <list> #define _USE_MATH_DEFINES #include <math.h> using namespace std; int main() { int N,cnt = 0,str,ans = 0; string S; cin >> N; cin >> S; str = S.length; for (int i = 0; i < str; i++) { if (S[i] == 'I') cnt++; if (S[i] == 'D') cnt--; if (ans < cnt) ans = cnt; } cout << ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:25:17: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int' 25 | str = S.length; | ^~~~~~
s937693355
p03828
C++
#include <iostream> #include <cmath> using namespace std; int main() { const int MOD = 1000000007; int N; cin >> N; int R = pow (N, 0.5); int arr[R]; for (int i = 0; i < R - 1; i ++){ arr[i] = 1; } int V = 2; for (int i = 2; i <= N; i ++){ while (i <= N){ if (i % V == 0 && C != 1){ i /= V; arr[V] ++; continue; } V ++; } } long long A = 1; for (int i = 0; i < R - 1; i ++){ A = (A * arr[i]) % MOD; } cout << A << '\n'; }
a.cc: In function 'int main()': a.cc:17:25: error: 'C' was not declared in this scope 17 | if (i % V == 0 && C != 1){ | ^
s963908666
p03828
Java
import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; public class Test { public static void main(String[] args) { int n = 1000; //入力データを処理して、結果を出力 Set<Integer> insu_set = new HashSet<>(); List<Integer> insu_list = new ArrayList<>(); for(int i = 2; i <= n; i++) { int num = i; for(int j = 2; j <= n;) { if(num % j == 0) { insu_set.add(j); insu_list.add(j); num = num / j; } else { j++; } } } List<Integer> keisan = new ArrayList<>(); for(int i : insu_set) { int count = Collections.frequency(insu_list, i); keisan.add(count); } int yakusu_kosu = 1; for(int i : keisan) { yakusu_kosu = yakusu_kosu * (i + 1); } int waru = (int)(Math.pow(10, 9)) + 7; System.out.println(yakusu_kosu % waru); } }
Main.java:7: error: class Test is public, should be declared in a file named Test.java public class Test { ^ 1 error
s157026293
p03828
C++
#include<bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; int main(){ int N;cin>>N; const long mod=1000000007; bool prime[N+1]; for(int i=0;i<=N;i++) prime[i]=true; vector<int> E; for(int i=2;i<=N;i++){ if(prime[i]){ for(int j=i*2;j<=N;j+=i) prime[j]=false; E.push_back(i); } } int L=E.size();//N以下なのでintでOK // long ans[N+1][L]; long ans[L]; for(int i=0;i<L;i++) ans[i]=1; for(int n=2;n<=N;n++){ int F=n;//バグのもと for(int j=0;j<L;j++){ while(F%E[j]==0){ F /=X; ans[j]++; } if(F==1) break; } } long count=1; for(int i=0;i<L;i++){ count *=ans[i]; count %=mod; } cout<<count<<endl; }
a.cc: In function 'int main()': a.cc:26:13: error: 'X' was not declared in this scope 26 | F /=X; | ^
s417113087
p03828
C++
#include<iostresm> using namespace std; long long binpow(long long a, long long b, long long m) { a %= m; long long res = 1; while (b > 0) { if (b & 1) res = res * a % m; a = a * a % m; b >>= 1; } return res; } int main() { long long int n; cin>>n; long long int a=2; long long int mod=1e9+7; long long int ans=binpow(a,n-1,mod); cout<<ans%mod; }
a.cc:1:9: fatal error: iostresm: No such file or directory 1 | #include<iostresm> | ^~~~~~~~~~ compilation terminated.
s319670758
p03828
C++
#include <bits/stdc++.h> using namespace std; int main() { #include <bits/stdc++.h> using namespace std; int main() { int N;cin>>N; int64_t Ans=0; for(int k=1;k<=N;k++){ //double kn=sqrt(k); int ans = 1; vector<int> vec(k+1); int num = k;// 素因数分解する変数num for (int i = 2; i <= k; i++) { while (num%i == 0) {// 素数で割り切れなくなるまで割っていく vec.at(i)++;//割った個数を配列に足す num /= i; } } for (int i = 2; i <= k; i++){ ans *= vec.at(i) + 1;//それぞれを+1して掛けていく } Ans +=ans; } cout<<Ans<<endl; }
a.cc: In function 'int main()': a.cc:8:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 8 | int main() { | ^~ a.cc:8:9: note: remove parentheses to default-initialize a variable 8 | int main() { | ^~ | -- a.cc:8:9: note: or replace parentheses with braces to value-initialize a variable a.cc:8:12: error: a function-definition is not allowed here before '{' token 8 | int main() { | ^ a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s610419542
p03828
C++
#include<iostream> #include <vector> using namespace std; int main() { int n; int ans = 1; cin >> n; vector<int> x(n + 1); int num = n; // 素因数分解する変数num for (int i = 2; i <= n; i++) { while (num%i == 0) { // 素数で割り切れなくなるまで割っていく x.at(i)++; //割った個数を配列に足す num /= i; } } for (int i = 2; i <= n; i++) { ans *= x.at(i) + 1; //それぞれを+1して掛けていく } cout << ans << endl; return 0; }
a.cc:17:35: error: extended character   is not valid in an identifier 17 | x.at(i)++; //割った個数を配列に足す | ^ a.cc:24:36: error: extended character   is not valid in an identifier 24 | ans *= x.at(i) + 1; //それぞれを+1して掛けていく | ^ a.cc: In function 'int main()': a.cc:17:35: error: '\U00003000' was not declared in this scope 17 | x.at(i)++; //割った個数を配列に足す | ^~ a.cc:24:36: error: '\U00003000' was not declared in this scope 24 | ans *= x.at(i) + 1; //それぞれを+1して掛けていく | ^~
s045742457
p03828
C
#define Rep(i,l,r)for(int i=l;i<r;i++) void fac(int n,int a[]){ Rep(i,2,n+1){ int j=i; Rep(k,2,i+1){if(j==1)break;if(!j%k){a[k]++;j/=k;k=1;}}}return;} int main(){ int n,a[1009]={0};LL ans=1; scanf("%d",&n); fac(n,a); Rep(i,2,n+1)if(a[i]>0){ans*=(a[i]+1);ans%=1000000007;} printf("%lld",ans); return 0; }
main.c: In function 'main': main.c:7:27: error: unknown type name 'LL' 7 | int n,a[1009]={0};LL ans=1; | ^~ main.c:8:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | scanf("%d",&n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #define Rep(i,l,r)for(int i=l;i<r;i++) main.c:8:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 8 | scanf("%d",&n); | ^~~~~ main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:11:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 11 | printf("%lld",ans); | ^~~~~~ main.c:11:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:11:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:11:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s966988781
p03828
C++
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int N; cin >> N; int cnt = 0; for(int i = 1; i <= N; i++) { cnt+=i; } int ans = 1; for(int i = 2; i <= N; i++) { int cnt2 = 1; bool ok = true; int X = cnt; for(int j = 2; j*j <= N; j++) { if(i%j == 0) { ok = false; break; } } if(ok) { while(X != 0) { if(X%i == 0) { cnt2++; X/=i; } else { break; } } ans*=cnt2; ans = ans%(1e9+7); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:33:22: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 33 | ans = ans%(1e9+7); | ~~~^~~~~~~~ | | | | | double | long long int
s068549257
p03828
C++
/*------------------------------------ ........Bismillahir Rahmanir Rahim.... ..........created by Abdul Aziz....... ------------------------------------*/ #include <iostream> #include <algorithm> #include <stdio.h> #include <cmath> #include <vector> #include <set> #include <map> #include <cstring> #include <unordered_map> #include <queue> #define mod 998244353 #define int long long #define ld long double #define pb push_back #define sz(x) (int)x.size() #define ff first #define ss second #define pii pair<int,int> using namespace std; vector <int> allPrimes; void sieve(int n) { vector<bool> prime(n+1, true); for (int p=2; p*p<=n; p++) { if (prime[p] == true) { for (int i=p*2; i<=n; i += p) prime[i] = false; } } for (int p=2; p<=n; p++) if (prime[p]) allPrimes.push_back(p); } int solve() { int n; cin >> n ; sieve(n) ; int result = 1; for (int i=0; i < allPrimes.size(); i++) { int p = allPrimes[i]; int x = 0; while (p <= n) { exp = x + (n/p); p = p*allPrimes[i]; } result = (result*(x+1))%1000000007; } cout << result << endl; } signed main() { int n=1; // cin>>n; while (n--) solve(); return 0; }
a.cc: In function 'long long int solve()': a.cc:52:27: error: overloaded function with no contextual type information 52 | exp = x + (n/p); | ^ a.cc:58:1: warning: no return statement in function returning non-void [-Wreturn-type] 58 | } | ^
s098100282
p03828
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; long long n, m, i, j, cnt[1005], np[1005], ans = 1, mod = 1e9 + 7; vector<long long> pri; void calc(int x) { int i; for (i = 0; i < pri.size() && pri[i] * pri[i] <= x; i++) { while (x % pri[i] == 0) { x /= pri[i]; cnt[pri[i]]++;s } } if (x > 1) cnt[x]++; } int main() { cin >> n; np[1] = 1; for (i = 2; i <= n; i++) { if (np[i]) continue; pri.push_back(i); for (j = 2; i * j <= n; j++) np[i * j] = 1; } for (i = 2; i <= n; i++) calc(i); for (i = 0; i < pri.size(); i++) { ans = ans * (cnt[pri[i]] + 1) % mod; } cout << ans << endl; return 0; }
a.cc: In function 'void calc(int)': a.cc:15:27: error: 's' was not declared in this scope 15 | cnt[pri[i]]++;s | ^
s682184803
p03828
C++
g++ #include <bits/stdc++.h> using namespace std; typedef long long ll; bool IsPrime(int num){ if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } int main(){ int n; cin >> n; vector<int> v; ll p = 1; for (int i = 1; i <= n; i++) { if (IsPrime(i)) { v.push_back(i); //cout << i <<endl; } } vector<ll> ans(v.size()); for (int i = 0; i < v.size(); i++) { //cout << v.at(i) << endl; int t = v.at(i); for (int j = 1; j < n; j++) { if (t>n) { break; } else { ans.at(i) += n/t; t *= t; } } } for (int i = 0; i < ans.size(); i++) { p *= (ans.at(i)+1) % 1000000007; //cout << p <<endl; } cout << p << endl; }
a.cc:1:5: error: stray '#' in program 1 | g++ #include <bits/stdc++.h> | ^ a.cc:1:1: error: 'g' does not name a type 1 | g++ #include <bits/stdc++.h> | ^ a.cc: In function 'bool IsPrime(int)': a.cc:10:20: error: 'sqrt' was not declared in this scope 10 | double sqrtNum = sqrt(num); | ^~~~ a.cc: In function 'int main()': a.cc:27:3: error: 'cin' was not declared in this scope 27 | cin >> n; | ^~~ a.cc:28:3: error: 'vector' was not declared in this scope 28 | vector<int> v; | ^~~~~~ a.cc:28:10: error: expected primary-expression before 'int' 28 | vector<int> v; | ^~~ a.cc:33:7: error: 'v' was not declared in this scope 33 | v.push_back(i); | ^ a.cc:38:12: error: expected primary-expression before '>' token 38 | vector<ll> ans(v.size()); | ^ a.cc:38:18: error: 'v' was not declared in this scope 38 | vector<ll> ans(v.size()); | ^ a.cc:38:14: error: 'ans' was not declared in this scope 38 | vector<ll> ans(v.size()); | ^~~ a.cc:57:3: error: 'cout' was not declared in this scope 57 | cout << p << endl; | ^~~~ a.cc:57:16: error: 'endl' was not declared in this scope 57 | cout << p << endl; | ^~~~
s660414889
p03828
C++
#include<bits/stdc++.h> #include<iostream> #include<string> #include<cmath> #include<cstdio> #include<cctype> #include<cstring> #include<iomanip> #include<cstdlib> #include<ctime> #include<set> #include<map> #include<utility> #include<queue> #include<vector> #include<stack> #include<sstream> #include<algorithm> /************************************************/ #define rep(i,n) for(int i=0;i<n;i++) #define m_p make_pair #define pb push_back #define fr first #define se second #define forn(i,a,n) for(int i=a;i<n;i++) #define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++) #define pii pair<int,int> #define vi vector<int> #define ll long long #define sz(s) s.size() #define all(s) s.begin(),s.end() #define zero(x) memset(x,0,sizeof(x)) #define vii vector<pair<int,int> > #define mpis map<int,string> #define mpii map<int,int> #define mpsi map<string,int> #define re return #define mod 1000000007 /************************************************/ using namespace std; long long get(){ char c=getchar(); long long x=0LL; while(c<'0'||c>'9') c=getchar(); while(c>='0'&&c<='9'){ x*=10LL; x+=(c-'0'); c=getchar(); } return x; } int n; ll ans; int a[1001]; vi prime; bool isprime(int x){ for(int i=2;i*i<=x;i++){ if(x%i==0) re false; } re true; } int main(){ ios::sync_with_stdio(0); cin>>n>>p; forn(i,2,1001) if(isprime(i)) prime.pb(i); ans=1; cin>>n; forn(i,2,n+1){ int now=0; int b=i; while(b>1){ while(b%prime[now]&&now<prime.size()) now++; b/=prime[now]; a[prime[now]]++; } } rep(i,1001){ ans*=(a[i]+1); ans%=mod; } cout<<ans; re 0; }
a.cc: In function 'int main()': a.cc:67:17: error: 'p' was not declared in this scope 67 | cin>>n>>p; | ^
s419999364
p03828
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> V(N + 1); for (int i = 2; i <= N; i++) { int tmp = i; for (int j = 2; j <= N; j++) { while (tmp % j == 0) tmp /= j, V.at(i)++; } } long ans = 1; for (int i = 2; i < N + 1; i++) { if (V.at(i)) (ans *= V.at(i) + 1) %= M; } cout << ans << "\n"; }
a.cc: In function 'int main()': a.cc:16:42: error: 'M' was not declared in this scope 16 | if (V.at(i)) (ans *= V.at(i) + 1) %= M; | ^
s579597573
p03828
C++
#include<bits/stdc++.h> using namespace std; set<int>f(int N){ set<int>S; for(int i=2;i<=N;i++){ bool x=true; for(int j=2;j<i;j++){ if(i%j==0){x=false; break;} } if(x){S.insert(i);break;} } return S; } int main(){ int N; cin>>N; set<int>s=f(N); map<int,int>M; for(auto p:s){ int a=N; int ans=1; for(int i=0;0<a;i++){ a/=p; ans+=a; } M[p]=ans; } }int ans=1; for(auto p:M){ auto k=p.first; auto v=p.second; ans=(ans*v)%1000000007; }cout<<ans<<endl; return 0; }
a.cc:28:1: error: expected unqualified-id before 'for' 28 | for(auto p:M){ | ^~~ a.cc:33:2: error: 'cout' does not name a type 33 | }cout<<ans<<endl; | ^~~~ a.cc:35:4: error: expected unqualified-id before 'return' 35 | return 0; | ^~~~~~ a.cc:36:1: error: expected declaration before '}' token 36 | } | ^
s365733416
p03828
C++
#include <algorithm> #include <iostream> #include <cmath> using namespace std; long long fc(int n) { if(n == 1) return 1; return n * fc(n-1); } int main() { int n; cin >>n; long long fd = fc(n); int sv[fd+1]; int ans = 0; for(long long i = 1; i<=fd; i++) { if(sv[i] == 1 || fd % i != 0) continue; sv[i] = 1; sv[fd/i] = 1; ans = (ans + 2) % 10e9 + 7; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:21: error: invalid operands of types 'int' and 'double' to binary 'operator%' 19 | ans = (ans + 2) % 10e9 + 7; | ~~~~~~~~~ ^ ~~~~ | | | | int double
s134499116
p03828
C++
#include <algorithm> #include <iostream> using namespace std; long long fc(int n) { if(n == 1) return 1; return n * fc(n-1); } int main() { int n; cin >>n; long long fd = fc(n); int sv[fd+1]; int ans = 0; for(long long i = 1; i<=fd; i++) { if(sv[i] == 1 || fd % i != 0) continue; sv[i] = 1; sv[fd/i] = 1; ans = (ans + 2) % 10e9 + 7; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:21: error: invalid operands of types 'int' and 'double' to binary 'operator%' 18 | ans = (ans + 2) % 10e9 + 7; | ~~~~~~~~~ ^ ~~~~ | | | | int double
s998860063
p03828
C++
include <algorithm> include <iostream> using namespace std; long long fc(int n) { if(n == 1) return 1; return n * fc(n-1); } int main() { int n; cin >>n; long long fd = fc(n); int sv[fd+1]; int ans = 0; for(long long i = 1; i<=fd; i++) { if(sv[i] == 1 || fd % i != 0) continue; sv[i] = 1; sv[fd/i] = 1; ans = (ans + 2) % 10e9 + 7; } cout << ans << endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <algorithm> | ^~~~~~~ a.cc: In function 'int main()': a.cc:10:10: error: 'cin' was not declared in this scope 10 | int n; cin >>n; | ^~~ a.cc:18:21: error: invalid operands of types 'int' and 'double' to binary 'operator%' 18 | ans = (ans + 2) % 10e9 + 7; | ~~~~~~~~~ ^ ~~~~ | | | | int double a.cc:20:3: error: 'cout' was not declared in this scope 20 | cout << ans << endl; | ^~~~ a.cc:20:18: error: 'endl' was not declared in this scope 20 | cout << ans << endl; | ^~~~
s956796816
p03828
C++
#include<bits/stdc++.h> using namespace std; typedef unsigned long long int ull; // allPrimes[] stores all prime numbers less // than or equal to n. vector<ull> allPrimes; ll m=1000000000+7; // Fills above vector allPrimes[] for a given n void sieve(int n) { // Create a boolean array "prime[0..n]" and // initialize all entries it as true. A value // in prime[i] will finally be false if i is // not a prime, else true. vector<bool> prime(n+1, true); // Loop to update prime[] for (int p=2; p*p<=n; p++) { // If prime[p] is not changed, then it // is a prime if (prime[p] == true) { // Update all multiples of p for (int i=p*2; i<=n; i += p) prime[i] = false; } } // Store primes in the vector allPrimes for (int p=2; p<=n; p++) if (prime[p]) allPrimes.push_back(p); } // Function to find all result of factorial number ull factorialDivisors(ull n) { sieve(n); // create sieve // Initialize result ull result = 1; // find exponents of all primes which divides n // and less than n for (int i=0; i < allPrimes.size(); i++) { // Current divisor ull p = allPrimes[i]; // Find the highest power (stored in exp)' // of allPrimes[i] that divides n using // Legendre's formula. ull exp = 0; while (p <= n) { exp = exp + (n/p); p = p*allPrimes[i]; } // Multiply exponents of all primes less // than n result = (result*(exp+1))%m; } // return total divisors return result; } // Driver program to run the cases int main() { int n; cin>>n; cout << factorialDivisors(n); return 0; }
a.cc:9:1: error: 'll' does not name a type; did you mean 'ull'? 9 | ll m=1000000000+7; | ^~ | ull a.cc: In function 'ull factorialDivisors(ull)': a.cc:65:35: error: 'm' was not declared in this scope 65 | result = (result*(exp+1))%m; | ^
s427259349
p03828
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <map> #include <prettyprint.hpp> typedef long long ll; using namespace std; static const ll mod = 1000000007; bool is_prime(ll N){ ll i=2; while(i*i<N){ if(N % i == 0){ return false; }else{ i ++; } } if(N % i == 0){ return false; } return true; } template<typename T> vector<T> divisor(T N){ vector<T> divisors_list; T i = 1; for(i = 1;i*i<N;i++){ if(N % i == 0){ divisors_list.emplace_back(i); divisors_list.emplace_back(N / i); } } if(N % i == 0){ divisors_list.emplace_back(i); } return divisors_list; } template<typename T> map<T, T> prime_factor(T N){ map<T, T> res; ll i = 2; for(i=2;i*i<=N;i++){ while(N%i==0){ ++res[i]; N /= i; } } if(N!=1){ res[N] = 1; } return res; } int main(){ ll N, a, b, c, gcd_num; scanf("%lld", &N); map<ll, ll> total_res; if(N==1){ printf("1\n"); }else{ for(ll i=2;i<=N;i++){ map<ll, ll> res = prime_factor(i); for(const auto &[key, value]:res){ total_res[key]; total_res[key] += value; } } ll ans =1; for(const auto &[key,value]:total_res){ ans *= (value + 1); ans %= mod; } printf("%lld\n", ans); } return 0; }
a.cc:6:10: fatal error: prettyprint.hpp: No such file or directory 6 | #include <prettyprint.hpp> | ^~~~~~~~~~~~~~~~~ compilation terminated.
s754079694
p03828
C++
//int a = stoi(c); 文字列をintへ //小文字から大文字 //transform(a.begin(), a.end(), a.begin(), ::toupper); //途中の出力をそのまま残さない //数値計算 個数以外はdouble //map<キー,値> p は辞書。p[キー] = 値 //map 全探索 //auto begin = p.begin(), end = p.end(); //for (auto it = begin; it != end; it++) {} //mapのキー:it->first mapのバリュー:it->second //絶対値 abs() //入力は空白で切れる //大文字判定 isupper(文字) 小文字判定 islower(文字) //do{}while(next_permutation(ALL(配列))) //while(N)で回すとき、Nはコピーを作っておく //小文字に対応する文字コード:S[i] - 'a' //文字コード→小文字:(char)(数字+'a') //グラフの距離:隣接行列で扱う //等価なものに変換する思考 //bool型 初期値はTrue //島渡りの問題:中間ノードに着目 //配列はvector<>を使う:意味わからないエラーがなくなる。 //背反な事象にちゃんとわける //チェックリストはマップを使う //数が大きい時の比較はstring型で行う //全て0になったか調べたい->0になるたびにcntする //またはかかつか //例外処理は最初にする #include <bits/stdc++.h> #define rep(i,N) for(int i = 0; i < N;i++) #define ALL(a) (a).begin(),(a).end() #define ll long long int using namespace std; //円周率 const double PI = 3.14159265358979323846; //割るやつ const ll M = (pow(10, 9) + 7); // K進数でのNの桁数 ll dig(ll N, ll K) { ll dig = 0; while (N) { dig++; N /= K; } return dig; } // a,bの最大公約数 ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a%b); } ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; } //nC2の計算 ll C(ll N) { return N * (N - 1) / 2; } //階乗計算 ll f(ll n) { if (n == 0 || n == 1) return 1; else return (n * f(n - 1)) % M; } //素数判定 bool prime(ll num){ if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2){ if (num % i == 0) return false; } return true; } int main() { ll N; cin >> N; map<ll, ll> p; for (ll n = 1; n <= N; n++) { for (ll d = 1; d <= n; d++) { if (prime(d) && n%d == 0) { ll tmp = n; while (1) { p[d]++; tmp /= d; if (tmp %d != 0)break; } } } } ll ans = 1; auto begin = p.begin(), end = p.end(); for (auto it = begin; it != end; it++) {ac ans *= (it->second + 1); ans %= M; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:102:49: error: 'ac' was not declared in this scope 102 | for (auto it = begin; it != end; it++) {ac | ^~
s768949461
p03828
C++
//int a = stoi(c); 文字列をintへ //小文字から大文字 //transform(a.begin(), a.end(), a.begin(), ::toupper); //途中の出力をそのまま残さない //数値計算 個数以外はdouble //map<キー,値> p は辞書。p[キー] = 値 //map 全探索 //auto begin = p.begin(), end = p.end(); //for (auto it = begin; it != end; it++) {} //mapのキー:it->first mapのバリュー:it->second //絶対値 abs() //入力は空白で切れる //大文字判定 isupper(文字) 小文字判定 islower(文字) //do{}while(next_permutation(ALL(配列))) //while(N)で回すとき、Nはコピーを作っておく //小文字に対応する文字コード:S[i] - 'a' //文字コード→小文字:(char)(数字+'a') //グラフの距離:隣接行列で扱う //等価なものに変換する思考 //bool型 初期値はTrue //島渡りの問題:中間ノードに着目 //配列はvector<>を使う:意味わからないエラーがなくなる。 //背反な事象にちゃんとわける //チェックリストはマップを使う //数が大きい時の比較はstring型で行う //全て0になったか調べたい->0になるたびにcntする //またはかかつか //例外処理は最初にする #include <bits/stdc++.h> #define rep(i,N) for(int i = 0; i < N;i++) #define ALL(a) (a).begin(),(a).end() #define ll long long int using namespace std; //円周率 const double PI = 3.14159265358979323846; //割るやつ const ll M = (pow(10, 9) + 7); // K進数でのNの桁数 ll dig(ll N, ll K) { ll dig = 0; while (N) { dig++; N /= K; } return dig; } // a,bの最大公約数 ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a%b); } ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; } //nC2の計算 ll C(ll N) { return N * (N - 1) / 2; } //階乗計算 ll f(ll n) { if (n == 0 || n == 1) return 1; else return (n * f(n - 1)) % M; } //素数判定 bool prime(ll num){ if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2){ if (num % i == 0) return false; } return true; } int main() { ll N; cin >> N; map<ll, ll> p; for (ll n = 1; n <= N; n++) { for (ll d = 1; d <= n; d++) { if (prime(d) && n%d == 0) { ll tmp = n; while (1) { p[d]++; tmp /= d; if (tmp %d != 0)break; } } } } ll ans = 1; auto begin = p.begin(), end = p.end(); for (auto it = begin; it != end; it++) {ac ans *= (it->second + 1); ans %= M; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:102:49: error: 'ac' was not declared in this scope 102 | for (auto it = begin; it != end; it++) {ac | ^~
s652863297
p03828
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<string> vs; typedef vector<bool> vb; typedef vector<char> vc; typedef vector<vector<int>> vvi; typedef vector<vector<string>> vvs; typedef vector<vector<char>> vvc; typedef vector<vector<bool>> vvb; typedef pair<int,int> P; #define vrep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} //配列vにn個の要素を入力する #define rep(i, l, n) for (int i = l; i < (int)(n); i++) #define repn(i, l, n) for (int i = l; i <= (int)(n); i++) const int mod = 1000000007; int main(){ int n; cin >> n; vector<ll> v(1001); repn(i, 2, n){ int x = i; repn(j, 2, i){ while(x%j==0){ v[j]++; x /= j; } } } ll ans = 1; rep(i, 0, v.size()){ ans = (ans * (v[i] + 1)) % mod; } cout << ans }
a.cc: In function 'int main()': a.cc:38:16: error: expected ';' before '}' token 38 | cout << ans | ^ | ; ...... 42 | } | ~
s449373921
p03828
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a=1; cin >> n; for(int i=0;i<n;i++) a*=i+1; //aの約数の数を求める vector<int> x(a); int b=a; for(int i=2;i<a;i++){ while(b%i==0){ b/=i; x.at(i)++; } } long long int p=1; for(int i=0;i<a;i++){ p*=x.at(i)+1; p=p%1000000007; cout << p%1000000007 << endl; }
a.cc: In function 'int main()': a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s011560367
p03828
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a=1; cin >> n; for(int i=0;i<n;i++) a*=i+1; //aの約数の数を求める vector<int> x(a); int b=a; for(int i=2;i<a;i++){ while(b%i==0){ b/=i; x.at(i)++; } } long long int p=1; for(int i=0;i<a;i++){ p*=x.at(i)+1; p=p%1000000007 cout << p%1000000007 << endl; }
a.cc: In function 'int main()': a.cc:26:19: error: expected ';' before 'cout' 26 | p=p%1000000007 | ^ | ; 27 | 28 | cout << p%1000000007 << endl; | ~~~~ a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s614063009
p03828
C
#include <stdio.h> #define a (int)(1e9 + 7) int fn(int b,int c){ if(N<p){ return 0; } else{ return fn(p, N/p) + N/p; } } int main(){ int N,i,j; long long int num=1; scanf("%d",&N); int p[N+1]; for(i=0;i<=N;i++){ p[i] = i; } for(i=2;i<=N;i++){ if(p[i]!=0){ for(j=1;i*j<=N;j++){ p[i*j]=0; } num=(num*(fn(i,N)+1))%a; } } printf("%d\n",num); }
main.c: In function 'fn': main.c:5:12: error: 'N' undeclared (first use in this function) 5 | if(N<p){ | ^ main.c:5:12: note: each undeclared identifier is reported only once for each function it appears in main.c:5:14: error: 'p' undeclared (first use in this function) 5 | if(N<p){ | ^
s843479368
p03828
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000000007LL; string abc="abcdefghijklmnopqrstuvwxyz"; string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //約数の列挙O(√n) map<ll,ll>M; void divisor(ll n){ for(int i=1;i*i<=n;i++){ if(n%i==0){ M[i]++; if(i != n/i) M[n/i]++; } } return; } int main(){ ll n;cin>>n; map<ll,ll>M; for(int i=1;i<=n;i++){ void divisor(i); } ll ans=1; for(auto p:M){ ans*=p.second+1; ans%=MOD; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:33:10: error: variable or field 'divisor' declared void 33 | void divisor(i); | ^~~~~~~
s136842390
p03828
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000000007LL; string abc="abcdefghijklmnopqrstuvwxyz"; string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //約数の列挙O(√n) map<ll,ll>M; void divisor(int n){ for(int i=1;i*i<=n;i++){ if(n%i==0){ M[i]++; if(i != n/i) M[n/i]++; } } return res; } int main(){ ll n;cin>>n; map<ll,ll>M; for(int i=1;i<=n;i++){ void divisor(i); } ll ans=1; for(auto p:M){ ans*=p.second+1; ans%=MOD; } cout<<ans<<endl; }
a.cc: In function 'void divisor(int)': a.cc:26:10: error: 'res' was not declared in this scope; did you mean 'rep'? 26 | return res; | ^~~ | rep a.cc: In function 'int main()': a.cc:33:10: error: variable or field 'divisor' declared void 33 | void divisor(i); | ^~~~~~~
s539343308
p03828
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll a, n; in(n); vector<ll> c(1000, 1); rep(j, n){ m = n - j; rep2(i, 2, 1000){ while(m % i == 0){ c[i]++; n = m / i; } } } a = 1; rep(i, 1000) a = a * c[i] % mei; out(a); memi; }
a.cc: In function 'int main()': a.cc:22:5: error: 'm' was not declared in this scope 22 | m = n - j; | ^
s646487668
p03828
Java
package AtCoderBeginnerContest052; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; public class C2 { // public class Main { static void solve() { int n = nextInt(); // map: 数値 -> (素因数) // ex) // 2 -> (2) // 4 -> (2,2) // 12 -> (2,2,3) Map<Integer, List<Integer>> map = primeFactorizeTo(n); Map<Integer, Integer> allFactors = new HashMap<>(); for (List<Integer> ll : map.values()) { for (Integer i : ll) { if (!allFactors.containsKey(i)) allFactors.put(i, 0); allFactors.put(i, allFactors.get(i) + 1); } } // System.out.println(allFactors); long ans = 1; for (Integer i : allFactors.values()) { ans = ans * (i + 1) % MOD; } out.println(ans); } static final int MOD = 1_000_000_007; static long[] fac, finv, inv; // map: 数値 -> (素因数) // ex) // 2 -> (2) // 4 -> (2,2) // 12 -> (2,2,3) static Map<Integer, List<Integer>> primeFactorizeTo(int n) { Map<Integer, List<Integer>> map = new HashMap<>(); for (int i = 2; i <= n; i++) { List<Integer> list = new ArrayList<>(); int tmp = i; for (int j = i - 1; j > 1; j--) { if (tmp % j == 0) { if (map.containsKey(j)) { list.addAll(map.get(j)); } else { list.add(j); } tmp /= j; } } if (tmp != 1) list.add(tmp); map.put(i, list); } return map; } // 階乗(n!) static long factorial(long n) { long ans = 1; for (long i = n; i > 0; i--) { ans = ans * i % MOD; } return ans; } // nCkの初期化 static void comInit(int max) { fac = new long[max]; finv = new long[max]; inv = new long[max]; fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < max; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // nCkの計算 static long com(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } static PrintWriter out; static Scanner sc; static int[][] newIntArray(int h, int w, int value) { int[][] ret = new int[h][w]; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { ret[i][j] = value; } } return ret; } static int nextInt() { return Integer.parseInt(sc.next()); } static long nextLong() { return Long.parseLong(sc.next()); } static String nextString() { return sc.next(); } static int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = nextInt(); } return a; } static long[] nextLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) { a[i] = nextLong(); } return a; } static List<Integer> nextIntList(int n) { List<Integer> list = new ArrayList<>(); for (int i = 0; i < n; i++) { list.add(nextInt()); } return list; } static List<Double> nextDoubleList(int n) { List<Double> list = new ArrayList<>(); for (int i = 0; i < n; i++) { list.add((double) nextInt()); } return list; } static List<Long> nextLongList(int n) { List<Long> list = new ArrayList<>(); for (int i = 0; i < n; i++) { list.add(nextLong()); } return list; } static char[][] nextCharArray(int h, int w) { char[][] c = new char[h][w]; for (int i = 0; i < h; i++) { String str = nextString(); for (int j = 0; j < w; j++) { c[i][j] = str.charAt(j); } } return c; } static <T extends Comparable<? super T>> void sort(List<T> list) { Collections.sort(list); } // greatest common divisor // 最大公約数 static long gcd(long a, long b) { if (b == 0) { return a; } return gcd(b, a % b); } // least common multiple // 最小公倍数 static long lcm(long a, long b) { if (a >= b && a % b == 0) return a; if (b > a && b % a == 0) return b; if (a > b) { return (a / gcd(a, b)) * b; } else { return (b / gcd(a, b)) * a; } // return a * b / gcd(a, b); } // baseのn乗を計算を返す static int pow(int base, int n) { int ret = 1; for (int i = 0; i < n; i++) { ret *= base; } return ret; } // return n^k mod m static long powMod(long n, long k, long m) { if (k == 0) { return 1; } else if (k % 2 == 1) { return powMod(n, k - 1, m) * n % m; } else { long tmp = powMod(n, k / 2, m); return tmp * tmp % m; } } // intをlength桁のbit文字列に変換 static String toBitString(int length, int n) { StringBuilder sb = new StringBuilder(); for (int i = length - 1; i >= 0; i--) { if ((n >> i) % 2 == 1) { sb.append("1"); } else { sb.append("0"); } } return sb.toString(); } public static void main(String[] args) { out = new PrintWriter(System.out); sc = new Scanner(System.in); solve(); out.flush(); sc.close(); } }
Main.java:11: error: class C2 is public, should be declared in a file named C2.java public class C2 { ^ 1 error
s547228792
p03828
C++
#include<bits/stdc++.h> using namespace std; const int MAX = 1000000007 bool prime(int n) { for(int i = 2; i*i <= n; i++) if(n % i == 0) return false; return true; } vector<int> p(int n) { vector<int> temp; for(int i = 2; i < n; i++) if(prime(i)) temp.push_back(i); return temp; } int ex(int i, int n) { int res = 0; for(int j = 1; pow(i, j) <= n; j++) { res += n/pow(i, j); } return res; } int main() { int n; cin>>n; vector<int> prime = p(n); int res = 1; for(int i = 0; i < prime.size(); i++) res *= (ex(prime[i], n)+1) % MAX; cout<<res<<"\n"; return 0; }
a.cc:6:1: error: expected ',' or ';' before 'bool' 6 | bool prime(int n) | ^~~~ a.cc: In function 'std::vector<int> p(int)': a.cc:18:16: error: 'prime' was not declared in this scope 18 | if(prime(i)) | ^~~~~
s407197236
p03828
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; long long ans = 1; const long num = 1000000007; int i,j; const int sosList[11] = {2,3,5,7,11,13,17,19,23,27,31} int sos[n+1] = {}; for(i=2;i<=n;i++){ int tmp = i; for(j=0;j<11;j++){ while(tmp%sosList[j]==0){ sos[sosList[j]]++; tmp/=sosList[j]; } } sos[tmp]++; } for(i=2;i<=n;i++){ ans*=sos[i]+1; ans=ans%num; } cout << ans; }
a.cc: In function 'int main()': a.cc:10:9: error: expected ',' or ';' before 'int' 10 | int sos[n+1] = {}; | ^~~ a.cc:15:33: error: 'sos' was not declared in this scope; did you mean 'cos'? 15 | sos[sosList[j]]++; | ^~~ | cos a.cc:19:17: error: 'sos' was not declared in this scope; did you mean 'cos'? 19 | sos[tmp]++; | ^~~ | cos a.cc:22:22: error: 'sos' was not declared in this scope; did you mean 'cos'? 22 | ans*=sos[i]+1; | ^~~ | cos
s664124368
p03828
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; long long ans = 1; const long num = 1000000007; int i,j; int sos[11]={}; //2,3,5,7,11,13,17,19,23,29,31 const int sosList[11] = {2,3,5,7,11,13,17,19,23,29,31]; for(i=1;i<=n;i++){ sos = {}; for(j=0;j<11;j++){ int tmp = i; while(tmp%sosList[j]==0){ sos[j]++; tmp/=sosList[j]; } } for(j=0;j<11;j++){ ans *= sos[j]; ans = ans%num; } } cout << ans; }
a.cc: In function 'int main()': a.cc:10:62: error: expected '}' before ']' token 10 | const int sosList[11] = {2,3,5,7,11,13,17,19,23,29,31]; | ~ ^ a.cc:10:62: error: expected ',' or ';' before ']' token a.cc:12:21: error: assigning to an array from an initializer list 12 | sos = {}; | ~~~~^~~~
s937337488
p03828
C++
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <cmath> #include <map> typedef long long ll; #define rep(i,a,b) for(int i=a;i<b;++i) #define rrep(i,a,b) for(int i=a;i>=b;--i) using namespace std; ll mod = 1e9 + 7; int A,B; //int x[111]; ll coudp[111][111][5555]; string divide[4] = { "dream","dreamer","erase","eraser" }; int N; map<int, int> mp; int main() { cin >> N; for (int i = 2; i <= N; i++) { int x = i; for (int j = 2; j <= x; j++) { while (x % j == 0) { x /= j; mp[j]++; } } } ll ans = 1; for (auto x : mp) { ans = ((ans % mod) * (x.second + 1) *%mod) % mod; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:54: error: expected primary-expression before '%' token 39 | ans = ((ans % mod) * (x.second + 1) *%mod) % mod; | ^
s837430115
p03828
C++
# include <iostream> using namespace std; int num[1005]; void gen(int x){ for (int i = 2; i < N; i++){ while (x % i == 0){ num[i]++; x /= i; } } int main(void){ cin >> N; int res = 1; for (int j = 2; j<= N; j++) gen(j); for (int k = 1; k<= N; k++) res = res* (num[i]+1); cout << res << endl; }
a.cc: In function 'void gen(int)': a.cc:6:25: error: 'N' was not declared in this scope 6 | for (int i = 2; i < N; i++){ | ^ a.cc:13:15: error: a function-definition is not allowed here before '{' token 13 | int main(void){ | ^ a.cc:22:2: error: expected '}' at end of input 22 | } | ^ a.cc:5:16: note: to match this '{' 5 | void gen(int x){ | ^
s103396614
p03828
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; typedef long long ll; bool prime(int n){ bool y=true; if(n == 1){ y = false; } else { for(int i=2;i<n;i++){ if(n%i == 0){ y = false; break; } } } return y; } int func(int n,int i){ int ans = 0; if(prime(i)){ if(n%i == 0 && i <= n){ int k = n; while(k >0){ ans++; k /= i; if(k%i != 0){ break; } } } } return ans; } int main() { int n; cin >> n; ll ans = 1; vector<int> a(1001); for(int i=2;i<=n;i++){ for(int j=2;j<=i;j++){ a.at(j) += func(i,j); } } for(int i=1;i<1001;i++){ ans *= (a.at(i) +1); ans %= 1000000007 } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:51:22: error: expected ';' before '}' token 51 | ans %= 1000000007 | ^ | ; 52 | } | ~
s081439689
p03828
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; typedef long long ll; bool prime(int n){ bool y=true; if(n == 1){ y = false; } else { for(int i=2;i<n;i++){ if(n%i == 0){ y = false; break; } } } return y; } int func(int n,int i){ int ans = 0; if(prime(i) && n%i == 0){ int k = n; while(k >0){ ans++; k /= i; } } return ans; } int main() { int n; cin >> n; ll ans = 1; vector<int> a(1001) for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ a.at(j) += func(i,j); } } for(int i=0;i<1001;i++){ ans *= (a.at(i) +1); } cout << ans%1000000007 << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:3: error: expected ',' or ';' before 'for' 39 | for(int i=1;i<=n;i++){ | ^~~ a.cc:39:15: error: 'i' was not declared in this scope 39 | for(int i=1;i<=n;i++){ | ^
s735029967
p03828
C++
#include<stdio.h> int main(){ int n; int cunt=0,ans=0;; scanf("%d",&n); for (int i=1;i<=n;++i) { if (n%i==0)cunt++; } ans=cunt% 1e9+7; printf("%d",ans); return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: invalid operands of types 'int' and 'double' to binary 'operator%' 10 | ans=cunt% 1e9+7; | ~~~~^ ~~~ | | | | int double
s729562234
p03828
C++
#include<bits/stdc++.h> using namespace std; long long int mod = 1e9+7; unsigned long long int r = 1, k1 = 0; unordered_map<int, int> mp; unordered_map<int, int>::iterator it; void fact(int x) { for(int i = 2; i*i <=x; i++) { while(x%i == 0) { mp[i] = (m[i]+1)%mod; x = x/i; } } if(x > 1) mp[x] = (mp[x] + 1)%mod; } int main() { int n; cin>>n; for(int i = 2; i<=n;i++) { fact(i); } for(auto l : mp) { r *= (l.second +1)%mod; r = r%mod; } cout<<r<<endl; }
a.cc: In function 'void fact(int)': a.cc:16:16: error: 'm' was not declared in this scope 16 | mp[i] = (m[i]+1)%mod; | ^
s323720115
p03828
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main(){ int n,ans=1; vector<int> v(n); cin>>n; rep(i,n) v[i]=0; for(int i=1;i<=n;i++){ int k=i; for(int j=2;j<=i){ while(k%j==0){ v[j-1]++; k/=j; } } } for(int i=1;i<n;i++){ ans*=v[i]; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:11:21: error: expected ';' before ')' token 11 | for(int j=2;j<=i){ | ^ | ;
s522240696
p03828
C++
#include <iostream> #include <vector> #include <cmath> vector <bool> eratos(50,true); using namespace std; int main(){ //eratos; eratos[0] = false; eratos[1] = false; for(int i = 0; i < 50; i++){ if(eratos[i] == true){ for(int j = 2; i*j < 50; j++) eratos[i*j] = false; } } long long int N; cin >> N; map<long long int,long long int> m; long long int ans = 1; for(long long int i = N; i >= 1; i--){ for(long long int j = 1; j < eratos.size(); j++){ long long int tmp = 0; if(!eratos[j])continue; if(i % eratos != 0) continue; else{ long long int d = j; while(i % d == 0){ tmp += 1;  d *= j; } m[j] += tmp; } } } for(auto iter = m.begin(), m != m.end(), m++){ ans *= (iter->sencond + 1LL) % 1000000009; } cout << ans; }
a.cc:32:9: error: extended character   is not valid in an identifier 32 |  d *= j; | ^ a.cc:5:1: error: 'vector' does not name a type 5 | vector <bool> eratos(50,true); | ^~~~~~ a.cc: In function 'int main()': a.cc:11:3: error: 'eratos' was not declared in this scope 11 | eratos[0] = false; | ^~~~~~ a.cc:21:3: error: 'map' was not declared in this scope 21 | map<long long int,long long int> m; | ^~~ a.cc:4:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' 3 | #include <cmath> +++ |+#include <map> 4 | a.cc:21:7: error: expected primary-expression before 'long' 21 | map<long long int,long long int> m; | ^~~~ a.cc:32:9: error: '\U00003000d' was not declared in this scope 32 |  d *= j; | ^~~ a.cc:34:8: error: 'm' was not declared in this scope 34 | m[j] += tmp; | ^ a.cc:39:19: error: 'm' was not declared in this scope 39 | for(auto iter = m.begin(), m != m.end(), m++){ | ^ a.cc:41:4: error: expected ';' before 'cout' 41 | } | ^ | ; 42 | cout << ans; | ~~~~ a.cc:43:1: error: expected primary-expression before '}' token 43 | } | ^ a.cc:42:15: error: expected ')' before '}' token 42 | cout << ans; | ^ | ) 43 | } | ~ a.cc:39:6: note: to match this '(' 39 | for(auto iter = m.begin(), m != m.end(), m++){ | ^ a.cc:43:1: error: expected primary-expression before '}' token 43 | } | ^
s960452404
p03828
C++
#include <iostream> using namesapce std; long long F(int x){ if (x=0) return 1; else if (x=1) return 1; else return (x-2)+(x-1); } int main(){ int N; cin>>N; const int MOD =1000000007; long long ans=0; ans=F(N); cout<<ans%MOD<<endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namesapce' 2 | using namesapce std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | 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 input | ^~~ a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | cout<<ans%MOD<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:14:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 14 | cout<<ans%MOD<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s814271677
p03828
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long[] dp = new long[n+1]; long count = 0; for(int i = 1;i <= n;i++){ for(int j = 1;j <= i;j++){ if(i%j==0)count++; } dp[i] = (dp[i-1]+count)%1000000007; } System.out.println(dp[n]); } }
Main.java:6: error: incompatible types: possible lossy conversion from long to int long[] dp = new long[n+1]; ^ Main.java:14: error: incompatible types: possible lossy conversion from long to int System.out.println(dp[n]); ^ 2 errors
s972033379
p03828
C++
import java.util.* fun main(args: Array<String>) { val sc = Scanner(System.`in`) val n = sc.nextInt() val isPrime = mutableList<Boolean>(n + 1, true) for(i in 2..n) if(isPrime[i]) { for(j in (i * 2)..n step i) isPrime[j] = false } var divisorCount = 1L for(i in 2..n) if(isPrime[i]) { var factorCount = 1 var power = i while(power <= n) { factorCount += n / power power *= i } divisorCount *= factorCount divisorCount %= 1000000007 } println(divisorCount) }
a.cc:4:29: error: stray '`' in program 4 | val sc = Scanner(System.`in`) | ^ a.cc:4:32: error: stray '`' in program 4 | val sc = Scanner(System.`in`) | ^ a.cc:7:14: error: too many decimal points in number 7 | for(i in 2..n) if(isPrime[i]) { | ^~~~ a.cc:11:14: error: too many decimal points in number 11 | for(i in 2..n) if(isPrime[i]) { | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.* | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s877653204
p03828
C++
#include<iostream> #include<algorithm> #define int long long #define rep(s,i,n) for(int i=s;i<n;i++) using namespace std; bool p(int n){ int sum=0; for(int i=2;i<n;i++){ if(n%i==0){ sum++; } } if(sum==0){ return true; } else{ return false; } } int pr[168]; signed main(){ int n; cin>>n; int sum=0; int ans=1; int n1=n; rep(2,i,1000){ if(p(i)==1){ pr[sum]=i; sum++; } } rep(0,i,168){ sum=1; n=n1; rep(0,j,10){ sum+=n/pr[i]; n=n/pr[i]; } ans*=sum; ans=ans%1000000007; } cout<<ans<<endl; } v
a.cc:45:1: error: 'v' does not name a type 45 | v | ^
s506671022
p03828
C++
using System; using System.Collections.Generic; namespace ProgrammingContest { class HashMap<K, V> : Dictionary<K, V> { public V this[K key] { get { V v; return TryGetValue(key, out v) ? v : base[key] = default(V); } set { base[key] = value; } } } class Program { private int N; private long Mod = 1000000007; public void Solve() { N = int.Parse(Console.ReadLine()); var hm = new HashMap<int, int>(); for (int i = 2; i <= N; i++) { int cpi = i; for (int j = 2; j * j <= cpi; j++) { while (cpi % j == 0) { //Console.WriteLine($"{cpi} {j}"); hm[j]++; cpi /= j; } } //Console.WriteLine($"{cpi} {i}"); if (cpi > 1) { hm[cpi]++; } } long ans = 1; foreach (KeyValuePair<int, int> keyValuePair in hm) { //Console.WriteLine($"{keyValuePair.Value} {keyValuePair.Key}"); ans *= keyValuePair.Value + 1; ans %= Mod; } Console.WriteLine(ans); } static void Main(string[] args) { new Program().Solve(); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:6:11: error: 'HashMap' is not a class template 6 | class HashMap<K, V> : Dictionary<K, V> | ^~~~~~~ a.cc:6:19: error: 'K' was not declared in this scope 6 | class HashMap<K, V> : Dictionary<K, V> | ^ a.cc:6:22: error: 'V' was not declared in this scope 6 | class HashMap<K, V> : Dictionary<K, V> | ^ a.cc:6:37: error: expected template-name before '<' token 6 | class HashMap<K, V> : Dictionary<K, V> | ^ a.cc:6:37: error: expected '{' before '<' token a.cc:6:37: error: expected unqualified-id before '<' token a.cc:21:16: error: expected ':' before 'int' 21 | private int N; | ^~~~ | : a.cc:23:16: error: expected ':' before 'long' 23 | private long Mod = 1000000007; | ^~~~~ | : a.cc:25:15: error: expected ':' before 'void' 25 | public void Solve() | ^~~~~ | : a.cc:61:26: error: 'string' has not been declared 61 | static void Main(string[] args) | ^~~~~~ a.cc:61:35: error: expected ',' or '...' before 'args' 61 | static void Main(string[] args) | ^~~~ a.cc:65:6: error: expected ';' after class definition 65 | } | ^ | ; a.cc: In member function 'void ProgrammingContest::Program::Solve()': a.cc:27:17: error: expected primary-expression before 'int' 27 | N = int.Parse(Console.ReadLine()); | ^~~ a.cc:28:13: error: 'var' was not declared in this scope 28 | var hm = new HashMap<int, int>(); | ^~~ a.cc:38:25: error: 'hm' was not declared in this scope 38 | hm[j]++; | ^~ a.cc:46:21: error: 'hm' was not declared in this scope 46 | hm[cpi]++; | ^~ a.cc:51:22: error: 'KeyValuePair' was not declared in this scope 51 | foreach (KeyValuePair<int, int> keyValuePair in hm) | ^~~~~~~~~~~~ a.cc:51:35: error: expected primary-expression before 'int' 51 | foreach (KeyValuePair<int, int> keyValuePair in hm) | ^~~ a.cc:51:40: error: expected primary-expression before 'int' 51 | foreach (KeyValuePair<int, int> keyValuePair in hm) | ^~~ a.cc:51:13: error: 'foreach' was not declared in this scope 51 | foreach (KeyValuePair<int, int> keyValuePair in hm) | ^~~~~~~ a.cc:58:13: error: 'Console' was not declared in this scope 58 | Console.WriteLine(ans); | ^~~~~~~ a.cc: In static member function 'static void ProgrammingContest::Program::Main(int*)': a.cc:63:26: error: expected ';' before '.' token 63 | new Program().Solve(); | ^
s498336936
p03828
C++
#include<iostream> #include<string> #include<cmath> #include<map> #include<vector> using namespace std; typedef long long ll; const ll MOD = 1e9 + 7; int main(){ int N; cin >> N; ll ans = 1; vector<ll> mp(N + 10,0); vector<ll> prime; for(ll i = 2; i <= N; i++){ //N以下の素数を列挙する bool flag = true; ll c = (ll) sqrt((double) i); for(ll j = 2; j <= c; j++){ if( i % j == 0){ flag = false;}} //iが√iまでのいずれかの数字で割り切れたら、iは素数ではない if(flag){ prime.push_back(i);} } int s = prime.size() ; for(ll i = 1; i <= N; i++){ //N以下の数を全て素因数分解 for(int j = 0; j < s; j++){ ll Quote = prime[j]; //iがQuoteで何回割れるのか調べる(Quoteは列挙した全ての素数を動く) ll k = i; while( k % Quote == 0){ k /= Quote; mp[Quote]++;} } //i の素因数分解終了 }
a.cc: In function 'int main()': a.cc:35:4: error: expected '}' at end of input 35 | } | ^ a.cc:13:11: note: to match this '{' 13 | int main(){ | ^
s277092590
p03828
C++
#include <iostream> #include <map> using namespace std; void prime_factor(int n, map<long long int, long long int>& res) { for (int i = 2; i * i <= n; i++) { while (n % i == 0) { ++res[i]; n /= i; } } if (n != 1) { if (res[n] > 0) res[n]++; else res[n] = 1; } } int main() { long long int N; long long int ans = 1; map<long long int, long long int> count; cin >> N; for (int i = 2; i <= N; i++) { prime_factor(i, count); } for (int i = 2; i <= N; i++) { ans *= (count[i] + 1); ans %= (int)(pow(10, 9) + 7); } cout << ans<< endl; return 0; }
a.cc: In function 'int main()': a.cc:44:30: error: 'pow' was not declared in this scope 44 | ans %= (int)(pow(10, 9) + 7); | ^~~
s299086486
p03828
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) long long inf=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace std; long long gcd(long long a, long long b){ if(a<b){ swap(a,b); } if(a%b==0){ return b; }else{ return gcd(b,a%b); } } long long lcm(long long x, long long y){ return (x/gcd(x,y))*y; } class UnionFind { public: //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。 vector<int> Parent; //クラスを作るときは、Parentの値を全て-1にする。 //以下のようにすると全てバラバラの頂点として解釈できる。 UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)];//先祖をrootで取っておきたい。 } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらAとBをひっくり返す。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; bool prime(int n){ if(n==1){ return false; }else if(n==2){ return true; }else{ for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } } int main(){ vector<int> primes; for(int i=2;i<1010;i++){ if(prime(i)){ primes.push_back(i); } } vector<int> e(primes.size(),0); int n; for(int i=2;i<=n;i++){ for(int j=0;j<primes.size();j++){ while(i%primes[j]==0){ i /= primes[j]; e[j]++; } } } long long ans=1; REP(i,primes.size()){ ans = mod(ans *(e[j]+1)); } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:106:23: error: 'j' was not declared in this scope 106 | ans = mod(ans *(e[j]+1)); | ^
s084305611
p03828
C++
#include <vector> #include <queue> #include <algorithm> #include <iostream> #include <string> #include <tuple> #include <set> #include <map> #include <complex> #include <iomanip> #include <cmath> using namespace std; typedef unsigned long long ll; int main() { int n, cnt = 0; cin >> n; int s[n + 1]; memset(s, 0, sizeof(s) + 1); for (int i = 2; i <= n; i++) { int tmp = i; for (int j = 2; j <= i; j++) { while(!(tmp % j)) { s[j]++; tmp /= j; } } } ll ans = 1; for (int i = 0; i <= n; i++) ans *= s[i] + 1; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:20:3: error: 'memset' was not declared in this scope 20 | memset(s, 0, sizeof(s) + 1); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include <cmath> +++ |+#include <cstring> 12 | using namespace std;
s229136094
p03828
C++
#include <bits/stdc++.h> using namespace std; int main() { long int n,x; bool prime=1; cin>>n; x=0; vector<long int> a(1000,1001); vector<long int> b(1000,1); for(int i=2;i<=n;i++){ for(int j=0;j<1000;j++){ if(i%a.at(j)==0){ b.at(j)++; prime*0; break; } else if(a.a(j)=1001)break; } if(prime==1){ a.at(x)=i; x++; } prime=1; } for(int i=0;i<n;i++){ ans*=b.at(i) if(ans>=1000000007)ans%=1000000007; } }
a.cc: In function 'int main()': a.cc:19:17: error: 'class std::vector<long int>' has no member named 'a'; did you mean 'at'? 19 | else if(a.a(j)=1001)break; | ^ | at a.cc:28:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 28 | ans*=b.at(i) | ^~~ | abs
s933225004
p03828
C++
#include <iostream> #include <string> #include <vector> #include <stack> #include <map> #include <set> #include <algorithm> #include <numeric> #include <math.h> #include <stdio.h> #include <ctype.h> #include <ios> #include <iomanip> using namespace std; #define N_MAX (100000) #define LL_MAX_NUM (1LL<<60) #define INF 1e7 typedef long long ll; typedef long long int lli; int main() { int N, res; cin >> N; ll ans = 1; res = 0; for (int i = N; i >= 1; i--) ans *= i; for (ll i = ans; i >= 1; i--) { if (ans % i == 0) { res++; } } cout << res%INF << endl; return 0; }
a.cc: In function 'int main()': a.cc:35:20: error: invalid operands of types 'int' and 'double' to binary 'operator%' 35 | cout << res%INF << endl; | ~~~^ | | | int
s603938467
p03828
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin>>n; long long ans=1; for(int i=1;i<=n;i++){ ans=i%(1e9+7); } cout<<ans; }
a.cc: In function 'int main()': a.cc:10:14: error: invalid operands of types 'int' and 'double' to binary 'operator%' 10 | ans=i%(1e9+7); | ~^~~~~~~~ | | | | int double
s920639381
p03828
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n; cin>>n; long long ans=1; for(int i=1;i<=n;i++){ ans=i%(1e9+7) } cout<<ans; }
a.cc: In function 'int main()': a.cc:10:14: error: invalid operands of types 'int' and 'double' to binary 'operator%' 10 | ans=i%(1e9+7) | ~^~~~~~~~ | | | | int double
s706772900
p03828
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <algorithm> #include <vector> using namespace std; #define REP(i, n) for(int (i)=0; (i)<(n); (i)++) #define COUT(a) cout << (a); #define ENDL cout << "\n"; int main(int argc, char *argv[]) { int n,count=0; scanf("%d",&n); long long a =1; for(int i=1;i<=n;i++) a*=i; for(int i=1;i<=a;i++) if(a%i==0) { ++count; count=count%(1e9+7); } COUT(count) return 0; }
a.cc: In function 'int main(int, char**)': a.cc:19:20: error: invalid operands of types 'int' and 'double' to binary 'operator%' 19 | count=count%(1e9+7); | ~~~~~^~~~~~~~ | | | | int double
s042026322
p03828
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <algorithm> #include <vector> using namespace std; #define REP(i, n) for(int (i)=0; (i)<(n); (i)++) #define COUT(a) cout << (a); #define ENDL cout << "\n"; #define INF 1e9+7 int main(int argc, char *argv[]) { int n,count=0; scanf("%d",&n); long long a =1; for(int i=1;i<=n;i++) a*=i; for(int i=1;i<=a;i++) if(a%i==0) { ++count; count=count%INF; } COUT(count) return 0; }
a.cc: In function 'int main(int, char**)': a.cc:20:20: error: invalid operands of types 'int' and 'double' to binary 'operator%' 20 | count=count%INF; | ~~~~~^ | | | int
s295893236
p03828
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <algorithm> #include <vector> using namespace std; #define REP(i, n) for(int (i)=0; (i)<(n); (i)++) #define COUT(a) cout << (a); #define ENDL cout << "\n"; #define INF 10e9+7 int main(int argc, char *argv[]) { int n,count=0; scanf("%d",&n); long long a =1; for(int i=1;i<=n;i++) a*=i; for(int i=1;i<=a;i++) if(a%i==0) { ++count; count=count%INF; } COUT(count) return 0; }
a.cc: In function 'int main(int, char**)': a.cc:20:20: error: invalid operands of types 'int' and 'double' to binary 'operator%' 20 | count=count%INF; | ~~~~~^ | | | int
s092176057
p03828
C++
#include <iostream> #include <array> #include <vector> #include <iomanip> #include <string> #include <cmath> #include <algorithm> #include <queue> #include <map> #include <set> using namespace std; typedef pair<int,int> P; typedef long long LL; const LL INF=1<<31; const LL MOD=1000000007; int main(){ int n; cin>>n; vector<int> pr(n+1,1); for(int i=2;i<n;++i){ int x=i; for(int j=2;j<=i;++j){ while(x%j==0){ x/=j; pr[j]++; } } LL ans=1; for(int i=0;i<n;++i){ ans=ans%MOD*(pr[i])%MOD; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:38:2: error: expected '}' at end of input 38 | } | ^ a.cc:21:11: note: to match this '{' 21 | int main(){ | ^
s126671961
p03828
C
#include <stdio.h> int main() { int n; int prime[180]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71 ,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167 ,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269 ,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379 ,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487 ,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607 ,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727 ,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853 ,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977 ,983,991,997},int power[180]=0; scanf("%d",&n); int cpy=n; for(int i=0;i<168;i++){ while(cpy%prime[i]==0){ cpy/=prime[i]; power[i]++; } } long long ans=0; for(int i=0;i<168;i++){ ans*=(power[i]*1) ans%=1000000007; } printf("%lld",ans); return 0; }
main.c: In function 'main': main.c:14:19: error: expected identifier or '(' before 'int' 14 | ,983,991,997},int power[180]=0; | ^~~ main.c:20:13: error: 'power' undeclared (first use in this function) 20 | power[i]++; | ^~~~~ main.c:20:13: note: each undeclared identifier is reported only once for each function it appears in main.c:25:26: error: expected ';' before 'ans' 25 | ans*=(power[i]*1) | ^ | ; 26 | ans%=1000000007; | ~~~
s705549564
p03828
C++
N=int(input()) num=1 factors=[] for i in range(N,1,-1): num*=i r=2 while num!=1: x=0 while num%r==0: num//=r x+=1 if x: factors.append(x) r+=1 result=1 for i in factors: result*=i+1 print(result%1000000007)
a.cc:1:1: error: 'N' does not name a type 1 | N=int(input()) | ^
s929023680
p03828
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); #define VRSORT(v) sort(v.rbegin(), v.rend());//vectorの降順ソート #define ll long long #define pb(a) push_back(a) #define INF 1000000000 #define MOD 1000000007 #define OUT(x) cout << x << endl; using namespace std; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; map<ll, int> mp; void prime_factorization(ll n){ for (ll i = 2LL; i * i <= n; i++){ while(n % i == 0){ mp[i]++; n /= i; } } if (n != 1) mp[n]++;; } int main(){ int n; cin >> n; for(int i=1;i<=n;i++) prime_factorize(i); ll ans=1; for(auto p : mp){ (ans *= p.second + 1) %= MOD; } OUT(ans) }
a.cc: In function 'int main()': a.cc:37:25: error: 'prime_factorize' was not declared in this scope; did you mean 'prime_factorization'? 37 | for(int i=1;i<=n;i++) prime_factorize(i); | ^~~~~~~~~~~~~~~ | prime_factorization
s099886695
p03828
C++
from math import factorial N = int(input()) N = factorial(N) i = 2 num = 1 ans = 1 while N != 1: if N % i == 0: N //= i num += 1 else: i += 1 ans *= num num = 1 print(ans * num % (10**9 + 7))
a.cc:1:1: error: 'from' does not name a type 1 | from math import factorial | ^~~~
s503802468
p03828
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Atcoder { class Program { static List<int[]> list = new List<int[]>(); static int[] yMove = new int[] {-1,1,0,0}; static int[] xMove = new int[] {0,0,-1,1}; static bool[,] miz; static void Main(string[] args) { //var line1 = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); //var N = line1[0]; //var M = line1[1]; //var a = new long[M]; //var b = new long[M]; //int bridge = 0; //int[,] dag = new int[N,N]; //for (int i = 0; i < M; i++) //{ // var line2 = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); // a[i] = line2[0]-1; // b[i] = line2[1]-1; // dag[a[i], b[i]] = 1; // dag[b[i], a[i]] = 1; //} //for (int i = 0; i < M; i++) //{ // bool[] visited = new bool[N]; // dag[a[i], b[i]] = 0; // dag[b[i], a[i]] = 0; // DFS(0,visited,dag); // if (visited.Where(n => n == true).Count() != N) // { // bridge++; // } // dag[a[i], b[i]] = 1; // dag[b[i], a[i]] = 1; //} //Console.WriteLine(bridge); //var line1 = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); //var A = line1[0]; //var B = line1[1]; //var C = line1[2]; //var D = line1[3]; //var E = line1[4]; //var F = line1[5]; //var N = int.Parse(Console.ReadLine()); //char[] mozi = new char[N]; //long[] MARCH = new long[5]; //long cnt = 0; //for (int i = 0; i < N; i++) //{ // mozi[i] = Console.ReadLine().ToCharArray()[0]; //} //MARCH[0] = mozi.Where(n => n == 'M').Count(); //MARCH[1] = mozi.Where(n => n == 'A').Count(); //MARCH[2] = mozi.Where(n => n == 'R').Count(); //MARCH[3] = mozi.Where(n => n == 'C').Count(); //MARCH[4] = mozi.Where(n => n == 'H').Count(); //for (int i = 0; i < 3; i++) //{ // for (int j = i + 1; j < 4; j++) // { // for (int k = j + 1; k < 5; k++) // { // cnt += MARCH[i] * MARCH[j] * MARCH[k]; // } // } //} //Console.WriteLine(cnt); //var N = int.Parse(Console.ReadLine()); //var line1 = Array.ConvertAll(Console.ReadLine().Split(), int.Parse); //var line2 = Array.ConvertAll(Console.ReadLine().Split(), int.Parse); //int candy = 0; //int MAX = 0; //for (int i = 0; i < N; i++) //{ // for (int k = 0; k <= i; k++) // { // candy += line1[k]; // } // for (int j = N - 1; j >= i; j--) // { // candy += line2[j]; // } // MAX = Math.Max(candy,MAX); // candy = 0; //} //Console.WriteLine(MAX); //var N = int.Parse(Console.ReadLine()); //List<int[]> list = new List<int[]>(); //int t = 0; //int x = 0; //int y = 0; //for (int i = 0; i < N; i++) //{ // var txy = Array.ConvertAll(Console.ReadLine().Split(), int.Parse); // list.Add(txy); //} //foreach (var item in list) //{ // if (item[0] - t >= Math.Abs(item[1] + item[2] - x - y)) // { // if (((item[0] - t) % 2 == 1 && Math.Abs(x + y - item[1] - item[2]) % 2 == 1) || // ((item[0] - t) % 2 == 0 && Math.Abs(x + y - item[1] - item[2]) % 2 == 0)) // { // t = item[0]; // x = item[1]; // y = item[2]; // } // else // { // Console.WriteLine("No"); // return; // } // } // else // { // Console.WriteLine("No"); // return; // } //} //Console.WriteLine("Yes"); //var line1 = Array.ConvertAll(Console.ReadLine().Split(), int.Parse); //if (line1[1] >= 10000) //{ // for (int i = 0; i <= line1[1]/10000; i++) // { // for (int j = 0; j <= line1[1] / 5000; j++) // { // if (10000 * i + 5000 * j + (line1[0] - i - j) * 1000 == line1[1] && line1[0] - i - j >= 0) // { // Console.WriteLine("{0} {1} {2}",i,j,line1[0] - i - j); // return; // } // } // } //} //else //{ // for (int i = 0; i < 2; i++) // { // for (int j = 0; j <= 9; j++) // { // if (5000 * i + 1000 * j == line1[1] && i + j == line1[0]) // { // Console.WriteLine("{0} {1} {2}", 0, i, j); // return; // } // } // } //} //Console.WriteLine("{0} {1} {2}", -1, -1, -1); //var N = int.Parse(Console.ReadLine()); //int[,] station = new int[N,3]; //long sum = 0; //for (int i = 0; i < N - 1; i++) //{ // var line = Array.ConvertAll(Console.ReadLine().Split(),int.Parse); // station[i, 0] = line[0]; // station[i, 1] = line[1]; // station[i, 2] = line[2]; //} //for (int j = 0; j < N -1; j++) //{ // for (int i = j; i < N - 1; i++) // { // var F = station[i, 2]; // var S = station[i, 1]; // if (i == j) // { // sum += station[i, 0] + station[i, 1]; // } // else // { // if (sum < S) // { // sum = S + station[i, 0]; // } // else if (sum % F == 0) // { // sum += station[i, 0]; // } // else // { // sum += F - (sum % F) + station[i, 0]; // } // } // } // Console.WriteLine(sum); // sum = 0; //} //Console.WriteLine(sum); //var line = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); //long A = line[0]; //int i = 0; //while (A <= line[1]) //{ // A *=2; // i++; //} //Console.WriteLine(i); //var N = long.Parse(Console.ReadLine()); //var line = Array.ConvertAll(Console.ReadLine().Split(),long.Parse); //Dictionary<long, long> dic = new Dictionary<long, long>(); //long sum = 0; //for (int i = 0; i < N; i++) //{ // if (dic.ContainsKey(line[i])) // { // dic[line[i]]++; // } // else // { // dic.Add(line[i], 1); // } //} //foreach (var item in dic) //{ // if (item.Key == item.Value) // { // } // else if (item.Key < item.Value) // { // sum += item.Value - item.Key; // } // else // { // sum += item.Value; // } //} //Console.WriteLine(sum); //var line = Array.ConvertAll(Console.ReadLine().Split(),long.Parse); //var N = line[0]; //var K = line[1]; //var line2 = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); //long cnt = 0; //long sum = 0; //long[] lngarray = new long[N]; //for (int i = 0; i < N; i++) //{ // lngarray[line2[i]-1]++; //} //if (lngarray.Where(n => n !=0).Count() <= K) //{ // Console.WriteLine(0); // return; //} //var orderlng = lngarray.Where(n => n != 0).OrderBy(n => n).ToArray(); //for (int i = 0; i < orderlng.Length; i++) //{ // if (cnt == orderlng.Length - K) // { // Console.WriteLine(sum); // return; // } // else // { // sum += orderlng[i]; // cnt++; // } //} //int soe = 0; //saiki(soe, new int[10]); //var N = int.Parse(Console.ReadLine()); //var F = new List<int[]>(); //var P = new List<int[]>(); //for (int i = 0; i < N; i++) //{ // var line = Array.ConvertAll(Console.ReadLine().Split(), int.Parse); // F.Add(line); //} //for (int i = 0; i < N; i++) //{ // var line = Array.ConvertAll(Console.ReadLine().Split(), int.Parse); // P.Add(line); //} //int sum = int.MinValue; //list.RemoveAt(0); //foreach (var item in list) //{ // int tmpsum = 0; // for (int i = 0; i < N; i++) // { // int c = 0; // for (int j = 0; j < 10; j++) // { // if (item[j] == 1 && F[i][j] == 1) // { // c++; // } // } // tmpsum += P[i][c]; // } // sum = Math.Max(sum, tmpsum); //} //Console.WriteLine(sum); //var line = Console.ReadLine().ToCharArray(); //int[] hai = new int[7]; //hai[0] = int.Parse(line[0].ToString()); //hai[2] = int.Parse(line[1].ToString()); //hai[4] = int.Parse(line[2].ToString()); //hai[6] = int.Parse(line[3].ToString()); //saikiseven(1,0, hai); //string ope1 = list[0][1] == 0 ? "+" : "-"; //string ope2 = list[0][3] == 0 ? "+" : "-"; //string ope3 = list[0][5] == 0 ? "+" : "-"; //Console.WriteLine("{0}{1}{2}{3}{4}{5}{6}=7", list[0][0],ope1, list[0][2], ope2,list[0][4], ope3,list[0][6]); //var N = long.Parse(Console.ReadLine()); //var line = Array.ConvertAll(Console.ReadLine().Split(), long.Parse); //long[] A = new long[N]; //for (int i = 0; i < N; i++) //{ // A[i] = Math.Abs(i - (N - i -1)); //} //var tmp1 = line.OrderBy(n => n).ToArray(); //var tmp2 = A.OrderBy(n => n).ToArray(); //for (int i = 0; i < N; i++) //{ // if (tmp1[i] != tmp2[i]) // { // Console.WriteLine(0); // return; // } //} //long X = 1; //for (int i = 0; i < N/2; i++) //{ // X *= 2; // X %= 1000000007; //} //Console.WriteLine(X); //var line =Array.ConvertAll(Console.ReadLine().Split(),int.Parse); //var sx = line[0]; //var sy = line[1]; //var tx = line[2]; //var ty = line[3]; //var path1 = new string('U', ty - sy) + new string('R',tx - sx); //var path2 = new string('D', ty - sy) + new string('L', tx - sx); //var path3 = new string('L', 1) + new string('U', ty - sy + 1) + new string('R', tx - sx + 1) + new string('D', 1); //var path4 = new string('R', 1) + new string('D', ty - sy + 1) + new string('L', tx - sx + 1) + new string('U', 1); //Console.WriteLine(path1 + path2 + path3 + path4); //int[] sosuu = new int[1000]; var N = int.Parse(Console.ReadLine()); int[] sosuu = new int[1001]; long ans = 1; for (int i = 1; i < N + 1; i++) { PrimeFactors(i, sosuu); } for (int i = 2; i < N + 1; i++) { ans *= sosuu[i] + 1; ans %= 1000000007; } Console.WriteLine(ans); } public static void PrimeFactors(int n,int[] sosuu) { int i = 2; int tmp = n; while (i * i <= n) { if (tmp % i == 0) { tmp /= i; sosuu[i]++; } else { i++; } } if (tmp != 1) sosuu[tmp]++; } public static void DFSzahyo(int x, int y,int[] s,int[] g) { if (x == g[0] && y == g[1]) { return; } miz[x, y] = true; for (int i = 0; i < 4; i++) { if (miz[x + xMove[i], y + yMove[i]] != true) { DFSzahyo(x + xMove[i], y + yMove[i],s,g); } } } public static void saikiseven(int ope, int sum ,int[] hairetui) { if (ope == 1) { sum = hairetui[ope - 1]; } if (ope == 7 && sum == 7) { int[] dummy = new int[ope]; hairetui.CopyTo(dummy, 0); list.Add(dummy); return; } else if (ope == 7 && sum != 7) { return; } for (int i = 0; i < 2; i++) { if (i == 0) { sum += hairetui[ope + 1]; hairetui[ope] = i; saikiseven(ope + 2, sum, hairetui); sum -= hairetui[ope + 1]; } else { sum -= hairetui[ope + 1]; hairetui[ope] = i; saikiseven(ope + 2, sum, hairetui); } } return; } public static void saiki(int soezi,int[] hairetui) { if (soezi == 10) { int[] dummy = new int[soezi]; hairetui.CopyTo(dummy,0); list.Add(dummy); return; } for (int j = 0; j < 2; j++) { hairetui[soezi] = j; saiki(soezi+1, hairetui); } return; } public static void DFS(int v,bool[] visited,int[,] dag) { visited[v] = true; for (int i = 0; i < visited.Length; i++) { if (dag[v, i] == 0) continue; if (visited[i]) continue; DFS(i,visited,dag); } } public static long LowerBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) { long low = start; long high = end; long mid; while (low < high) { mid = ((high - low) >> 1) + low; if (comparer.Compare(arr[mid], value) < 0) low = mid + 1; else high = mid; } return low; } //引数省略のオーバーロード public static long LowerBound<T>(T[] arr, T value) where T : IComparable { return LowerBound(arr, 0, arr.Length, value, Comparer<T>.Default); } public static long UpperBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) { long low = start; long high = end; long mid; while (low < high) { mid = ((high - low) >> 1) + low; if (comparer.Compare(arr[mid], value) <= 0) low = mid + 1; else high = mid; } return low; } //引数省略のオーバーロード public static long UpperBound<T>(T[] arr, T value) { return UpperBound(arr, 0, arr.Length, value, Comparer<T>.Default); } } /// <summary> /// Get min cost between two points /// </summary> //public class Dijkstra //{ // private int maxIndex = -1; // private const int INF = Int32.MaxValue; // private int[,] _edgeArray; // /// <summary> // /// Dijkstra, get min cost between two points // /// should not contain negatie cost path // /// </summary> // /// <param name="size">max index of vertices</param> // public Dijkstra(int size) // { // maxIndex = size + 1; // _edgeArray = new int[maxIndex, maxIndex]; // for (int i = 0; i < _edgeArray.GetLength(0); i++) // { // for (int j = 0; j < _edgeArray.GetLength(1); j++) // { // _edgeArray[i, j] = INF; // if (i == j) _edgeArray[i, j] = 0; // } // } // } // // Add a path(no direction) with its cost // public void AddPath(int s, int t, int cost) // { // _edgeArray[s, t] = Math.Min(_edgeArray[s, t], cost); // _edgeArray[t, s] = _edgeArray[s, t]; // } // //Get the min cost between s and t // //return Int32.MaxValue if no path // public int GetMinCost(int s, int t) // { // int[] cost = new int[maxIndex]; // for (int i = 0; i < cost.Length; i++) cost[i] = INF; // cost[s] = 0; // var priorityQueue = new PriorityQueue<ComparablePair<int, int>>(maxIndex); // priorityQueue.Push(new ComparablePair<int, int>(0, s)); // while (priorityQueue.Count() > 0) // { // var costDestinationPair = priorityQueue.Pop(); // if (cost[costDestinationPair.Item2] < costDestinationPair.Item1) continue; // for (int i = 0; i < maxIndex; i++) // { // int newCostToi = _edgeArray[costDestinationPair.Item2, i] == INF ? INF : // costDestinationPair.Item1 + _edgeArray[costDestinationPair.Item2, i]; // if (newCostToi < cost[i]) // { // cost[i] = newCostToi; // priorityQueue.Push(new ComparablePair<int, int>(newCostToi, i)); // } // } // } // return cost[t]; // } //} //public class ComparablePair<T, U> : IComparable where T : IComparable<T> //{ // public readonly T Item1; // public readonly U Item2; // public int CompareTo(object obj) // { // ComparablePair<T, U> castedObj = (ComparablePair<T, U>)obj; // return this.Item1.CompareTo(castedObj.Item1); // } // public ComparablePair(T t, U u) // { // Item1 = t; // Item2 = u; // } //} }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:12:16: error: 'List' does not name a type 12 | static List<int[]> list = new List<int[]>(); | ^~~~ a.cc:13:19: error: expected unqualified-id before '[' token 13 | static int[] yMove = new int[] {-1,1,0,0}; | ^ a.cc:14:19: error: expected unqualified-id before '[' token 14 | static int[] xMove = new int[] {0,0,-1,1}; | ^ a.cc:15:20: error: expected unqualified-id before '[' token 15 | static bool[,] miz; | ^ a.cc:17:26: error: 'string' has not been declared 17 | static void Main(string[] args) | ^~~~~~ a.cc:17:35: error: expected ',' or '...' before 'args' 17 | static void Main(string[] args) | ^~~~ a.cc:442:15: error: expected ':' before 'static' 442 | public static void PrimeFactors(int n,int[] sosuu) | ^~~~~~~ | : a.cc:442:53: error: expected ',' or '...' before 'sosuu' 442 | public static void PrimeFactors(int n,int[] sosuu) | ^~~~~ a.cc:463:15: error: expected ':' before 'static' 463 | public static void DFSzahyo(int x, int y,int[] s,int[] g) | ^~~~~~~ | : a.cc:463:56: error: expected ',' or '...' before 's' 463 | public static void DFSzahyo(int x, int y,int[] s,int[] g) | ^ a.cc:480:15: error: expected ':' before 'static' 480 | public static void saikiseven(int ope, int sum ,int[] hairetui) | ^~~~~~~ | : a.cc:480:63: error: expected ',' or '...' before 'hairetui' 480 | public static void saikiseven(int ope, int sum ,int[] hairetui) | ^~~~~~~~ a.cc:519:15: error: expected ':' before 'static' 519 | public static void saiki(int soezi,int[] hairetui) | ^~~~~~~ | : a.cc:519:50: error: expected ',' or '...' before 'hairetui' 519 | public static void saiki(int soezi,int[] hairetui) | ^~~~~~~~ a.cc:538:15: error: expected ':' before 'static' 538 | public static void DFS(int v,bool[] visited,int[,] dag) | ^~~~~~~ | : a.cc:538:45: error: expected ',' or '...' before 'visited' 538 | public static void DFS(int v,bool[] visited,int[,] dag) | ^~~~~~~ a.cc:551:15: error: expected ':' before 'static' 551 | public static long LowerBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^~~~~~~ | : a.cc:551:28: error: expected ';' at end of member declaration 551 | public static long LowerBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^~~~~~~~~~ | ; a.cc:551:38: error: expected unqualified-id before '<' token 551 | public static long LowerBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^ a.cc:568:15: error: expected ':' before 'static' 568 | public static long LowerBound<T>(T[] arr, T value) where T : IComparable | ^~~~~~~ | : a.cc:568:28: error: expected ';' at end of member declaration 568 | public static long LowerBound<T>(T[] arr, T value) where T : IComparable | ^~~~~~~~~~ | ; a.cc:568:28: error: redeclaration of 'long int Atcoder::Program::LowerBound' a.cc:551:28: note: previous declaration 'long int Atcoder::Program::LowerBound' 551 | public static long LowerBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^~~~~~~~~~ a.cc:568:38: error: expected unqualified-id before '<' token 568 | public static long LowerBound<T>(T[] arr, T value) where T : IComparable | ^ a.cc:572:15: error: expected ':' before 'static' 572 | public static long UpperBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^~~~~~~ | : a.cc:572:28: error: expected ';' at end of member declaration 572 | public static long UpperBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^~~~~~~~~~ | ; a.cc:572:38: error: expected unqualified-id before '<' token 572 | public static long UpperBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^ a.cc:589:15: error: expected ':' before 'static' 589 | public static long UpperBound<T>(T[] arr, T value) | ^~~~~~~ | : a.cc:589:28: error: expected ';' at end of member declaration 589 | public static long UpperBound<T>(T[] arr, T value) | ^~~~~~~~~~ | ; a.cc:589:28: error: redeclaration of 'long int Atcoder::Program::UpperBound' a.cc:572:28: note: previous declaration 'long int Atcoder::Program::UpperBound' 572 | public static long UpperBound<T>(T[] arr, long start, long end, T value, IComparer<T> comparer) | ^~~~~~~~~~ a.cc:589:38: error: expected unqualified-id before '<' token 589 | public static long UpperBound<T>(T[] arr, T value) | ^ a.cc:593:6: error: expected ';' after class definition 593 | } | ^ | ; a.cc: In static member function 'static void Atcoder::Program::Main(int*)': a.cc:422:13: error: 'var' was not declared in this scope 422 | var N = int.Parse(Console.ReadLine()); | ^~~ a.cc:423:16: error: structured binding declaration cannot have type 'int' 423 | int[] sosuu = new int[1001]; | ^~ a.cc:423:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:423:16: error: empty structured binding declaration a.cc:423:19: error: expected initializer before 'sosuu' 423 | int[] sosuu = new int[1001]; | ^~~~~ a.cc:427:33: error: 'N' was not declared in this scope 427 | for (int i = 1; i < N + 1; i++) | ^ a.cc:429:33: error: 'sosuu' was not declared in this scope 429 | PrimeFactors(i, sosuu); | ^~~~~ a.cc:432:33: error: 'N' was not declared in this scope 432 | for (int i = 2; i < N + 1; i++) | ^ a.cc:434:24: error: 'sosuu' was not declared in this scope 434 | ans *= sosuu[i] + 1; | ^~~~~ a.cc:439:13: error: 'Console' was not declared in this scope 439 | Console.WriteLine(ans); | ^~~~~~~ a.cc: In static member function 'static void Atcoder::Program::PrimeFactors(int, int*)': a.cc:452:21: error: 'sosuu' was not declared in this scope 452 | sosuu[i]++; | ^~~~~ a.cc:459:27: error: 'sosuu' was not declared in this scope 459 | if (tmp != 1) sosuu[tmp]++; | ^~~~~ a.cc: In static member function 'static void Atcoder::Program::DFSzahyo(int, int, int*)': a.cc:466:22: error: 'g' was not declared in this scope 466 | if (x == g[0] && y == g[1]) | ^ a.cc:470:13: error: 'miz' was not declared in this scope 470 | miz[x, y] = true; | ^~~ a.cc:473:29: error: 'xMove' was not declared in this scope 473 | if (miz[x + xMove[i], y + yMove[i]] != true) | ^~~~~ a.cc:473:43: error: 'yMove' was not declared in this scope 473 | if (miz[x + xMove[i], y + yMove[i]] != true) | ^~~~~ a.cc:475:57: error: 's' was not declared in this scope 475 | DFSzahyo(x + xMove[i], y + yMove[i],s,g); | ^ a.cc:475:59: error: 'g' was not declared in this scope 475 | DFSzahyo(x + xMove[i], y + yMove[i],s,g); | ^ a.cc: In static member function 'static void Atcoder::Program::saikiseven(int, int, int*)': a.cc:484:23: error: 'hairetui' was not declared in this scope 484 | sum = hairetui[ope - 1]; | ^~~~~~~~ a.cc:489:20: error: structured binding declaration cannot have type 'int' 489 | int[] dummy = new int[ope]; | ^~ a.cc:489:20: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:489:20: error: empty structured binding declaration a.cc:489:23: error: expected initializer before 'dummy' 489 | int[] dummy = new int[ope]; | ^~~~~ a.cc:490:17: error: 'hairetui' was not declared in this scope 490 | hairetui.CopyTo(dummy, 0);
s272326244
p03828
C++
#include<bits/stdc++.h> using ll = long long; using lli = long long int using namespace std; const ll MM = 1000000000; const ll mod = MM + 7; int main(){ int N, n; cin >> N; int a[n+5]; for(int i = 0; i <= N; i++){ a[i] = 1; } for(int i = 1; i <= N; i++){ n = i; for(int j = 2; j <= N; j++){ while(n % j){ if(n % j == 0){ a[j]++; n /= j; } } } } ll ans = 1; for(int i = 1; i <= N; i++){ ans *= a[i]; ans %= mod; } cout << ans << endl; }
a.cc:3:26: error: expected ';' before 'using' 3 | using lli = long long int | ^ | ; 4 | using namespace std; | ~~~~~ a.cc: In function 'int main()': a.cc:8:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | int N, 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:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:29:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 29 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:29:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 29 | cout << ans << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s358434973
p03828
C++
#include<bits/stdc++.h> using ll = long long; using namespace std; const ll MM = 1000000000; const ll mod = MM + 7; int main(){ int N, n; cin >> N; int a[n+5]; for(int i = 0; i <= N; i++){ a[i] = 1; } for(int i = 1; i <= N; i++){ n = i; for(int j = 2; j <= N; j++){ while(n % j){ if(m % j == 0){ a[j]++; n /= j; } } } } ll ans = 1; for(int i = 1; i <= N; i++){ ans *= a[i]; ans %= mod; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:16:20: error: 'm' was not declared in this scope 16 | if(m % j == 0){ | ^
s675549008
p03828
C++
#include<bits/stdc++.h> using ll = long long; using namespace std; const ll MM = 1000000000; const ll mod = MM + 7; int main(){ int N, n; cin >> N; int a[n+5]; for(int i = 0; i <= N; i++){ a[i] = 1; } for(int i = 1; i <= N; i++){ n = i; for(int j = 2; j <= N; j++){ while(m % j){ if(m % j == 0){ a[j]++; n /= j; } } } } ll ans = 1; for(int i = 1; i <= N; i++){ ans *= a[i]; ans %= mod; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:15:19: error: 'm' was not declared in this scope 15 | while(m % j){ | ^
s894482414
p03828
C
#include<stdio.h> #include<math.h> int num_of_factors(int n,int k){ int ans=0; int m=k; while(n/k!=0){ ans+=n/k; k*=m; } return ans; } int main(){ int n,i,j,flag,a; long ans=1; scanf("%d",&n); for(i=2;i<=n;i++){ flag=1; for(j=2;j<=(int)sqrt(i);j++){ if(i%j==0) flag=0; } if(flag==1) { a=num_of_factors(n,i); ans=(ans*(a+1))%1000000007; } } printf("%ld\n",ans); ret
main.c: In function 'main': main.c:28:3: error: 'ret' undeclared (first use in this function) 28 | ret | ^~~ main.c:28:3: note: each undeclared identifier is reported only once for each function it appears in main.c:28:6: error: expected ';' at end of input 28 | ret | ^ | ; main.c:28:3: error: expected declaration or statement at end of input 28 | ret | ^~~
s926941168
p03828
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int a[1010]; int main(){ int x,d,i; cin>>x; for(i=2;i<=x;i++) { int n=i; for(d=2;d<=x;d++) { while(x%d==0) { x/=d; // cout<<d<<endl; a[d]++; } } if(x!=1) a[x]++; } ll sum=1; for(d=2;d<=n;d++) { // cout<<d<<" "<<a[d]<<endl; if(a[d]!=0) { sum=(sum*(a[d]+1))%1000000007; } } cout<<sum; return 0; }
a.cc: In function 'int main()': a.cc:25:20: error: 'n' was not declared in this scope 25 | for(d=2;d<=n;d++) | ^
s907451908
p03828
C++
#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) typedef long long ll; vector<bool> eratosthenes(int n) { vector<bool> prime(n + 1); for (int i = 2; i <= n; i++) { prime[i] = true; // 初期化 } prime[0] = prime[1] = false; for (int i = 2; i*i <= n;i++) { if (prime[i]) { for (int j = i * 2; j <= n; j += i) { prime[j] = false; } } } return prime; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; scanf_s("%d", &n); vector<bool> prime = eratosthenes(n); ll ans = 1; int kj = 1; for (int i = 2; i <= n; i++) { kj *= i; } for (int i = 2; i <= n; i++) { if (prime[i]) { int e = 0; for (int j = i; j <= n; j *= i) { e += (n / j); // cout << i << " " << j << " " << e << endl; } ans = (ans * (e + 1) % 1000000007); //cout << i << " " << e << endl; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:32:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 32 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s915486512
p03828
C++
#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) typedef long long ll; vector<bool> eratosthenes(int n) { vector<bool> prime(n + 1); for (int i = 2; i <= n; i++) { prime[i] = true; // 初期化 } prime[0] = prime[1] = false; for (int i = 2; i*i <= n;i++) { if (prime[i]) { for (int j = i * 2; j <= n; j += i) { prime[j] = false; } } } return prime; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; scanf_s("%d", &n); vector<bool> prime = eratosthenes(n); ll ans = 1; int kj = 1; for (int i = 2; i <= n; i++) { kj *= i; } for (int i = 2; i <= n; i++) { if (prime[i]) { int e = 0; for (int j = i; j <= n; j *= i) { e += (n / j); // cout << i << " " << j << " " << e << endl; } ans = (ans * (e + 1) % 1000000007); //cout << i << " " << e << endl; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:32:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 32 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s385975911
p03828
C++
#define mod 1000000007; using namespace std; int main() { int N; cin >> N; long sum = 1; long long a[1001]; for (int i = 2; i <= N; ++i) { int k = i; for (int j = 2; k > 1;) { if (k%j == 0) { a[j]++; k /= j; } else { j++; } } } for (int i = 2; i <= N; ++i) { sum *= (a[i] + 1); sum %= mod; } cout << sum << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> N; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #define mod 1000000007; a.cc:24:9: error: 'cout' was not declared in this scope 24 | cout << sum << endl; | ^~~~ a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:24:24: error: 'endl' was not declared in this scope 24 | cout << sum << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | #define mod 1000000007;
s213194888
p03828
C++
#include <bits/stdc++.h> using namespace std; int main(){ int ans=0,n,array[1001]={}; cin>>n; for(int i=1;i<=1000;i++){ for(int j=1;j<=i;j++){ array[i-1]+=(i%j==0); } } for(int i=0;i<n;i++){ ans+=array[i]; ans%=1000000007 } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:14:20: error: expected ';' before '}' token 14 | ans%=1000000007 | ^ | ; 15 | } | ~
s270065259
p03828
C++
#include <bits/stdc++.h> using namespace std; int main(){ int ans=0;n,array[1001]={}; cin>>n; for(int i=1;i<=1000;i++){ for(int j=1;j<=i;j++){ array[i-1]+=(i%j==0); } } for(int i=0;i<n;i++){ ans+=array[i]; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:5:13: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | int ans=0;n,array[1001]={}; | ^ | yn a.cc:5:20: error: missing template arguments before '[' token 5 | int ans=0;n,array[1001]={}; | ^ a.cc:9:14: error: expected ']' before '-' token 9 | array[i-1]+=(i%j==0); | ^ | ] a.cc:9:17: error: expected initializer before '+=' token 9 | array[i-1]+=(i%j==0); | ^~ a.cc:9:17: error: expected ';' before '+=' token a.cc:13:15: error: missing template arguments before '[' token 13 | ans+=array[i]; | ^
s810797914
p03828
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; long int ans=1; map<int,int>prime; for(int i=2;i<=n;i++){ int a=i; for(int j=2;j<=i;j++){ for(;;){ if(a%j==0){ prime[j]++; a/=j; } else break; } } } map<int,int>::iterator i; for(i=1;i!=prime.end();i++){ ans*=i->second+1; ans%=1000000007; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:21:9: error: no match for 'operator=' (operand types are 'std::map<int, int>::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::iterator'} and 'int') 21 | for(i=1;i!=prime.end();i++){ | ^ In file included from /usr/include/c++/14/map:62, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_tree.h:252:12: note: candidate: 'constexpr std::_Rb_tree_iterator<std::pair<const int, int> >& std::_Rb_tree_iterator<std::pair<const int, int> >::operator=(const std::_Rb_tree_iterator<std::pair<const int, int> >&)' 252 | struct _Rb_tree_iterator | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:252:12: note: no known conversion for argument 1 from 'int' to 'const std::_Rb_tree_iterator<std::pair<const int, int> >&' /usr/include/c++/14/bits/stl_tree.h:252:12: note: candidate: 'constexpr std::_Rb_tree_iterator<std::pair<const int, int> >& std::_Rb_tree_iterator<std::pair<const int, int> >::operator=(std::_Rb_tree_iterator<std::pair<const int, int> >&&)' /usr/include/c++/14/bits/stl_tree.h:252:12: note: no known conversion for argument 1 from 'int' to 'std::_Rb_tree_iterator<std::pair<const int, int> >&&'
s328999767
p03828
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; long int ans=1; map<int,int>prime; for(int i=2;i<=n;i++){ int a=i; for(int j=2;j<=i;j++){ for(;;){ if(a%j==0){ prime[j]++; a/=j; } else break; } } } for(iterator i=1;i!=prime.end();i++){ ans*=i->second+1; ans%=1000000007; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:20:18: error: class template argument deduction failed: 20 | for(iterator i=1;i!=prime.end();i++){ | ^ a.cc:20:18: error: no matching function for call to 'iterator(int)' In file included from /usr/include/c++/14/bits/stl_algobase.h:65, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator()-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>' 127 | struct _GLIBCXX17_DEPRECATED iterator | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator(std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>)-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>' /usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: template argument deduction/substitution failed: a.cc:20:18: note: mismatched types 'std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>' and 'int' 20 | for(iterator i=1;i!=prime.end();i++){ | ^
s488510260
p03828
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; long int ans=1; map<int,int>prime; for(int i=2;i<=n;i++){ int a=i; for(int j=2;j<=i;j++){ for(;;){ if(a%j==0){ prime[j]++; a/=j; } else break; } } } for(int i=1;i<prime.end();i++){ ans*=i->second+1; ans%=1000000007; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:20:16: error: no match for 'operator<' (operand types are 'int' and 'std::map<int, int>::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::iterator'}) 20 | for(int i=1;i<prime.end();i++){ | ~^~~~~~~~~~~~ | | | | int std::map<int, int>::iterator {aka std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::iterator} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:20:27: note: 'std::map<int, int>::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::iterator'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:20:27: note: 'std::map<int, int>::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::iterator'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ 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/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:20:27: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:20:27: note: 'std::_Rb_tree_iterator<std::pair<const int, int> >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 20 | for(int i=1;i<prime.end();i++){ | ^ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits
s380084025
p03828
C++
#include <iostream> #include<math.h> using namespace std; int y[1001]; int main(){ int n; long long ans=1; cin >> n; for(int i=2; i<=n; ++i){ int t = i; for(int k=2; k<=t; ++k){ if(t%k == 0){ t/=k; ++y[k]; --k; } } } for(int i=2; i<1001; ++i){ if(y[i] > 0){ ans *= (y[i] + 1); ans %= long long(pow(10,9)+7); } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:23:14: error: expected primary-expression before 'long' 23 | ans %= long long(pow(10,9)+7); | ^~~~
s488178189
p03828
C++
#include <iostream> using namespace std; long long fact(int n){ if(n == 0){ return 1; }else{ return n * fact(n-1); } } int main(void){ int n; long long a[1000] = {},ans = 1,m; cin >> n; m = fact(n); x = fact(n); for(int i = 2;i <= x;i++){ while(m % i == 0){ m /= i; a[i]++; } if(m == 1) break; } for(int i = 1;i <= 1000;i++){ if(a[i] != 0){ ans *= (a[i] + 1); } } ans %= (1000000000+7); cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:18:5: error: 'x' was not declared in this scope 18 | x = fact(n); | ^
s474260449
p03828
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> #include<climits> #include<map> #include<set> #include<queue> #include<stack> #include<bitset> #include<iomanip> #include<functional> using namespace std; #define YES cout << "YES\n" #define Yes cout << "Yes\n" #define yes cout << "yes\n" #define NO cout << "NO\n" #define No cout << "No\n" #define no cout << "no\n" #define rep(i,j,n) for(int i=(j);i<(n);i++) #define erep(i,j,n) for(int i=(j);i<=(n);i++) #define all(i) i.begin(),i.end() #define rall(i) i.rbegin(),i.rend() #define INF 1e9 const int mod = 1e9+7; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<string> vs; typedef vector<vector<string>> vvs; typedef pair<int, int> pi; typedef long long i64; // 約数列挙 vector<i64> divisor(i64 n) { vector<i64> ret; for(i64 i = 0; i*i <= n; i++) { if(n%i == 0) { ret.push_back(i); if(i*i != n) ret.push_back(n/i); } } sort(ret.begin(), ret.end()); return ret; } int main() { int n; cin >> n; map<int, int> mp; erep(i, 1, n) { for(auto ite : divisor(i)) { if(!mp.count(ite)) mp[ite] = 0; mp[ite]++; } } i64 ans = 1; for(auto ite : mp) ans = (ans * ite) % mod; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:62:33: error: no match for 'operator*' (operand types are 'i64' {aka 'long long int'} and 'std::pair<const int, int>') 62 | for(auto ite : mp) ans = (ans * ite) % mod; | ~~~ ^ ~~~ | | | | | std::pair<const int, int> | i64 {aka long long int}
s266925834
p03828
C++
#include<bits/stdc++.h> using namespace std; #define md 1e+9 #define ll long long int main(){ int n; int dd[1001]={}; int div = 1; ll ans = 1; cin>>n; while(n>1){ while(n % div == 0){ dd[div]++; n /= div; } } for(int i=1;i<1000;i++){ ans = (ans*(dd[i]+1))%md; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:18:26: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 18 | ans = (ans*(dd[i]+1))%md; | ~~~~~~~~~~~~~~~^ | | | long long int
s837453124
p03828
C++
#include<bits/stdc++.h> using namespace std; #define mod 1e+9 #define ll long long int main(){ int n; int dd[1001]={}; int div = 1; ll ans = 1 cin>>n; while(n>1){ while(n % div == 0){ dd[div]++; n /= div; } } for(int i=1;i<1000;i++){ ans = (ans*(dd[i]+1))%mod; } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:10:3: error: expected ',' or ';' before 'cin' 10 | cin>>n; | ^~~ a.cc:18:26: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 18 | ans = (ans*(dd[i]+1))%mod; | ~~~~~~~~~~~~~~~^ | | | long long int
s107587889
p03828
C++
#include<bits/stdc++.h> #define MAX 1000000007 #define ll long long using namespace std; int main(){ int n; cin>>n; ll a[1050]={}; for(int i=2;i<=n;i++){ int tmp=i; for(int j=2;j<=n;j++){ if(tmp%j==0){ while(tmp%j==0){ a[j]++; tmp/=j; } } if(tmp==1){break;} } } long long sum=1; for(int i=2;i<=n;i++){ if(a[i]!=0){ sum=sum*(a[i]+1)%MAX; //cout<<sum<<endl; } if(sum==0){ break; } //cout<<a[i]<<endl; } cout<<sum<<endl; return 0; } #include<bits/stdc++.h> #define MAX 1000000007 #define ll long long using namespace std; int main(){ int n; cin>>n; ll a[1050]={}; for(int i=2;i<=n;i++){ int tmp=i; for(int j=2;j<=n;j++){ if(tmp%j==0){ while(tmp%j==0){ a[j]++; tmp/=j; } } if(tmp==1){break;} } } long long sum=1; for(int i=2;i<=n;i++){ if(a[i]!=0){ sum=sum*(a[i]+1)%MAX; //cout<<sum<<endl; } if(sum==0){ break; } //cout<<a[i]<<endl; } cout<<sum<<endl; return 0; }
a.cc:39:5: error: redefinition of 'int main()' 39 | int main(){ | ^~~~ a.cc:5:5: note: 'int main()' previously defined here 5 | int main(){ | ^~~~
s804191659
p03828
C
#include<stdio.h> int main(){ int n; constexpr int a[1001]={0,1,2,4,8,16,30,60,96,160,270,540,792,1584,2592,4032,5376,10752,14688,29376,41040,60800,96000,192000,242880,340032,532224,677376,917280,1834560,2332800,4665600,5529600,7864320,12165120,16422912,19595520,39191040,60466176,85100544,102435840,204871680,258048000,516096000,677376000,819624960,258709753,517419506,876670706,698576619,464046052,210846678,87039944,174079888,559756674,984916319,217548604,16857327,609087587,218175167,106431041,212862082,535421074,139926156,50952999,105219839,195900610,391801220,889436190,472974756,845412639,690825271,891132264,782264521,316684054,31280490,665186745,252135966,764748573,529497139,790600338,524719291,999573608,999147209,522112609,37861883,417241520,775916997,997830958,995661909,729407917,321723976,871170030,520705814,149385219,41956001,988486370,976972733,516785610,158924226,583951250,167902493,687346296,374692585,229757313,549263416,890796057,781592107,875619122,751238237,277966376,130571620,574892396,149784785,921692445,813661707,582700142,400726352,358621292,318642155,250091916,386472265,174406757,151737975,260683867,184202887,320817301,641634602,125034947,201660251,962210566,924421125,489345615,320577061,637208078,196761361,626955546,253911085,389481998,778963996,576273102,309075370,619146484,295106277,464103226,498550267,627180822,788686761,989134263,978268519,902509248,805018489,112903872,32995287,295406792,974343106,721660051,443320095,316385239,778274799,190780502,633014225,727670045,455340083,498164792,15588548,97601235,195202470,569355054,118486597,342752204,135661810,90769804,181539608,519303442,515842850,84989549,696032419,231083385,462166770,150280772,300561544,884472740,641985713,569378318,591770736,690140664,249252882,677627271,850771381,851099110,702198213,111350575,222701150,859360900,670197303,177520684,355041368,643925245,287850483,323688011,476804260,749121574,436195097,100916105,763521317,852472431,566135419,817481112,609114726,316546467,633092934,400461490,516478899,802348580,904410955,621677199,257318500,176522245,676814987,463688019,296329114,264099706,528199412,36178948,424547801,768068647,536137287,180929498,361858996,212858280,424867383,432882564,865765128,720594700,90410365,461821767,203725504,114020002,228040004,637601848,275203689,996048794,816392758,827385828,501246906,502796187,283931071,433357175,368415063,694773670,389547333,672209469,929924926,339805954,823423911,430631131,861262262,912999218,775754185,248442642,92860619,47164638,94329276,560810218,901787221,979102645,727649351,20618968,41237936,409407748,818815496,105871481,565828513,733793480,775394695,826327221,652654435,644963335,70964339,34934197,69868394,21321430,42642860,308165968,66236679,863975191,474703946,965050168,372703124,98935522,622346998,724308287,448616567,387250563,521154852,757291985,756807708,98256492,802531326,949720885,885971876,131412209,981761360,661149918,619958299,331028217,662056434,807561987,320675293,914129701,828259395,37073206,74146412,402841690,54637455,617124544,234249081,751443813,937109749,192721498,402972372,453564416,21903965,219196964,711481873,513083746,252120578,510728243,686346634,854955589,709911171,78596230,269965951,409219288,248271231,873383775,746767543,509852147,174891499,984879786,197881406,237525166,359571994,592280493,443047391,387927598,775855196,487579371,975158742,351882153,147029129,237093507,474187014,233169083,703708683,126101010,198878663,367151757,734303514,558855498,196629758,161317030,573722496,327882255,869789706,71204994,142409988,519330677,658916599,820221123,589765049,882787662,765575317,237538730,765336752,111906311,970555905,547616857,95233707,919602856,913510209,325919347,651838694,787773019,168803670,875276542,263468393,816727867,633455727,500272724,140006678,171663917,920917448,754148927,547298078,412984678,825969356,89434825,653930388,136393590,272787180,276924235,570666519,590968903,696916544,114558109,209914977,987646996,975293985,732105167,207549775,590764498,239710087,413342719,606756472,119222007,227695505,450857281,901714562,192653364,385306728,234022344,31755833,752787939,682129837,972238124,563737250,589527825,729854221,873389836,746779665,973964734,947929461,5202400,320558679,402562062,651932087,438747311,877494622,851938578,595655182,953260474,906520941,610950283,501334286,115901200,458267670,725708035,451416063,34629651,443595068,292992687,984336996,352845142,600659252,738086132,476172257,146298687,742115388,685981689,371963371,5238701,10477402,766426619,741060152,215953758,431907516,900346034,302070357,669584758,46053147,500531147,269366731,835955289,753764439,748101695,586666665,340467085,680934170,993066655,337509515,702294178,689317659,610110893,855932510,718959729,437919451,162052266,591444463,937285062,874570117,577640930,690830665,441136051,234385594,995953016,490091986,701529803,403059599,173749087,571309264,670816347,341632687,12414678,656616799,110230917,555093018,326641735,653283470,841517232,299713801,790165940,55645384,857068605,957840454,891206655,734604192,144312526,317679024,396371648,792743296,423188008,846376016,985116058,646955723,952177710,502929334,92150358,447989522,924790847,549384151,424045976,984526166,194912796,17485470,655375515,480905089,910910739,771660846,177055119,354110238,487461754,533406064,889925808,672895377,471803466,943606932,363992147,457850989,337082821,559633947,903886732,428980584,430095367,52327251,636880607,273761207,706305042,890884144,393016175,748347757,949802139,899604271,310566618,130756774,816805638,605028078,169610267,339220534,575779053,151558099,779861186,564602992,437157814,502964081,478103459,956206918,385872385,383885002,125139522,606176173,727381953,8385703,189534611,657264353,809755457,619510907,607320752,922420555,310951652,461684174,548921957,97843907,729671781,620980721,857109915,25052446,275170024,550340048,495401987,990803974,362448559,60904426,929227965,120741193,257409647,514819294,969108899,560048584,985073824,700527244,680852420,361704833,819310219,589014097,1398831,2797662,533149213,66298419,177289968,605590036,607911651,709970869,953992856,619456719,655319030,644362951,232480867,745680583,590594926,181189845,520817003,742434671,899661005,364907082,733053610,13738009,433804341,236387921,508481622,16963237,232316619,464633238,221314587,887788178,285824818,571649636,737224462,55447552,88454246,798654422,982084080,964168153,247453861,1833862,99268162,659694667,466104507,932209014,864422567,728845127,537854091,599199290,264178678,250863989,574407941,732405085,314042625,489474931,176295562,914244677,852693813,705387619,193242738,892738773,352048555,704097110,771025308,753975129,927527314,542054326,2994361,5988722,142029115,324378674,100232612,267369886,945624300,882384522,416443431,832886862,784668659,985124309,298874953,102595581,589967510,536599545,782218536,77865166,65277123,130554246,660510295,877005583,275946488,615306711,199915845,893431699,154588775,309177550,504746854,864753530,291783330,553114672,78102633,511352330,753667006,152737422,966787467,933574927,743434691,300957143,206901132,971318792,551792353,641951914,887092590,774185173,324319767,296313969,419748261,736668708,125202855,250405710,860306792,120041519,287948500,772974185,72505984,145011968,197340762,319569601,29058411,58116822,503961279,97170670,855412437,719283733,922189282,610817142,981054324,962108641,555626129,721425306,8695797,867937276,204728691,409457382,327387384,796008217,623487493,246974979,808073302,987531151,661621379,619686012,885900428,182865420,604993928,209987849,112149920,982821831,436804698,873609396,249429664,35442337,542946067,435717873,357909594,663354277,349837771,172902187,725024195,626724406,951883201,898886813,611894793,223789579,156249711,953762374,941520348,627312415,732152146,626637375,697801379,928373167,467201812,934403624,300174312,940164327,768557112,666818604,430052749,769678528,637336196,471510530,884736131,405930623,88523589,177047178,741193266,482386525,959636069,420122608,870743513,206500587,931686480,949884867,256838150,936095622,169293108,338586216,20108011,40216022,515421399,752804022,39087839,78175678,170102,340204,946184524,167781729,835787762,903545720,642497069,768924002,848555995,948817436,408127979,816255958,800214847,62298624,211839153,598162116,649248474,550398359,199342730,466361673,327607418,129788111,60519012,181516929,291695327,583390654,933077030,384594463,248685267,497370534,574889090,149778173,508531933,813332884,744233240,488466473,623778584,4368568,996107508,578055173,827804465,735970254,633530545,296440400,68756126,969743180,876576330,723047882,284529056,569058112,955600472,546169433,803429308,606858609,391311257,782622514,544679226,242364688,879318989,758637971,578342645,882174629,300235757,203149792,186638455,197248609,4796039,513889283,888015602,188499605,180716688,503135262,412392718,986465265,744612799,335327753,188776829,910205676,736820167,473640327,438152515,953148782,574653619,149307231,898195178,851342559,30893933,76564644,524487579,530536325,132326487,264652974,436939730,343683655,215324089,564898148,437093697,270599954,464012989,329405798,476278405,952556810,152525842,639543549,539816971,508927499,355269900,826589616,330452844,660905688,53392193,5534060,69632488,139264976,254644395,744092152,539703029,555053484,899170215,798340423,422351818,444892614,151256959,504363114,893778023,787556039,802071847,381737209,85245710,493128509,945208231,475863350,279284954,813432374,905487747,730092313,198445481,573858992,640307357,280614707,780620191,211244466,611704170,223408333,494598748,968788563,176505672,286582450,993252097,986504187,529362547,560946912,386341399,989315317,14725758,29451516,215685422,95948827,463209666,847826556,571585155,357027634,71359521,142719042,128278247,45877819,700894880,39614801,668371163,336742319,338115610,570799830,972926972}; scanf("%d",&n); printf("%d\n",a[n]); }
main.c: In function 'main': main.c:5:9: error: 'constexpr' undeclared (first use in this function) 5 | constexpr int a[1001]={0,1,2,4,8,16,30,60,96,160,270,540,792,1584,2592,4032,5376,10752,14688,29376,41040,60800,96000,192000,242880,340032,532224,677376,917280,1834560,2332800,4665600,5529600,7864320,12165120,16422912,19595520,39191040,60466176,85100544,102435840,204871680,258048000,516096000,677376000,819624960,258709753,517419506,876670706,698576619,464046052,210846678,87039944,174079888,559756674,984916319,217548604,16857327,609087587,218175167,106431041,212862082,535421074,139926156,50952999,105219839,195900610,391801220,889436190,472974756,845412639,690825271,891132264,782264521,316684054,31280490,665186745,252135966,764748573,529497139,790600338,524719291,999573608,999147209,522112609,37861883,417241520,775916997,997830958,995661909,729407917,321723976,871170030,520705814,149385219,41956001,988486370,976972733,516785610,158924226,583951250,167902493,687346296,374692585,229757313,549263416,890796057,781592107,875619122,751238237,277966376,130571620,574892396,149784785,921692445,813661707,582700142,400726352,358621292,318642155,250091916,386472265,174406757,151737975,260683867,184202887,320817301,641634602,125034947,201660251,962210566,924421125,489345615,320577061,637208078,196761361,626955546,253911085,389481998,778963996,576273102,309075370,619146484,295106277,464103226,498550267,627180822,788686761,989134263,978268519,902509248,805018489,112903872,32995287,295406792,974343106,721660051,443320095,316385239,778274799,190780502,633014225,727670045,455340083,498164792,15588548,97601235,195202470,569355054,118486597,342752204,135661810,90769804,181539608,519303442,515842850,84989549,696032419,231083385,462166770,150280772,300561544,884472740,641985713,569378318,591770736,690140664,249252882,677627271,850771381,851099110,702198213,111350575,222701150,859360900,670197303,177520684,355041368,643925245,287850483,323688011,476804260,749121574,436195097,100916105,763521317,852472431,566135419,817481112,609114726,316546467,633092934,400461490,516478899,802348580,904410955,621677199,257318500,176522245,676814987,463688019,296329114,264099706,528199412,36178948,424547801,768068647,536137287,180929498,361858996,212858280,424867383,432882564,865765128,720594700,90410365,461821767,203725504,114020002,228040004,637601848,275203689,996048794,816392758,827385828,501246906,502796187,283931071,433357175,368415063,694773670,389547333,672209469,929924926,339805954,823423911,430631131,861262262,912999218,775754185,248442642,92860619,47164638,94329276,560810218,901787221,979102645,727649351,20618968,41237936,409407748,818815496,105871481,565828513,733793480,775394695,826327221,652654435,644963335,70964339,34934197,69868394,21321430,42642860,308165968,66236679,863975191,474703946,965050168,372703124,98935522,622346998,724308287,448616567,387250563,521154852,757291985,756807708,98256492,802531326,949720885,885971876,131412209,981761360,661149918,619958299,331028217,662056434,807561987,320675293,914129701,828259395,37073206,74146412,402841690,54637455,617124544,234249081,751443813,937109749,192721498,402972372,453564416,21903965,219196964,711481873,513083746,252120578,510728243,686346634,854955589,709911171,78596230,269965951,409219288,248271231,873383775,746767543,509852147,174891499,984879786,197881406,237525166,359571994,592280493,443047391,387927598,775855196,487579371,975158742,351882153,147029129,237093507,474187014,233169083,703708683,126101010,198878663,367151757,734303514,558855498,196629758,161317030,573722496,327882255,869789706,71204994,142409988,519330677,658916599,820221123,589765049,882787662,765575317,237538730,765336752,111906311,970555905,547616857,95233707,919602856,913510209,325919347,651838694,787773019,168803670,875276542,263468393,816727867,633455727,500272724,140006678,171663917,920917448,754148927,547298078,412984678,825969356,89434825,653930388,136393590,272787180,276924235,570666519,590968903,696916544,114558109,209914977,987646996,975293985,732105167,207549775,590764498,239710087,413342719,606756472,119222007,227695505,450857281,901714562,192653364,385306728,234022344,31755833,752787939,682129837,972238124,563737250,589527825,729854221,873389836,746779665,973964734,947929461,5202400,320558679,402562062,651932087,438747311,877494622,851938578,595655182,953260474,906520941,610950283,501334286,115901200,458267670,725708035,451416063,34629651,443595068,292992687,984336996,352845142,600659252,738086132,476172257,146298687,742115388,685981689,371963371,5238701,10477402,766426619,741060152,215953758,431907516,900346034,302070357,669584758,46053147,500531147,269366731,835955289,753764439,748101695,586666665,340467085,680934170,993066655,337509515,702294178,689317659,610110893,855932510,718959729,437919451,162052266,591444463,937285062,874570117,577640930,690830665,441136051,234385594,995953016,490091986,701529803,403059599,173749087,571309264,670816347,341632687,12414678,656616799,110230917,555093018,326641735,653283470,841517232,299713801,790165940,55645384,857068605,957840454,891206655,734604192,144312526,317679024,396371648,792743296,423188008,846376016,985116058,646955723,952177710,502929334,92150358,447989522,924790847,549384151,424045976,984526166,194912796,17485470,655375515,480905089,910910739,771660846,177055119,354110238,487461754,533406064,889925808,672895377,471803466,943606932,363992147,457850989,337082821,559633947,903886732,428980584,430095367,52327251,636880607,273761207,706305042,890884144,393016175,748347757,949802139,899604271,310566618,130756774,816805638,605028078,169610267,339220534,575779053,151558099,779861186,564602992,437157814,502964081,478103459,956206918,385872385,383885002,125139522,606176173,727381953,8385703,189534611,657264353,809755457,619510907,607320752,922420555,310951652,461684174,548921957,97843907,729671781,620980721,857109915,25052446,275170024,550340048,495401987,990803974,362448559,60904426,929227965,120741193,257409647,514819294,969108899,560048584,985073824,700527244,680852420,361704833,819310219,589014097,1398831,2797662,533149213,66298419,177289968,605590036,607911651,709970869,953992856,619456719,655319030,644362951,232480867,745680583,590594926,181189845,520817003,742434671,899661005,364907082,733053610,13738009,433804341,236387921,508481622,16963237,232316619,464633238,221314587,887788178,285824818,571649636,737224462,55447552,88454246,798654422,982084080,964168153,247453861,1833862,99268162,659694667,466104507,932209014,864422567,728845127,537854091,599199290,264178678,250863989,574407941,732405085,314042625,489474931,176295562,914244677,852693813,705387619,193242738,892738773,352048555,704097110,771025308,753975129,927527314,542054326,2994361,5988722,142029115,324378674,100232612,267369886,945624300,882384522,416443431,832886862,784668659,985124309,298874953,102595581,589967510,536599545,782218536,77865166,65277123,130554246,660510295,877005583,275946488,615306711,199915845,893431699,154588775,309177550,504746854,864753530,291783330,553114672,78102633,511352330,753667006,152737422,966787467,933574927,743434691,300957143,206901132,971318792,551792353,641951914,887092590,774185173,324319767,296313969,419748261,736668708,125202855,250405710,860306792,120041519,287948500,772974185,72505984,145011968,197340762,319569601,29058411,58116822,503961279,97170670,855412437,719283733,922189282,610817142,981054324,962108641,555626129,721425306,8695797,867937276,204728691,409457382,327387384,796008217,623487493,246974979,808073302,987531151,661621379,619686012,885900428,182865420,604993928,209987849,112149920,982821831,436804698,873609396,249429664,35442337,542946067,435717873,357909594,663354277,349837771,172902187,725024195,626724406,951883201,898886813,611894793,223789579,156249711,953762374,941520348,627312415,732152146,626637375,697801379,928373167,467201812,934403624,300174312,940164327,768557112,666818604,430052749,769678528,637336196,471510530,884736131,405930623,88523589,177047178,741193266,482386525,959636069,420122608,870743513,206500587,931686480,949884867,256838150,936095622,169293108,338586216,20108011,40216022,515421399,752804022,39087839,78175678,170102,340204,946184524,167781729,835787762,903545720,642497069,768924002,848555995,948817436,408127979,816255958,800214847,62298624,211839153,598162116,649248474,550398359,199342730,466361673,327607418,129788111,60519012,181516929,291695327,583390654,933077030,384594463,248685267,497370534,574889090,149778173,508531933,813332884,744233240,488466473,623778584,4368568,996107508,578055173,827804465,735970254,633530545,296440400,68756126,969743180,876576330,723047882,284529056,569058112,955600472,546169433,803429308,606858609,391311257,782622514,544679226,242364688,879318989,758637971,578342645,882174629,300235757,203149792,186638455,197248609,4796039,513889283,888015602,188499605,180716688,503135262,412392718,986465265,744612799,335327753,188776829,910205676,736820167,473640327,438152515,953148782,574653619,149307231,898195178,851342559,30893933,76564644,524487579,530536325,132326487,264652974,436939730,343683655,215324089,564898148,437093697,270599954,464012989,329405798,476278405,952556810,152525842,639543549,539816971,508927499,355269900,826589616,330452844,660905688,53392193,5534060,69632488,139264976,254644395,744092152,539703029,555053484,899170215,798340423,422351818,444892614,151256959,504363114,893778023,787556039,802071847,381737209,85245710,493128509,945208231,475863350,279284954,813432374,905487747,730092313,198445481,573858992,640307357,280614707,780620191,211244466,611704170,223408333,494598748,968788563,176505672,286582450,993252097,986504187,529362547,560946912,386341399,989315317,14725758,29451516,215685422,95948827,463209666,847826556,571585155,357027634,71359521,142719042,128278247,45877819,700894880,39614801,668371163,336742319,338115610,570799830,972926972}; | ^~~~~~~~~ main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in main.c:5:18: error: expected ';' before 'int' 5 | constexpr int a[1001]={0,1,2,4,8,16,30,60,96,160,270,540,792,1584,2592,4032,5376,10752,14688,29376,41040,60800,96000,192000,242880,340032,532224,677376,917280,1834560,2332800,4665600,
s038647434
p03828
C
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n, fac = 1, ans = 1; map<ll, ll> mp; int main() { cin >> n; for(ll i = 1; i <= n; i++){ ll k = i; for(ll j = 2; k > 1; j++){ while(k % j == 0){ mp[j]++; k /= j; } } } map<ll, ll> :: iterator ite; for(ite = mp.begin(); ite != mp.end(); ite++){ //cout << ite->second + 1 << endl; ans *= (ite->second + 1); ans %= 1000000007; } cout << ans << endl; return 0; }
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s292871235
p03828
C++
#include "stdafx.h" #include<iostream> #include<string> #include<algorithm> #include<vector> #include<cmath> #include<stack> #include<map> #include<queue> using namespace std; int main() { int n; cin >> n; int sh[1000] = {}; for (int i = 2; i <= n; i++) { for (int j = 2; j <= sqrt(i); j++) { if (i%j == 0)goto bre; } for (int j = 1; j <= n;) { int c = j; while (true) { if (c % i == 0) { sh[i]++; c /= i; } else break; } j++; } bre:; } long long ans = 1; for (int i = 2; i < 1000; i++) { if (sh[i]) { ans *= sh[i] + 1; ans %= 1000000007; } } cout << ans << endl; getchar(); getchar(); return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s974280089
p03828
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=int(a);i<int(b);++i) #include <iostream> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <complex> #include <vector> #include <list> #include <set> #include <queue> #include <stack> #include <map> #include <string> #include <algorithm> #if __cplusplus >= 201103 #include <numeric> #endif using namespace std; typedef long long ll; int main(){ int n; cin >> n; int ns = n; for(int i=1; i<n; i++){ ns *= i; } int count =0; for(int i=1 ; i<=ns;i++){ if(ns%i ==0){ count++; } } cout << count % (1e9+7) << endl; }
a.cc: In function 'int main()': a.cc:36:19: error: invalid operands of types 'int' and 'double' to binary 'operator%' 36 | cout << count % (1e9+7) << endl; | ~~~~~ ^ ~~~~~~~ | | | | int double
s619189858
p03828
C++
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; } template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; } template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; } template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; } /* <url:>  問題文============================================================ ================================================================= 解説============================================================= ================================================================ */ const ll MOD = 1e9+7; /* 素因数分解 */ vector<ll> PrimeFact(ll n){ vector<ll> res; while(n!=1){ if(n == 2 || n == 3){ res.emplace_back(n); n/=n; continue; } bool prime_flag = false; for(int i = 2;i*i <= n;i++){ if(n%i==0){ res.emplace_back(i); n/=i; prime_flag = true; break; } } if(!prime_flag){res.emplace_back(n); n/= n;} } return res; } int main(void) { cin.tie(0); ios_base::sync_with_stdio(false); ll N; cin >> N; ll ans = 1; map<ll,ll> mp; for(int i = 1; i <= N;i++){ auto pf = PrimeFact(i); for(auto v:pf) mp[v]++; } for(auto v:mp){ (ans *= (v.second+1))%=MOD; } cout << ans << endl;   return 0; }
a.cc:56:26: error: extended character   is not valid in an identifier 56 | cout << ans << endl;   | ^ a.cc: In function 'int main()': a.cc:56:26: error: '\U000000a0' was not declared in this scope 56 | cout << ans << endl;   | ^
s462067195
p03828
C++
 #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; } template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; } template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; } template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; } /* <url:>  問題文============================================================ ================================================================= 解説============================================================= ================================================================ */ const ll MOD = 1e9+7; /* 素因数分解 */ vector<ll> PrimeFact(ll n){ vector<ll> res; while(n!=1){ if(n == 2 || n == 3){ res.emplace_back(n); n/=n; continue; } bool prime_flag = false; for(int i = 2;i*i <= n;i++){ if(n%i==0){ res.emplace_back(i); n/=i; prime_flag = true; break; } } if(!prime_flag){res.emplace_back(n); n/= n;} } return res; } int main(void) { cin.tie(0); ios_base::sync_with_stdio(false); ll N; cin >> N; ll ans = 1; map<ll,ll> mp; for(int i = 1; i <= N;i++){ auto pf = PrimeFact(i); for(auto v:pf) mp[v]++; } for(auto v:mp){ (ans *= (v.second+1))%=MOD; } cout << ans << endl;   return 0; }
a.cc:1:1: error: extended character   is not valid in an identifier 1 |  #include "bits/stdc++.h" | ^ a.cc:1:2: error: stray '#' in program 1 |  #include "bits/stdc++.h" | ^ a.cc:56:26: error: extended character   is not valid in an identifier 56 | cout << ans << endl;   | ^ a.cc:1:1: error: '\U000000a0' does not name a type 1 |  #include "bits/stdc++.h" | ^ a.cc:4:9: error: 'pair' does not name a type 4 | typedef pair<int, int> pii; | ^~~~ a.cc:5:9: error: 'pair' does not name a type 5 | typedef pair<ll, ll> pll; | ^~~~ a.cc:8:27: error: 'ostream' does not name a type 8 | template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; } | ^~~~~~~ a.cc:9:19: error: 'ostream' does not name a type 9 | template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; } | ^~~~~~~ a.cc:10:19: error: 'ostream' does not name a type 10 | template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; } | ^~~~~~~ a.cc:11:27: error: 'ostream' does not name a type 11 | template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; } | ^~~~~~~ a.cc:24:1: error: 'vector' does not name a type 24 | vector<ll> PrimeFact(ll n){ | ^~~~~~ a.cc: In function 'int main()': a.cc:45:5: error: 'cin' was not declared in this scope 45 | cin.tie(0); ios_base::sync_with_stdio(false); | ^~~ a.cc:45:17: error: 'ios_base' has not been declared 45 | cin.tie(0); ios_base::sync_with_stdio(false); | ^~~~~~~~ a.cc:48:5: error: 'map' was not declared in this scope 48 | map<ll,ll> mp; | ^~~ a.cc:48:11: error: expected primary-expression before ',' token 48 | map<ll,ll> mp; | ^ a.cc:48:14: error: expected primary-expression before '>' token 48 | map<ll,ll> mp; | ^ a.cc:48:16: error: 'mp' was not declared in this scope 48 | map<ll,ll> mp; | ^~ a.cc:50:19: error: 'PrimeFact' was not declared in this scope 50 | auto pf = PrimeFact(i); | ^~~~~~~~~ a.cc:56:5: error: 'cout' was not declared in this scope 56 | cout << ans << endl;   | ^~~~ a.cc:56:20: error: 'endl' was not declared in this scope 56 | cout << ans << endl;   | ^~~~ a.cc:56:26: error: '\U000000a0' was not declared in this scope 56 | cout << ans << endl;   | ^
s050119049
p03828
C++
#include <bits\stdc++.h> using namespace std; long long n,m,i,j,cnt[1005],np[1005],ans=1,mod=1e9+7; vector<long long> pri; void calc(int x) { int i; for (i=0;i<pri.size()&&pri[i]*pri[i]<=x;i++) { while (x%pri[i]==0) { x/=pri[i]; cnt[pri[i]]++; } } if (x>1) cnt[x]++; } int main() { cin>>n; np[1]=1; for (i=2;i<=n;i++) { if (np[i]) continue; pri.push_back(i); for (j=2;i*j<=n;j++) np[i*j]=1; } for (i=2;i<=n;i++) calc(i); for (i=0;i<pri.size();i++) { ans=ans*(cnt[pri[i]]+1)%mod; } cout<<ans; return 0; }
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s757970654
p03828
C++
#include<cstdio> #include<algorithm> #include<cmath> using namespace std; typedef unsigned long long ULL; #define MOD 1000000007 int main() { LL n; while(~scanf("%lld",&n)) { LL sum=1; for(LL i=1;i<=n;i++) sum=(sum*i)%MOD; LL ans=sqrt(sum); LL num=0; for(LL i=1;i<=ans;i++) { if(sum%i==0) num=(num+2)%MOD; } if(ans*ans==sum) num--; printf("%lld\n",num); } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'LL' was not declared in this scope; did you mean 'ULL'? 9 | LL n; | ^~ | ULL a.cc:11:30: error: 'n' was not declared in this scope; did you mean 'yn'? 11 | while(~scanf("%lld",&n)) | ^ | yn a.cc:13:19: error: expected ';' before 'sum' 13 | LL sum=1; | ^~~~ | ; a.cc:14:23: error: expected ';' before 'i' 14 | for(LL i=1;i<=n;i++) | ^~ | ; a.cc:14:28: error: 'i' was not declared in this scope 14 | for(LL i=1;i<=n;i++) | ^ a.cc:15:25: error: 'sum' was not declared in this scope 15 | sum=(sum*i)%MOD; | ^~~ a.cc:16:19: error: expected ';' before 'ans' 16 | LL ans=sqrt(sum); | ^~~~ | ; a.cc:17:19: error: expected ';' before 'num' 17 | LL num=0; | ^~~~ | ; a.cc:18:23: error: expected ';' before 'i' 18 | for(LL i=1;i<=ans;i++) | ^~ | ; a.cc:18:28: error: 'i' was not declared in this scope 18 | for(LL i=1;i<=ans;i++) | ^ a.cc:18:31: error: 'ans' was not declared in this scope; did you mean 'abs'? 18 | for(LL i=1;i<=ans;i++) | ^~~ | abs a.cc:20:28: error: 'sum' was not declared in this scope 20 | if(sum%i==0) | ^~~ a.cc:21:33: error: 'num' was not declared in this scope; did you mean 'enum'? 21 | num=(num+2)%MOD; | ^~~ | enum a.cc:23:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 23 | if(ans*ans==sum) | ^~~ | abs a.cc:23:29: error: 'sum' was not declared in this scope 23 | if(ans*ans==sum) | ^~~ a.cc:24:25: error: 'num' was not declared in this scope; did you mean 'enum'? 24 | num--; | ^~~ | enum a.cc:25:33: error: 'num' was not declared in this scope; did you mean 'enum'? 25 | printf("%lld\n",num); | ^~~ | enum
s960996315
p03828
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; int a[N+1]; memset(a,0,sizeof(a)); for (int j=1; j<=N; j++) { int k=j; for (int i=2; k>1; ) { if (k%i==0) { k/=i; a[i]++; } else { i++; } } } const int mod=1e9+7; long long int ans=1; for (int i=2; i<=N; i++) { ans=ans*(a[i]+1)%mod; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: 'memset' was not declared in this scope 8 | memset(a,0,sizeof(a)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s606636291
p03828
C++
#include <iostream> #include <string> #include <cstring> #include <cstdio> #include <algorithm> #include <vector> #include <set> #include <map> #include <queue> #include <numeric> #define FOR(i, f, n) for(int (i) = (f); (i) < (n); (i)++) #define RFOR(i, f, n) for(int (i) = (f); (i) >= (n); (i)--) #define rep(i, n) for(int (i) = 0; (i) < (n); (i)++) #define rrep(i, n) for(int (i) = (n); (i) >= 0; (i)--) #define step(i, f, n, a) for(int (i) = (f); (i) < (n); (i)+=a) #define rstep(i, f, n, a) for(int (i) = (f); (i) >= (n); (i)-=a) #define p(...) printf(__VA_ARGS__); cout << endl; #define gets(x) x; cin >> x; #define puts(x) x; cout << x << endl; #define list_input(x, n) x[(n)]; for(int (i) = 0; (i) < (n); (i)++) cin >> x[i]; #define lambda(a, b, c) [](const a, const b){ return c ;} #define key(t, x, compare) [](const t& a, const t& b){ return a x compare b x ;} using namespace std; using pii = pair<int, int>; int main(){ long long result = 1; long long mod = 1000000007; int prime_count[170] = {}; //素数の数が170未満なのでこれくらい int N = 1000; //までの素数を作る int n; //入力 gets(n) int arr[N]; vector<int> prime; //各素因数の数をカウントしておく for(int i = 0; i < N; i++){ arr[i] = 1; } for(int i = 2; i < sqrt(N); i++){ if(arr[i]){ for(int j = 0; i * (j + 2) < N; j++){ arr[i *(j + 2)] = 0; } } } for(int i = 2; i < N; i++){ if(arr[i]){ prime.push_back(i); //素数表作成 } } FOR(i, 2, n+1){ //与えられた数まで int j = 0; int target = i; while(true){ if (target < prime[0]){ break; } if (target%prime[j] == 0){ // cout << target << prime[j] << j << endl; prime_count[j] +=1; target /= prime[j]; j = 0; continue; } j++; } } rep(i, sizeof(prime_count) / sizeof(prime_count[0]) ){ if (prime_count[i]){ result *= prime_count[i]+1; result %= mod; } } puts(result) }
a.cc: In function 'int main()': a.cc:42:28: error: 'sqrt' was not declared in this scope 42 | for(int i = 2; i < sqrt(N); i++){ | ^~~~
s040004234
p03828
C++
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; unsigned __int64 num = n; for (int i = n - 1; i > 0; --i) { num = num * i; } unsigned __int64 total = 0; for (unsigned __int64 i = num; i > 0; --i) { if (num % i == 0) { total = total + 1; } } cout << total%1000000007 << endl; }
a.cc: In function 'int main()': a.cc:10:26: error: expected initializer before 'num' 10 | unsigned __int64 num = n; | ^~~ a.cc:12:17: error: 'num' was not declared in this scope; did you mean 'enum'? 12 | num = num * i; | ^~~ | enum a.cc:14:26: error: expected initializer before 'total' 14 | unsigned __int64 total = 0; | ^~~~~ a.cc:15:30: error: expected ';' before 'i' 15 | for (unsigned __int64 i = num; i > 0; --i) { | ^~ | ; a.cc:15:31: error: 'i' was not declared in this scope 15 | for (unsigned __int64 i = num; i > 0; --i) { | ^ a.cc:15:35: error: 'num' was not declared in this scope; did you mean 'enum'? 15 | for (unsigned __int64 i = num; i > 0; --i) { | ^~~ | enum a.cc:15:45: error: expected ')' before ';' token 15 | for (unsigned __int64 i = num; i > 0; --i) { | ~ ^ | ) a.cc:15:49: error: 'i' was not declared in this scope 15 | for (unsigned __int64 i = num; i > 0; --i) { | ^ a.cc:20:17: error: 'total' was not declared in this scope 20 | cout << total%1000000007 << endl; | ^~~~~
s291774427
p03828
Java
import java.util.*; import java.lang.*; import java.io.*; import java.math.BigDecimal; public class BC52C { static long mod = (long)1e9 + 7; public static void main (String[] args) throws java.lang.Exception { InputReader in = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); int n = in.nextInt() ; HashMap<Integer, Integer> hm = new HashMap<>(); for (int i = 1; i <= n; i++) hm.put(i, 0); for (int i = 2; i <= n; i++) { int num = i; for (int j = 2; j <= Math.sqrt(i); j++) { int temp = 0; while (num % j == 0) { num /= j; temp++; } hm.put(j, hm.get(j) + temp); } if (num > 1) { hm.put(num, hm.get(num) + 1); } } long ans = 1; for (int x : hm.keySet()) { ans = (ans * (hm.get(x) + 1)) % mod; } w.println(ans); w.close(); } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new UnknownError(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new UnknownError(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int peek() { if (numChars == -1) return -1; if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { return -1; } if (numChars <= 0) return -1; } return buf[curChar]; } public void skip(int x) { while (x-- > 0) read(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public String nextString() { return next(); } public String next() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuffer res = new StringBuffer(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public String nextLine() { StringBuffer buf = new StringBuffer(); int c = read(); while (c != '\n' && c != -1) { if (c != '\r') buf.appendCodePoint(c); c = read(); } return buf.toString(); } public double nextDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public int[] nextIntArray(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); return a; } public long[] nextLongArray(int n) { long[] a = new long[n]; for (int i = 0; i < n; i++) a[i] = nextLong(); return a; } public boolean hasNext() { int value; while (isSpaceChar(value = peek()) && value != -1) read(); return value != -1; } private boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } } }
Main.java:6: error: class BC52C is public, should be declared in a file named BC52C.java public class BC52C { ^ 1 error
s978252523
p03828
C++
#include<bits/stdc++.h> typedef long long LL; #define mod 1E9+7 int N; int DIV[1001]; int main() { scanf("%d", &N); LL ans = 1; for(int i=1;i<=N;i++) { for(int j=1;j*j<=i;j++) { if(i%j==0) { DIV[j]++; DIV[i/j]++; } } } for(int i=2;i*i<=N;i++) { if(DIV[i]) ans*=(DIV[i]+1); if(ans>mod) ans%=mod; } printf("%lld\n", ans); }
a.cc: In function 'int main()': a.cc:24:27: error: invalid operands of types 'LL' {aka 'long long int'} and 'double' to binary 'operator%' 24 | if(ans>mod) ans%=mod; | ^ a.cc:24:27: note: in evaluation of 'operator%=(LL {aka long long int}, double)'