submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s492689195
p03992
C++
#include <cstdio> using namespace std; int main() { char s[20]; gets(s); for (int i = 0; i < 4; ++i) putchar(s[i]); printf(" "); for (int i = 4; i < 12; ++i) putchar(s[i]); printf("\n"); return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s122137120
p03992
C
#include<stdio.h> void main(){ scanf("%s", &s); int i; char t[12]; for ( i = 0; i < 12; i++ ){ if (i < 4) { t[i] = s[i]; }else if ( i == 4 ) { t[i] = ' '; }else{ t[i+1] = s[i]; } } return 0; }
main.c: In function 'main': main.c:4:22: error: 's' undeclared (first use in this function) 4 | scanf("%s", &s); | ^ main.c:4:22: note: each undeclared identifier is reported only once for each function it appears in main.c:6:13: error: stray '\343' in program 6 | char<U+3000>t[12]; | ^~~~~~~~ main.c:17:16: error: 'return' with a value, in function returning void [-Wreturn-mismatch] 17 | return 0; | ^ main.c:3:6: note: declared here 3 | void main(){ | ^~~~
s230560006
p03992
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { cin >> str; for (auto itr = str.begin(); itr != str.end(); ++ itr){ if (*(itr - str.begin()) == 4){ cout << " "; } cout << *itr; } return 0; }
a.cc: In function 'int main()': a.cc:9:12: error: 'str' was not declared in this scope; did you mean 'std'? 9 | cin >> str; | ^~~ | std
s350755638
p03992
C++
#include <cstdio> using namespace std; int main() { char s[20]; gets(s); for (int i = 0; i < 4; ++i) putchar(s[i]); printf(" "); for (int i = 4; i < 12; ++i) putchar(s[i]); printf("\n"); return 0; }
a.cc: In function 'int main()': a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | gets(s); | ^~~~ | getw
s417079371
p03992
C
#include <string> #include <iostream> int main() { char s[13]; scanf("%s", s); for(int i = 0; i < 13; i++) { if (i == 3) printf(" "); printf("%c", s[i]); } return 0; }
main.c:1:10: fatal error: string: No such file or directory 1 | #include <string> | ^~~~~~~~ compilation terminated.
s597941171
p03992
C++
#include <cstdlib> #include <cstdio> #include <iostream> #include <cmath> #include <algorithm> #include <vector> #include <set> #include <map> #include <cstring> using namespace std; typedef long long LL; typedef unsigned long long ULL; #define SIZE(x) (int((x).size())) #define rep(i,l,r) for (int i=(l); i<=(r); i++) #define repd(i,r,l) for (int i=(r); i>=(l); i--) #define rept(i,c) for (typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++) #ifndef ONLINE_JUDGE #define debug(x) { cerr<<#x<<" = "<<(x)<<endl; } #else #define debug(x) {} #endif void lemon() { char buf[100]; gets(buf); rep(i,0,3) printf("%c",buf[i]); printf(" "); rep(i,4,11) printf("%c",buf[i]); } int main() { ios::sync_with_stdio(true); lemon(); return 0; }
a.cc: In function 'void lemon()': a.cc:29:24: error: 'gets' was not declared in this scope; did you mean 'getw'? 29 | char buf[100]; gets(buf); | ^~~~ | getw
s167337991
p03992
C++
File Edit Options Buffers Tools C++ Help #include<bits/stdc++.h> using namespace std; main(){ string s; cin>>s; for(int i=0;i<4;i++){ cout<<s[i]; } cout<<" "; for(int i=4;i<12;i++){ cout<<s[i]; } cout<<endl; }
a.cc:1:1: error: 'File' does not name a type 1 | File Edit Options Buffers Tools C++ Help | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); |
s471887639
p03992
C++
#include<iostream> #include<vector> #include<string> #include<math.h> #include<algorithm> #include<windows.h> using namespace std; #define USINT_MAX 4294967295 int main(){ char a[13]; cin >> a; for (int i = 13; i > 5; i--) { a[i] = a[i - 1]; } a[5] = ' '; cout << a << endl; return 0; }
a.cc:6:9: fatal error: windows.h: No such file or directory 6 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.
s173764058
p03992
C++
#include <bits/stdc++.h> #define _ ios::sync_with_stdio(0); #define __ cin.tie(0); #define ___ cout.tie(0); #define endl "\n"; #define fr first #define se second using namespace std; int main() { _ __ ___ string s; cin >> s; for(int i=0; i<12; i++) { cout << s[i]; if(i == 3) cout << " "; } cout << endll; return 0; }
a.cc: In function 'int main()': a.cc:20:9: error: 'endll' was not declared in this scope; did you mean 'endl'? 20 | cout << endll; | ^~~~~ | endl
s164507067
p03992
C
#include<stdio.h> int main(){ char s[20]; int i; scanf("%s",s); for(i=0;s[i];i++){ if(i==4)printf(" "); printf("%c",s[i]); }prinf("\n"); return 0; }
main.c: In function 'main': main.c:9:4: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration] 9 | }prinf("\n"); | ^~~~~ | printf
s653026821
p03992
Java
import java.util.Scanner; public class A { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); String t = in.nextLine(); for(int i=0;i<t.length();i++){ System.out.print(t.charAt(i)); if(i==3) System.out.print(" "); } System.out.println(); } }
Main.java:4: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s633032703
p03992
C
#include<stdio.h> int main(){ char s[20]; int i; scanf("%s",s); for(i=0;s[i];i++){ if(i==4)printf(" "); printf("%c",s[i]); }prinf("\n"); return 0; }
main.c: In function 'main': main.c:9:4: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration] 9 | }prinf("\n"); | ^~~~~ | printf
s122291818
p03992
C
#include <stdlib.h> #include <stdio.h> int main ( void ) { int i = 0; for (i = 0; i < 4; i++) { putchar(getchar()); } putchar(' '); int c = getchar(); while (c != '\n' && c != EOF) { putchar(c); getchar(c); } return EXIT_SUCCESS; }
main.c: In function 'main': main.c:16:10: error: too many arguments to function 'getchar' 16 | getchar(c); | ^~~~~~~ In file included from main.c:2: /usr/include/stdio.h:582:12: note: declared here 582 | extern int getchar (void); | ^~~~~~~
s236166002
p03992
C
int main(){ scanf("%s",s); printf("%c%c%c%c %c%c%c%c%c%c%c%c",s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11],s[12]); return 0; }
main.c: In function 'main': main.c:3:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%s",s); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){ main.c:3:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | scanf("%s",s); | ^~~~~ main.c:3:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:3:20: error: 's' undeclared (first use in this function) 3 | scanf("%s",s); | ^ main.c:3:20: note: each undeclared identifier is reported only once for each function it appears in main.c:4:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 4 | printf("%c%c%c%c %c%c%c%c%c%c%c%c",s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10],s[11],s[12]); | ^~~~~~ main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:4:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s988459712
p03992
C++
import java.util.*; import java.io.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String a = sc.next(); // output System.out.println(a.substring(0,3)+ " " + a.substring(4,11)); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s724369963
p03992
C++
#include <iostream> #include <algorithm> using namespace std; main(){ char a[20]; for(int i=0;i<12;i++){ cin << a[i]; } for(int i=0;i<4;i++){ cout << a[i]; } cout << " "; for(int i=4;i<12;i++){ cout << a[i]; } cout << endl; }
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:8:21: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'char') 8 | cin << a[i]; | ~~~ ^~ ~~~~ | | | | | char | std::istream {aka std::basic_istream<char>} a.cc:8:21: note: candidate: 'operator<<(int, int)' (built-in) 8 | cin << a[i]; | ~~~~^~~~~~~ a.cc:8:21: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a[i]; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:8:17: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 8 | cin << a[i]; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a[i]; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a[i]; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:8:27: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 8 | cin << a[i]; | ^ /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 = char]': a.cc:8:13: required from here 8 | cin << a[i]; | ^ /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
s889321185
p03992
Java
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { /** * Q1 * @param args */ public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String hoge = br.readLine(); hoge = hoge.substring(0, 3)+" "+hoge.substring(4,11); System.out.println(); } }
Main.java:14: error: unreported exception IOException; must be caught or declared to be thrown String hoge = br.readLine(); ^ 1 error
s272423186
p03992
C++
#define FNAME "" #include <bits/stdc++.h> #define hash padjf9srpi #define y0 sdkfaslhagaklsldk #define y1 aasdfasdfasdf #define yn askfhwqriuperikldjk #define j1 assdgsdgasghsf #define tm sdfjahlfasfh #define lr asgasgash #define pb push_back #define mp make_pair #define forn(i, n) for (int i = 0; i < (n); i++) #define fornr(i, n) for (int i = (n) - 1; i >= 0; i--) #define forab(i, a, b) for (int i = (a); i < (b); i++) #define gcd __gcd #define all(a) (a).begin(), (a).end() #ifdef _WIN32 #define I64 "%I64d" #else #define I64 "%lld" #endif using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef long double LD; typedef pair <int, int> pii; typedef vector <int> vi; template <class T> T sqr(const T &a) {return a * a;} char s[1000]; int main() { #ifdef LOCAL freopen(FNAME".in", "r", stdin); freopen(FNAME".out", "w", stdout); #endif gets(s); forn(i, 4) printf("%c", s[i]); printf(" " ); forn(i, 8) printf("%c", s[i + 4]); }
a.cc: In function 'int main()': a.cc:44:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 44 | gets(s); | ^~~~ | getw
s501501162
p03992
Java
mport java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); String answer = line.substring(0,4) + " " + line.substring(4); System.out.println(answer); } }
Main.java:1: error: class, interface, enum, or record expected mport java.io.BufferedReader; ^ Main.java:2: error: class, interface, enum, or record expected import java.io.InputStreamReader; ^ 2 errors
s240603957
p03992
C++
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fs first #define sc second #define sz(x) (int) ((x).size()) #define forn(i, n) for (int i = 0; (i) < (n); ++i) #define fornr(i, n) for (int i = (n) - 1; (i) >= 0; --i) #define forab(i, a, b) for (int i = (a); (i) < (b); ++i) #define forba(i, a, b) for (int i = (b) - 1; (i) >= (a); --i) #define forit(it, c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it) #define all(c) (c).begin(), (c).end() #ifdef LOCAL #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define eprintf(...) static_cast<void>(0) #endif #ifdef _WIN32 #define I64 "%I64d" #else #define I64 "%lld" #endif typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef unsigned int uint; typedef vector <int> vi; typedef pair <int, int> pii; #define FNAME "" int main() { #ifdef LOCAL freopen(FNAME".in", "r", stdin); freopen(FNAME".out", "w", stdout); #endif char s[100]; gets(s); forn (i, 4) printf("%c", s[i]); printf(" "); forab (i, 4, 12) printf("%c", s[i]); return 0; }
a.cc: In function 'int main()': a.cc:46:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 46 | gets(s); | ^~~~ | getw
s913272971
p03992
C++
#include <iostream> #define reep(i,n,m) for(int i<(n);i<(m);i++) #define rep(i,n) reep(i,0,n) using namespace std; int main(){ string str; cin >> str; rep(i,4){ cout << str[i] } cout << " "; rep(i,8){ cout << str[i+4]; } cout << endl; }
a.cc: In function 'int main()': a.cc:3:30: error: expected ';' before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:3:30: error: expected primary-expression before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:3:40: error: expected ')' before ';' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ~ ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:11:13: error: 'i' was not declared in this scope 11 | rep(i,4){ | ^ a.cc:3:41: note: in definition of macro 'reep' 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:3:30: error: expected ';' before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:15:9: note: in expansion of macro 'rep' 15 | rep(i,8){ | ^~~ a.cc:3:30: error: expected primary-expression before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:15:9: note: in expansion of macro 'rep' 15 | rep(i,8){ | ^~~ a.cc:3:40: error: expected ')' before ';' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ~ ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:15:9: note: in expansion of macro 'rep' 15 | rep(i,8){ | ^~~
s701061700
p03992
C++
http://blog-imgs-85.fc2.com/e/r/o/erog/20160331_img_02_020.jpg
a.cc:1:1: error: 'http' does not name a type 1 | http://blog-imgs-85.fc2.com/e/r/o/erog/20160331_img_02_020.jpg | ^~~~
s041166215
p03992
C++
#include <iostream> #include <algorithm> #include <vector> #include <deque> #include <queue> #include <list> #include <stack> #include <string> #include <functional> #include <numeric> #include <cmath> #include <iomanip> #include <map> #include <set> #include <cstdlib> #include <Windows.h> #define INF 100000000 #define _INF -100000000 #define INFLL (long long)1e14 #define _INFLL (long long)-1e14 #define Loop(i, n) for(int i = 0; i < (int)n; i++) #define Loop1(i, n) for(int i = 1; i <= (int)n; i++) #define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--) #define Loopr1(i, n) for(int i = (int)n; i >= 1; i--) using namespace std; typedef long long int ll; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<ll> vll; typedef vector<vector<ll>> vvll; typedef pair<ll, ll> P; int main() { string s; cin >> s; s.insert(4, " "); cout << s << endl; return 0; }
a.cc:16:10: fatal error: Windows.h: No such file or directory 16 | #include <Windows.h> | ^~~~~~~~~~~ compilation terminated.
s998389124
p03992
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define vvi vector< vector<int> > #define vi vector<int> #define All(X) X.begin(),X.end() #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define REP(i,n) for(int i=0;i<(int)(n);i++) #define pb push_back #define pii pair<int,int> #define mp make_pair #define pi 3.14159265359 #define shosu(X) fixed << setprecision(X) ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} ll lcm(ll a,ll b){return a/gcd(a,b)*b;} int main(){ string s; cin >> s; REP(i,4) cout < < s[i]; cout << " "; FOR(i,4,12) cout << s[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:20:25: error: expected primary-expression before '<' token 20 | REP(i,4) cout < < s[i]; | ^
s001925934
p03992
C++
#include <iostream> #define reep(i,n,m) for(int i<(n);i<(m);i++) #define rep(i,n) reep(i,0,n) using namespace std; int main(){ string str; cin >> str; rep(i,4){ cout << str[i] } cout << " "; rep(i,8){ cout << str[i+4]; } cout << endl; }
a.cc: In function 'int main()': a.cc:3:30: error: expected ';' before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:3:30: error: expected primary-expression before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:3:40: error: expected ')' before ';' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ~ ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:11:13: error: 'i' was not declared in this scope 11 | rep(i,4){ | ^ a.cc:3:41: note: in definition of macro 'reep' 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:11:9: note: in expansion of macro 'rep' 11 | rep(i,4){ | ^~~ a.cc:3:30: error: expected ';' before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:15:9: note: in expansion of macro 'rep' 15 | rep(i,8){ | ^~~ a.cc:3:30: error: expected primary-expression before '<' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:15:9: note: in expansion of macro 'rep' 15 | rep(i,8){ | ^~~ a.cc:3:40: error: expected ')' before ';' token 3 | #define reep(i,n,m) for(int i<(n);i<(m);i++) | ~ ^ a.cc:4:18: note: in expansion of macro 'reep' 4 | #define rep(i,n) reep(i,0,n) | ^~~~ a.cc:15:9: note: in expansion of macro 'rep' 15 | rep(i,8){ | ^~~
s642271347
p03992
C++
#Include <string> #include <iostream> using namespace std; int main() { string s; cin >> s; cout << s.substr(0, 4) << ' ' << s.substr(4, 8) << "\n"; return 0; }
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include? 1 | #Include <string> | ^~~~~~~ | include
s327196122
p03992
C++
#include <bits/stdc++.h> int main(){ string s; cin >> s; for(int i=0; i<4; i++) putchar(s[i]); putchar(' '); for(int i=4; i<12; i++) putchar(s[i]); puts(""); }
a.cc: In function 'int main()': a.cc:4:1: error: 'string' was not declared in this scope 4 | string s; | ^~~~~~ a.cc:4:1: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> s; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:5:8: error: 's' was not declared in this scope 5 | cin >> s; | ^
s598913433
p03992
C++
#include <algorithm> #include <cstddef> #include <cstdint> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> int main() { std::string s; std::getline(std::cin, s); std::cout << s.substr(0, 4) << " " << s.substr(4) << std::endl; return 0; } #include <algorithm> #include <cstddef> #include <cstdint> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> int main() { std::string s; std::getline(std::cin, s); std::cout << s.substr(0, 4) << " " << s.substr(4) << std::endl; return 0; }
a.cc:37:5: error: redefinition of 'int main()' 37 | int main() { | ^~~~ a.cc:16:5: note: 'int main()' previously defined here 16 | int main() { | ^~~~
s357618040
p03993
C++
#include <bits/stdc++.h> #include <algorithm> #include <vector> #include <iostream> #include <string> using namespace std; int main() { //input int n;cin >> n; vector<int> a(n); for(int i = 0; i < n; i++) cin >> a[i]; int counter = 0; //compute for(int i = 0; i < n; i++) a[i] = a[i] - 1; for(int i = 0;i < n; i++) { if(a[a[i]] == i){ counter += 1; } } int ans; ans = counter / 2; //output cout << ans << endl;
a.cc: In function 'int main()': a.cc:26:23: error: expected '}' at end of input 26 | cout << ans << endl; | ^ a.cc:8:12: note: to match this '{' 8 | int main() { | ^
s675335645
p03993
C++
n = int(input()) a = [int(x) for x in input().split()] # print(n) # print(a) count = 0 for i in range(n - 1): if(i == a[a[i - 1] - 1]): count += 1 print(count) # print(int(count/2))
a.cc:4:3: error: invalid preprocessing directive #print 4 | # print(n) | ^~~~~ a.cc:5:3: error: invalid preprocessing directive #print 5 | # print(a) | ^~~~~ a.cc:14:3: error: invalid preprocessing directive #print 14 | # print(int(count/2)) | ^~~~~ a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s998438051
p03993
C++
#include <bits/stdc++.h> #include <vector> #include <algorithm> #include <iostream> #include <cmath> using namespace std; int main() { int N, ans; cin >> N; ans=0; vector<int> a(N); for (int i=0; i<N; i++) { cin >> a[i]; } for (int j=0; j<N; j++) { if (a[a[i]-1]==i+1) { ans=ans+1; } } cout << ans/2 << endl; }
a.cc: In function 'int main()': a.cc:17:13: error: 'i' was not declared in this scope 17 | if (a[a[i]-1]==i+1) { | ^
s752868581
p03993
Java
import java.util.*; import java.math.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int ans = 0; List<Integer> a = new ArrayList<>(); for (int i = 0; i < N; i++) { int d = sc.nextInt(); a.add(d); } for (int i = 0; i < N; i++) { int r = a.get(i+1); if ((i+1) == a,get(r)) ans++; } ans = ans/2; System.out.println(ans); } }
Main.java:18: error: ')' expected if ((i+1) == a,get(r)) ans++; ^ Main.java:18: error: ';' expected if ((i+1) == a,get(r)) ans++; ^ 2 errors
s045804154
p03993
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); //値の取得 int N = sc.nextInt(); int[] A = new int[N]; for(int i=0;i<N;i++){ A[i] = sc.nextLong(); } //カウント int count=0; //両想いうさぎ for(int i=0;i<N;i++){ if(A[A[i]-1]==i+1){ count++; } } System.out.println(count/2); } }
Main.java:9: error: incompatible types: possible lossy conversion from long to int A[i] = sc.nextLong(); ^ 1 error
s792241067
p03993
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); //値の取得 int N = sc.nextInt(); int[] A = new int[N]; for(int i=0;i<N;i++){ A[i] = sc.nextLong(); } //カウント int count=0; //両想いうさぎ for(int i=0;i<N;i++){ if((A[A[i]-1)==i+1){ count++; } } System.out.println(count/2); } }
Main.java:15: error: ']' expected if((A[A[i]-1)==i+1){ ^ 1 error
s226716933
p03993
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); //値の取得 int N = sc.nextInt(); int[] A = new int[N]; for(int i=0;i<N;i++){ A[i] = sc.nextLong(); } //カウント int count=0; //両想いうさぎ for(int i=0;i<N;i++){ if((A[A[i]-1)= i+1)){ count++; } } System.out.println(count/2); } }
Main.java:15: error: ']' expected if((A[A[i]-1)= i+1)){ ^ Main.java:15: error: illegal start of expression if((A[A[i]-1)= i+1)){ ^ 2 errors
s393989395
p03993
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int A[] = new int[N]; int count = 0; int i = 0; for(i = 0;i < N; i++){ A[i] = sc.nextInt(); } for(i = 0;i < N; i++){ if(i == A[A[i]]){ count += 1; } } count /2; System.out.println(count); } }
Main.java:17: error: not a statement count /2; ^ 1 error
s643509919
p03993
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-i); } return res;} int main() { ll n; cin>>n; ll c=0; for(ll i=0; i<n; i++){ cin>>a[i];} for(ll i=0; i<n; i++){ if(a[a[i]]==i+1){ c++;}} cout<<c<<endl;}
a.cc: In function 'int main()': a.cc:24:6: error: 'a' was not declared in this scope 24 | cin>>a[i];} | ^ a.cc:26:4: error: 'a' was not declared in this scope 26 | if(a[a[i]]==i+1){ | ^
s741673722
p03993
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc =new Scanner(System.in); int N =sc.nextInt(); int A[] =new int[N]; for(int i=0;i<N;i++){ A[i]=sc.nextInt();} int ans =0; for(int j=0;j<n;j++){ if(A[A[i]-1]==i){ans =ans+1;}} System.out.println(ans/2); } }
Main.java:10: error: cannot find symbol for(int j=0;j<n;j++){ ^ symbol: variable n location: class Main Main.java:11: error: cannot find symbol if(A[A[i]-1]==i){ans =ans+1;}} ^ symbol: variable i location: class Main Main.java:11: error: cannot find symbol if(A[A[i]-1]==i){ans =ans+1;}} ^ symbol: variable i location: class Main 3 errors
s530843626
p03993
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力] int N = sc.nextInt(); int[] number = new int[N]; boolean[] notpair = new boolean[N]; int count = 0; for(int i=0; i<N; i++){ number[i] = sc.nextInt(); } for(int i=0; i<N; i++){ if(i==number[number[i]-1]-1){ count++; } count /= 2; System.out.println(count); } }
Main.java:21: error: reached end of file while parsing } ^ 1 error
s106271206
p03993
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int rab[20000]; int N; cin>>N; for(int i = 1;i<N;i++)cin>>rab[i]; int cnt=0; for(int i = 1;i<N;i++){ if(i == rab[i])rab++; } cnt=/2; cout<<cnt<<endl; }
a.cc: In function 'int main()': a.cc:13:16: error: lvalue required as increment operand 13 | if(i == rab[i])rab++; | ^~~ a.cc:15:5: error: expected primary-expression before '/' token 15 | cnt=/2; | ^
s810774639
p03993
C++
#include <bits/stdc++.h> #define rep(i,n) for (int (i) = 0; (i) < (n); i++) #define ll long long using namespace std; int main(){ int n; int ans=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ if(i==a[a[i]]){ ans++; } } cout<<ans/2<<endl; }
a.cc: In function 'int main()': a.cc:11:12: error: 'a' was not declared in this scope 11 | cin>>a[i]; | ^ a.cc:14:23: error: 'a' was not declared in this scope 14 | if(i==a[a[i]]){ | ^
s157440960
p03993
C++
#include <bits/stdc++.h> #define rep(i,n) for (int (i) = 0; (i) < (n); i++) #define ll long long using namespace std; int main(){ int n, int ans=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ if(i==a[a[i]]){ ans++; } } cout<<ans/2<<endl; }
a.cc: In function 'int main()': a.cc:8:5: error: expected unqualified-id before 'int' 8 | int ans=0; | ^~~ a.cc:11:22: error: 'a' was not declared in this scope 11 | cin>>a[i]; | ^ a.cc:14:23: error: 'a' was not declared in this scope 14 | if(i==a[a[i]]){ | ^ a.cc:15:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | ans++; | ^~~ | abs a.cc:18:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 18 | cout<<ans/2<<endl; | ^~~ | abs
s098734275
p03993
C++
#include <bits/stdc++.h> #define rep(i,n) for (int (i) = 0; (i) < (n); i++) #define ll long long using namespace std; int main(){ int n, int ans=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ if(i==a[a[i]]){ ans++; } } cout<<ans/2<<endl; }
a.cc: In function 'int main()': a.cc:8:5: error: expected unqualified-id before 'int' 8 | int ans=0; | ^~~ a.cc:11:22: error: 'a' was not declared in this scope 11 | cin>>a[i]; | ^ a.cc:14:23: error: 'a' was not declared in this scope 14 | if(i==a[a[i]]){ | ^ a.cc:15:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | ans++; | ^~~ | abs a.cc:18:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 18 | cout<<ans/2<<endl; | ^~~ | abs
s222962441
p03993
C++
#include <bits/stdc++.h> #define rep(i,n) for (int (i) = 0; (i) < (n); i++) #define ll long long using namespace std; int main(){ ll n; cin>>n; vector<int> a[n]; int ans=0; rep(i,n) { cin >> a[i]; a[i]--; } rep(i,n){ if(a[a[i]] == i){ ans++; } } cout<<ans/2<<endl; }
a.cc: In function 'int main()': a.cc:12:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 12 | cin >> a[i]; | ~~~ ^~ ~~~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In file included 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, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<int>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<int>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<int>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<int>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<int>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<int>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<int>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<int>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/inclu
s281612652
p03993
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin>>N; int a[N]; int ans=0; for(int i=0;i<N;i++){ cin>>a[i]; for(int j=0;j<N;j++){ cin>>a[j] if(a[j]==i&&a[i]==j){ ans++; } } } cout<<ans/2<<endl; }
a.cc: In function 'int main()': a.cc:12:16: error: expected ';' before 'if' 12 | cin>>a[j] | ^ | ; 13 | if(a[j]==i&&a[i]==j){ | ~~
s182290370
p03993
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main(){ int a; cin >> a; vector<int> arr(a); rep(i,a){ cin >> arr[i]; } var sum = 0; rep(i,a){ if(arr[arr[i]-1] == i+1) sum++; } cout << (sum/2) << endl; }
a.cc: In function 'int main()': a.cc:11:3: error: 'var' was not declared in this scope 11 | var sum = 0; | ^~~ a.cc:13:28: error: 'sum' was not declared in this scope 13 | if(arr[arr[i]-1] == i+1) sum++; | ^~~ a.cc:15:12: error: 'sum' was not declared in this scope 15 | cout << (sum/2) << endl; | ^~~
s265751621
p03993
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; // ll は long long と同じとする。(int64_t) int main(){ int N; cin >> N; int ans = 0; int a[N + 1]; for(int i = 1; i <= N; i++){ cin >> a[i]; } for(int i = 1; i <= N; i++){ if(a.at(i) < N){ if(a[a[i]] == i){ ans++; } } } cout << ans / 2 << endl; }
a.cc: In function 'int main()': a.cc:13:14: error: request for member 'at' in 'a', which is of non-class type 'int [(N + 1)]' 13 | if(a.at(i) < N){ | ^~
s487417283
p03993
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; // ll は long long と同じとする。(int64_t) int main(){ int N; cin >> N; int ans = 0; int(a[N + 1]) for(int i = 1; i <= N; i++){ cin >> a[i]; } for(int i = 1; i <= N; i++){ if(a.at(i) < N){ if(a[a[i]] == i){ ans++; } } } cout << ans / 2 << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: 'a' was not declared in this scope 8 | int(a[N + 1]) | ^ a.cc:9:20: error: 'i' was not declared in this scope 9 | for(int i = 1; i <= N; i++){ | ^
s790681704
p03993
C++
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int a[] = new int[N]; for(int i=0;i<N;i++){ a[i]=sc.nextInt(); } int ans=0; for(int i=0;i<N;i++){ if(a[a[i]-1]==i+1){ ans++; } } System.out.println(ans/2); } }
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s626608866
p03993
C++
#include<iostream> using namespace std; int main(){ int n,i,ans;cin >> n;ans = 0; int a[n]; for(i=0;i<n;i++) cin >> a[i]; for(i=0;i<n;i++){ if (a[a[i]-1]-1 == i) ans += 1; } cout << a/2 << endl; }
a.cc: In function 'int main()': a.cc:10:12: error: invalid operands of types 'int [n]' and 'int' to binary 'operator/' 10 | cout << a/2 << endl; | ~^~ | | | | | int | int [n]
s352585086
p03993
Java
#include <bits/stdc++.h> using namespace std; int main(){ int x; cin >> x; vector<int> vec; int cnt = 0; for(int i = 0; i < x; i++){ int lover; cin >> lover; lover--; vec.push_back(lover); if(lover < i){ if(i == vec.at(lover)){ cnt++; } } } cout << cnt; }
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:7: error: not a statement cin >> x; ^ Main.java:13: error: not a statement cin >> lover; lover--; ^ Main.java:21: error: not a statement cout << cnt; ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by default. int main(){ ^ (use --enable-preview to enable unnamed classes) 6 errors
s398807287
p03993
Java
#include <bits/stdc++.h> using namespace std; int main(){ int x; cin >> x; vector<int> vec; int cnt = 0; for(int i = 0; i < x; i++){ int lover; cin >> lover; lover--; vec.push_back(lover); if(lover < i){ if(i == vec.at(lover)){ cnt++; } } } cout << cnt; }
Main.java:1: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:1: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:7: error: not a statement cin >> x; ^ Main.java:13: error: not a statement cin >> lover; lover--; ^ Main.java:21: error: not a statement cout << cnt; ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by default. int main(){ ^ (use --enable-preview to enable unnamed classes) 6 errors
s338417560
p03993
C++
#include <iostream> using namespace std; int main(void){ int i; cin >> i >> endl; int a[i]; cin >> a[i] >> endl; int index = 0; while(i < sizeof(a)){ if(i == a[i]) continue; cout << a[i] << endl; index++; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 6 | cin >> i >> endl; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~
s145017814
p03993
Java
import java.util.Scanner; import java.util.ArrayList; public class CodeFes2016AB { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); ArrayList<Integer> al = new ArrayList<Integer>(); int n = scanner.nextInt(); int cnt = 0; for(int i = 0; i < n; i++ ){ int lover = scanner.nextInt() - 1; if(lover < i){ if(al.get(lover)==i){ cnt++; } } al.add(lover); } System.out.println(cnt); } }
Main.java:4: error: class CodeFes2016AB is public, should be declared in a file named CodeFes2016AB.java public class CodeFes2016AB { ^ 1 error
s581044036
p03993
C++
#include <iostream> using namespace std; int main(void){ int i; cin >> i >> endl; int a[i]; cin >> a[i] >> endl; while(i < sizeof(a)){ if(i == a[i]) continue; cout << a[i] << endl; i++; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 6 | cin >> i >> endl; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~
s202409489
p03993
C++
#include <iostream> using namespace std; int main(void){ int i; cin >> i >> endl; int a[i]; cin >> a[i] >> endl; while(i << sizeof(a)){ if(i == a[i]) continue; cout << a[i] << endl; i++; }
a.cc: In function 'int main()': a.cc:5:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 5 | cin >> i >> endl; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~
s531353829
p03993
C++
#include <iostream> using namespace std; int main(void){ int i; cin >> i >> endl; int a[i]; cin >> a[i] >> endl; while(cin >> i){ if(i == a[i]) continue; cout << a[i] << endl; i++; }
a.cc: In function 'int main()': a.cc:5:12: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 5 | cin >> i >> endl; | ~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~
s733847061
p03993
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using VI = vector<int>; using VL = vector<ll>; using loop = int; template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>; #define FOR(i,a,n) for(loop (i)=(a);(i)<(n);++(i)) #define eFOR(i,a,n) for(loop (i)=(a);(i)<=(n);++(i)) #define rFOR(i,a,n) for(loop (i)=(n)-1;(i)>=(a);--(i)) #define erFOR(i,a,n) for(loop (i)=(n);(i)>=(a);--(i)) #define each(i, a) for(auto &i : a) #define SORT(i) sort((i).begin(),(i).end()) #define rSORT(i,a) sort((i).begin(),(i).end(),(a)) #define all(i) (i).begin(),(i).end() #define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x)) #define line cout << "------------------------\n" #define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ") #define stop system("pause") //comment out this on AOJ. constexpr ll INF = 1000000000; constexpr ll LLINF = 1LL << 60; constexpr ll mod = 1000000007; constexpr ll MOD = 998244353; constexpr ld eps = 1e-10; constexpr ld pi = 3.1415926535897932; template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; } template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; } inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; } template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; } template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); } template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); } template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); } template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); } int main() { init(); int n; cin >> n; VI a(n); cin >> a; a.push_back(int("tourist")); each(i, a)--i; int ans = 0; FOR(i, 0, n) { if (a[a[i]] == i) { a[a[i]] = n; ++ans; } } cout << ans << "\n"; }
a.cc: In function 'int main()': a.cc:42:17: error: cast from 'const char*' to 'int' loses precision [-fpermissive] 42 | a.push_back(int("tourist")); | ^~~~~~~~~~~~~~
s422555936
p03993
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define rep(i, a, n) for (int i = a; i < (n); ++i) int main() { int n; cin >> n; vector<int> a(n); rep(i, 0, n) cin >> a[i]; int count = 0; rep(i, 0, n) { if (i+1 == a[i]) ++code; } cout << count << endl; }
a.cc: In function 'int main()': a.cc:19:36: error: 'code' was not declared in this scope 19 | if (i+1 == a[i]) ++code; | ^~~~
s371032930
p03993
C++
#include <bits/stdc++.h> #include <math.h> #define rep(i, n) for(int i = 0; i < n; ++i) using namespace std; int main() { int n, s = 0; cin >> n; vector<int> r(n); vector<vector<bool>> v(n, vector<bool>(n, 0)); rep(i, n){ cin >> r[i]; --r[i]; v[i][r[i]] = 1; } rep(i, n){ if(v[i][r[i]] && v[r[i][i]]) ++s; } cout << s << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:28: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript 17 | if(v[i][r[i]] && v[r[i][i]]) ++s; | ^
s940056959
p03993
C++
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(),(a).end() #define rALL(a) (a).rbegin(),(a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; int main() { int N, ans = 0; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++){ cin >> A.at(i); A.at(i)--; } for (int i = 0; i < N; i++){ if (A.at(A.at(i) == i){ ans++; } } cout << ans / 2 << endl; }
a.cc: In function 'int main()': a.cc:18:31: error: expected ')' before '{' token 18 | if (A.at(A.at(i) == i){ | ~ ^ | ) a.cc:21:5: error: expected primary-expression before '}' token 21 | } | ^
s586592673
p03993
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> using namespace std; typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; typedef long double ld; const int inf=1e9+7; const ll INF=1LL<<60 ; const ll mod=1e9+7 ; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef complex<ld> Point; const ld eps = 1e-8; const ld pi = acos(-1.0); typedef pair<int, int> P; typedef pair<ld, ld> LDP; typedef pair<ll, ll> LP; #define fr first #define sc second #define all(c) c.begin(),c.end() #define pb push_back #define debug(x) cout << #x << " = " << (x) << endl; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //#define int long long void solve() { int n; cin >> n; vector<int> a(n); set<int> se[100100]; int res = 0; rep(i, n) { cin >> a[i]; if(se[i].count(a[i]) ++res; se[a[i]].insert(i); } cout << res << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(0); //cout << fixed << setprecision(10); //init(); solve(); //cout << "finish" << endl; return 0; }
a.cc: In function 'void solve()': a.cc:59:23: error: lvalue required as increment operand 59 | if(se[i].count(a[i]) ++res; | ~~~~~~~~~~~^~~~~~ a.cc:60:27: error: expected ')' before ';' token 60 | se[a[i]].insert(i); | ^ | ) a.cc:59:11: note: to match this '(' 59 | if(se[i].count(a[i]) ++res; | ^ a.cc:60:24: error: could not convert 'se[a.std::vector<int>::operator[](((std::vector<int>::size_type)i))].std::set<int>::insert(i)' from 'std::pair<std::_Rb_tree_const_iterator<int>, bool>' to 'bool' 60 | se[a[i]].insert(i); | ~~~~~~~~~~~~~~~^~~ | | | std::pair<std::_Rb_tree_const_iterator<int>, bool>
s033173580
p03993
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> using namespace std; typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; typedef long double ld; const int inf=1e9+7; const ll INF=1LL<<60 ; const ll mod=1e9+7 ; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef complex<ld> Point; const ld eps = 1e-8; const ld pi = acos(-1.0); typedef pair<int, int> P; typedef pair<ld, ld> LDP; typedef pair<ll, ll> LP; #define fr first #define sc second #define all(c) c.begin(),c.end() #define pb push_back #define debug(x) cout << #x << " = " << (x) << endl; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //#define int long long void solve() { int n; cin >> n; vector<int> a(n); set<int> se[100100]; int res = 0; rep(i, n) { cin >> a[i]; if(se[i].count(a[i]]) ++res; se[a[i]].insert(i); } cout << res << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(0); //cout << fixed << setprecision(10); //init(); solve(); //cout << "finish" << endl; return 0; }
a.cc: In function 'void solve()': a.cc:59:28: error: expected ')' before ']' token 59 | if(se[i].count(a[i]]) ++res; | ~ ^ | ) a.cc:59:28: error: expected ')' before ']' token 59 | if(se[i].count(a[i]]) ++res; | ~ ^ | ) a.cc:59:28: error: expected primary-expression before ']' token
s504650104
p03993
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #include<utility> #include<cassert> using namespace std; typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; typedef long double ld; const int inf=1e9+7; const ll INF=1LL<<60 ; const ll mod=1e9+7 ; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef complex<ld> Point; const ld eps = 1e-8; const ld pi = acos(-1.0); typedef pair<int, int> P; typedef pair<ld, ld> LDP; typedef pair<ll, ll> LP; #define fr first #define sc second #define all(c) c.begin(),c.end() #define pb push_back #define debug(x) cout << #x << " = " << (x) << endl; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } //#define int long long void solve() { int n; cin >> n; vector<int> a(n); set<int> se[100100]; int res = 0; rep(i, n) { cin >> a[i]; if(se[i].count[a[i]]) ++res; se[a[i]].insert(i); } cout << res << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(0); //cout << fixed << setprecision(10); //init(); solve(); //cout << "finish" << endl; return 0; }
a.cc: In function 'void solve()': a.cc:59:23: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript 59 | if(se[i].count[a[i]]) ++res; | ^
s930707981
p03993
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> A; for(int i=0; i<N; i++){ int a; cin >> a; A.push_back(a); } int count=0; for(int i=0; i<N; i++){ if(i+1==A[A[i]-1]) count++; } cout << count/2 << endl; return 0; } #include<bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> A; for(int i=0; i<N; i++){ int a; cin >> a; A.push_back(a); } int count=0; for(int i=0; i<N; i++){ if(i+1==A[A[i]-1]) count++; } cout << count/2 << endl; return 0; }
a.cc:22:5: error: redefinition of 'int main()' 22 | int main(){ | ^~~~ a.cc:4:5: note: 'int main()' previously defined here 4 | int main(){ | ^~~~
s963288846
p03993
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int (i) = 0; (i) < (n); ++(i)) #define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep #define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for #define rfor(i,a,b) for(int (i) = (b) - 1; (i) >= (a); --(i)) //Reversi for #define ll long long #define mod (1000000007) #define YES cout << "YES" << endl; #define Yes cout << "Yes" << endl; #define yes cout << "yes" << endl; #define NO cout << "NO" << endl; #define No cout << "No" << endl; #define no cout << "no" << endl; int asc(const void *a, const void *b) { return *(int *)a - *(int *)b; } int desc(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { ll n,ans = 0; cin >> n; vector<ll> a(n,0); rep(i, n)cin >> a[i]; rep(i, n){a if (i + 1 == a[a[i] - 1]) { ++ans; } a.erase(a.begin()); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:30:16: error: expected ';' before 'if' 30 | rep(i, n){a | ^ | ; 31 | if (i + 1 == a[a[i] - 1]) { | ~~
s139484406
p03993
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n]; for(int i = 0;i < n;i++)a[i]=sc.nextInt(); int cnt = 0; boolean friend = new boolean[n]; Arrays.fill(friend,true); int cnt = 0; for(int i = 0;i < n;i++){ if(a[a[i]]==i&&a[i]==true&&a[a[i]]==true){ cnt++; a[i]=false; a[a[i]]=false; } } System.out.println(cnt); } }
Main.java:9: error: incompatible types: boolean[] cannot be converted to boolean boolean friend = new boolean[n]; ^ Main.java:10: error: no suitable method found for fill(boolean,boolean) Arrays.fill(friend,true); ^ method Arrays.fill(long[],long) is not applicable (argument mismatch; boolean cannot be converted to long[]) method Arrays.fill(int[],int) is not applicable (argument mismatch; boolean cannot be converted to int[]) method Arrays.fill(short[],short) is not applicable (argument mismatch; boolean cannot be converted to short[]) method Arrays.fill(char[],char) is not applicable (argument mismatch; boolean cannot be converted to char[]) method Arrays.fill(byte[],byte) is not applicable (argument mismatch; boolean cannot be converted to byte[]) method Arrays.fill(boolean[],boolean) is not applicable (argument mismatch; boolean cannot be converted to boolean[]) method Arrays.fill(double[],double) is not applicable (argument mismatch; boolean cannot be converted to double[]) method Arrays.fill(float[],float) is not applicable (argument mismatch; boolean cannot be converted to float[]) method Arrays.fill(Object[],Object) is not applicable (argument mismatch; boolean cannot be converted to Object[]) Main.java:11: error: variable cnt is already defined in method main(String[]) int cnt = 0; ^ Main.java:13: error: incomparable types: int and boolean if(a[a[i]]==i&&a[i]==true&&a[a[i]]==true){ ^ Main.java:13: error: incomparable types: int and boolean if(a[a[i]]==i&&a[i]==true&&a[a[i]]==true){ ^ Main.java:15: error: incompatible types: boolean cannot be converted to int a[i]=false; ^ Main.java:16: error: incompatible types: boolean cannot be converted to int a[a[i]]=false; ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 7 errors
s463605480
p03993
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,c=0;cin>>n; vector<int>a(n); for(int i=0;i<n;i++)cin>>a.at(i); for(int i=0;i<n-1;i++){ if(a.at(a.at(i)-1)==i+1){ c++; a.at(a.at(i))=0 } } cout<<c<<endl;
a.cc: In function 'int main()': a.cc:10:22: error: expected ';' before '}' token 10 | a.at(a.at(i))=0 | ^ | ; 11 | } | ~ a.cc:13:17: error: expected '}' at end of input 13 | cout<<c<<endl; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s215497080
p03993
C++
#include <iostream> using namespace std; int main() { long n,ans=0; cin >> n; long a[n+1]; for(i=1;i<=n;i++){ cin >> a[i]; } for(i=1;i<=n;i++){ if(i=a[a[i]]){ ans++; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:13: error: 'i' was not declared in this scope 8 | for(i=1;i<=n;i++){ | ^ a.cc:11:13: error: 'i' was not declared in this scope 11 | for(i=1;i<=n;i++){ | ^
s265487139
p03993
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> a(n+1) for(int i=1;i<=n;i++){ cin >> a[i]; } int res=0; for(int i=1;i<=n;i++){ if(a[a[i]]==i) res++; } cout << res/2 << endl; }
a.cc: In function 'int main()': a.cc:10:3: error: expected ',' or ';' before 'for' 10 | for(int i=1;i<=n;i++){ | ^~~ a.cc:10:15: error: 'i' was not declared in this scope 10 | for(int i=1;i<=n;i++){ | ^
s027324825
p03993
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >>N; vector<int> s(N,0); int count = 0; for(int i=0;i<N;i++){ cin >> s.at(i); } for(inti=0;i<N;i++){ if(s.at(i)==s.at(s.at(i))) count += 1; } cout << count/2 << endl; }
a.cc: In function 'int main()': a.cc:12:5: error: 'inti' was not declared in this scope; did you mean 'int'? 12 | for(inti=0;i<N;i++){ | ^~~~ | int a.cc:12:12: error: 'i' was not declared in this scope 12 | for(inti=0;i<N;i++){ | ^
s597458303
p03993
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >>N; vector<int> s(N,0) int count = 0; for(i=0;i<N;i++){ cin >> s.at(i); } for(i=0;i<N;i++){ if(s.at(i)==s.at(s.at(i))) count += 1; } cout << count/2 << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: expected ',' or ';' before 'int' 8 | int count = 0; | ^~~ a.cc:9:5: error: 'i' was not declared in this scope 9 | for(i=0;i<N;i++){ | ^ a.cc:12:5: error: 'i' was not declared in this scope 12 | for(i=0;i<N;i++){ | ^ a.cc:14:10: error: overloaded function with no contextual type information 14 | count += 1; | ^ a.cc:16:14: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/' 16 | cout << count/2 << endl; | ~~~~~^~
s757262727
p03993
C++
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int n;cin>>n; vector<int>a(n); for(auto&& w:a)cin>>w; int sm=0; for(i=0;i<n;i++){ int x=a[i]; int y=a[x-1]; if(i==y-1)sm++; } cout<<sm/2<<endl; }
a.cc: In function 'int main()': a.cc:10:13: error: 'i' was not declared in this scope 10 | for(i=0;i<n;i++){ | ^
s962258648
p03993
C++
#include <>bits/stdc++.h> using namespace std; #define int long long signed main(){ int n;cin>>n; vector<int>a(n); for(auto&& w:a)cin>>w; int sm=0; for(i=0;i<n;i++){ int x=a[i]; int y=a[x-1]; if(i==y-1)sm++; } cout<<sm/2<<endl; }
a.cc:1:16: warning: extra tokens at end of #include directive 1 | #include <>bits/stdc++.h> | ^ a.cc:1:10: fatal error: >bit: No such file or directory 1 | #include <>bits/stdc++.h> | ^~~~~~ compilation terminated.
s976041072
p03993
C
n = int(input()) A = list(map(int, input().split())) cnt = 0 for i,a in enumerate(A): if i == A[a - 1] - 1: cnt +=1 print(cnt // 2)
main.c:1:1: warning: data definition has no type or storage class 1 | n = int(input()) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:1:5: error: expected expression before 'int' 1 | n = int(input()) | ^~~
s942569104
p03993
C++
#include <bits/stdc++.h> using namespace std; int main() { int = n,ans = 0; cin >> n; vector<int> rb(n); for(int i = 0; i < n; i++){ cin >> rb.at(i); } for(int j; j < n; j++){ if(rb.at(j) == rb.at(rb.at(j))) ans++; } cout << ans / 2 << endl; }
a.cc: In function 'int main()': a.cc:5:7: error: expected unqualified-id before '=' token 5 | int = n,ans = 0; | ^ a.cc:6:10: error: 'n' was not declared in this scope; did you mean 'yn'? 6 | cin >> n; | ^ | yn a.cc:13:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 13 | ans++; | ^~~ | abs a.cc:15:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | cout << ans / 2 << endl; | ^~~ | abs
s720431132
p03993
C++
#include <iostream> #include <set> using namespace std; int N,A[100010]; set<int> s[100010]; int main(){ cin >> N; int ans = 0; for(int i=1;i<=N;i++){ cin >> A[i]; s[A[i]].insert(i); } int ans = 0; for(int i=1;i<=N;i++) if(s[i].count(A[i])==1)) ans++; cout << ans/2 << endl; }
a.cc: In function 'int main()': a.cc:15:7: error: redeclaration of 'int ans' 15 | int ans = 0; | ^~~ a.cc:10:7: note: 'int ans' previously declared here 10 | int ans = 0; | ^~~ a.cc:16:48: error: expected primary-expression before ')' token 16 | for(int i=1;i<=N;i++) if(s[i].count(A[i])==1)) ans++; | ^
s581788759
p03993
C++
//↓template↓ #include "bits/stdc++.h" using namespace std; #define Would #define you #define all(n) n.begin(),n.end() const long long INF = 1e18; const long long MOD = 1e9 + 7; const double pi = acos(-1); const int SIZE = 1 << 17; int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30]; long long fac[200005], finv[200005], inv[200005]; vector<long long>dij; struct edge { long long to, cost; }; vector<vector<edge> >G; long long mod_pow(long long a, long long b) { long long res = 1; while (b) { if (b & 1) { res = res * a%MOD; } a = a * a%MOD; b >>= 1; } return res; } void addedge(int from, int to, int cost) { G[from].push_back({ to,cost }); G[to].push_back({ from,cost }); } //↑template↑ int n, k[100005], ans; int main() { cin >> n; for (int i = 0; i < n; ++i) { cin >> k[i]; } for (int i = 1; i <= n; i++) { if (a[a[i]] == i) { ++ans; } } cout << ans / 2 << endl; }
a.cc: In function 'int main()': a.cc:40:21: error: 'a' was not declared in this scope 40 | if (a[a[i]] == i) { | ^
s041546065
p03993
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,cnt=0; cin >> n; vector<int> v(n); for(int i=0; i<n; i++) { cin >> v[i]; } for(int i=0; i<n; i++) { if(s[i]==s[s[i]+1]&&i<s[i]+1) { cnt++; } } cout << cnt << endl; }
a.cc: In function 'int main()': a.cc:12:8: error: 's' was not declared in this scope 12 | if(s[i]==s[s[i]+1]&&i<s[i]+1) { | ^
s108490061
p03993
C++
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> A(N); for (int& x : A) cin >> x, --x; int ans = 0; for (int i = 0; i < N; i++) { ans += (i == a[a[i]]); } cout << ans / 2 << endl; }
a.cc: In function 'int main()': a.cc:14:18: error: 'a' was not declared in this scope 14 | ans += (i == a[a[i]]); | ^
s738944660
p03993
C++
#include <iostream> using namespace std; int main() { int N; cin >> N; vector<int> A(N); for (int& x : A) cin >> x, --x; int ans = 0; for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { ans += (i == A[j] && j == A[i]); } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: 'vector' was not declared in this scope 8 | vector<int> A(N); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using namespace std; a.cc:8:10: error: expected primary-expression before 'int' 8 | vector<int> A(N); | ^~~ a.cc:9:17: error: 'A' was not declared in this scope 9 | for (int& x : A) cin >> x, --x; | ^ a.cc:14:20: error: 'A' was not declared in this scope 14 | ans += (i == A[j] && j == A[i]); | ^
s614709078
p03993
C++
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, ans = 0; cin >> n; vector<int> v(n); for(int &x : v) { cin >> x; x--; } for(int i = 0; i < (int) v.size(); i++) { ans += i == v[v[i]]; } cout << x / 2 << '\n'; return 0; }
a.cc: In function 'int main()': a.cc:18:11: error: 'x' was not declared in this scope 18 | cout << x / 2 << '\n'; | ^
s111465163
p03993
C++
use std::io; fn next_int() -> i64 { let mut buf = String::new(); io::stdin().read_line(&mut buf).unwrap(); buf.trim().parse().unwrap() } fn next_vec() -> Vec<i64> { let mut buf = String::new(); io::stdin().read_line(&mut buf).unwrap(); buf.split_whitespace().map(|n| n.parse().unwrap()).collect() } fn main() { let n = next_int(); let a = next_vec(); let mut cnt = 0; for i in 0..n { let idx = i as usize; let idx2 = a[idx] as usize; cnt += if a[idx2-1] == i + 1 {1} else {0}; } println!("{:?}", cnt/2); }
a.cc:21:14: error: too many decimal points in number 21 | for i in 0..n { | ^~~~ a.cc:1:1: error: 'use' does not name a type 1 | use std::io; | ^~~ a.cc:3:1: error: 'fn' does not name a type 3 | fn next_int() -> i64 { | ^~ a.cc:9:1: error: 'fn' does not name a type 9 | fn next_vec() -> Vec<i64> { | ^~ a.cc:15:1: error: 'fn' does not name a type 15 | fn main() { | ^~
s130365318
p03993
C++
namespace std; int main(){ int N,a[100001]; cin>>N; for(int i=1;i<N+1;i++){ cin>>a[i]; } int count,b; for(int i=1;i<N+1;i++){ b=a[i]; if(i==a[b]){count++;} } cout<<count/2; return 0; }
a.cc:1:15: error: expected '{' before ';' token 1 | namespace std; | ^ a.cc: In function 'int main()': a.cc:5:1: error: 'cin' was not declared in this scope 5 | cin>>N; | ^~~ a.cc:15:1: error: 'cout' was not declared in this scope; did you mean 'count'? 15 | cout<<count/2; | ^~~~ | count
s498669389
p03993
C
#include <stdio.h> int main(){ int N = 100000; scanf("%d\n", &N); int usagi[100000]; for (size_t i = 0; i < N; i++) { scanf("%d", &usagi[i]); } int count = 0; for (size_t i = 0; i < N; i++) { for (size_t j = i+1; j < N; j++) { if(usagi[i] == j+1 && usagi[j] == i+1){ count++; break; } } } printf("%d\n", count); return 0;
main.c: In function 'main': main.c:21:9: error: expected declaration or statement at end of input 21 | return 0; | ^~~~~~
s629149636
p03993
C++
#include<bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define INF 1000000000 int a[100001]; bool used[100001]; int main(){ int n; scanf("%d",&n); REP(i,n){ scant("%d",a+i); a[i]--; used[i] = false; } int c = 0; REP( i,n){ if(!used[i] && a[a[i]]==i){ c++; used[i] = used[a[i]] = true; } } printf("%d\n",c); return 0; }
a.cc: In function 'int main()': a.cc:22:9: error: 'scant' was not declared in this scope; did you mean 'scanf'? 22 | scant("%d",a+i); | ^~~~~ | scanf
s171441425
p03993
C++
#include<bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define INF 1000000000 int a[100001]; bool used[100001]; int main(){ scanf("%d",&n); REP(i,n){ scant("%d",a+i); a[i]--; used[i] = false; } int c = 0; REP( i,n){ if(!used[i] && a[a[i]]==i){ c++; used[i] = used[a[i]] = true; } } printf("%d\n",c); return 0; }
a.cc: In function 'int main()': a.cc:19:17: error: 'n' was not declared in this scope; did you mean 'yn'? 19 | scanf("%d",&n); | ^ | yn a.cc:21:9: error: 'scant' was not declared in this scope; did you mean 'scanf'? 21 | scant("%d",a+i); | ^~~~~ | scanf
s082210688
p03993
C++
#include<bits/stdc++.h> typedef long long ll; typedef unsigned long long ull; using namespace std; #define pb push_back int dy[]={0, 0, 1, -1, 0}; int dx[]={1, -1, 0, 0, 0}; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define INF 1000000000 int a[100001]; bool used[100001]; int main(){ scanf("%d",&n); REP(i,n){ scant("%d",a+i); a[i]--; used[i] = false; } int c = 0; REP( i,n){ if(!used[i] && a[a[i]]==i){ c++; used[i] = used[a[i]] = true; } } printf(”%d\n",c); return 0; }
a.cc:32:12: error: extended character ” is not valid in an identifier 32 | printf(”%d\n",c); | ^ a.cc:32:15: error: stray '\' in program 32 | printf(”%d\n",c); | ^ a.cc:32:17: warning: missing terminating " character 32 | printf(”%d\n",c); | ^ a.cc:32:17: error: missing terminating " character 32 | printf(”%d\n",c); | ^~~~~ a.cc: In function 'int main()': a.cc:19:17: error: 'n' was not declared in this scope; did you mean 'yn'? 19 | scanf("%d",&n); | ^ | yn a.cc:21:9: error: 'scant' was not declared in this scope; did you mean 'scanf'? 21 | scant("%d",a+i); | ^~~~~ | scanf a.cc:32:12: error: '\U0000201d' was not declared in this scope 32 | printf(”%d\n",c); | ^ a.cc:32:14: error: 'd' was not declared in this scope 32 | printf(”%d\n",c); | ^
s330941272
p03993
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second typedef pair<int,int>pii; const int maxn=1e5+55; int a; int main() { // freopen("Task.in","r",stdin);freopen("Task.out","w",stdout); int n; cin>>n; // map<int,set<int> >mpp; for(int i=1 ; i<=n ; i++) { cin>>a; mpp[i].insert(a); } int cnt=0; for(map<int,int>::iterator it=mpp.begin() ; it!=mpp.end() ; it++) { int u=it->ff; for(set<int>::iterator it2=it->ss.begin() ; it2!=it->ss.end() ; it2++) { int v=*it2; if(mpp[v].find(u)!=mpp.end()) { ++cnt; mpp[v].erase(u); break; } } mpp[u].erase(v); } /*for (int i=1 ; i<=n ; i++) { if(a[a[i]]==i) cnt++; }*/ cnt/=2; cout<<cnt<<endl; }
a.cc: In function 'int main()': a.cc:22:17: error: 'mpp' was not declared in this scope; did you mean 'mp'? 22 | mpp[i].insert(a); | ^~~ | mp a.cc:25:39: error: 'mpp' was not declared in this scope; did you mean 'mp'? 25 | for(map<int,int>::iterator it=mpp.begin() ; it!=mpp.end() ; it++) { | ^~~ | mp a.cc:27:51: error: request for member 'begin' in 'it.std::_Rb_tree_iterator<std::pair<const int, int> >::operator->()->std::pair<const int, int>::second', which is of non-class type 'int' 27 | for(set<int>::iterator it2=it->ss.begin() ; it2!=it->ss.end() ; it2++) { | ^~~~~ a.cc:27:73: error: request for member 'end' in 'it.std::_Rb_tree_iterator<std::pair<const int, int> >::operator->()->std::pair<const int, int>::second', which is of non-class type 'int' 27 | for(set<int>::iterator it2=it->ss.begin() ; it2!=it->ss.end() ; it2++) { | ^~~ a.cc:35:30: error: 'v' was not declared in this scope 35 | mpp[u].erase(v); | ^
s505682403
p03993
C++
#include<iostream> #include<fstream> #include<string> #include<cmath> using namespace std; int a[1e5]; int main(){ int N,j,num; num=0; cin >> N; for(int i=0;i<N;i++){ scanf("%d",&a[i]); } for(int i=0;i<N;i++){ j = a[i]; if(a[j-1]==i+1) num = num+1; } cout << num/2 << endl; return 0; };
a.cc:6:7: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 6 | int a[1e5]; | ^~~ a.cc:6:7: error: could not convert '1.0e+5' from 'double' to 'long unsigned int' 6 | int a[1e5]; | ^~~ | | | double a.cc:6:7: error: size of array 'a' has non-integral type 'double'
s442829400
p03993
C
File Edit Options Buffers Tools C Help #include <stdio.h> #include <stdlib.h> int main() { int N,i,j,cnt; int aij[100000]; char str[1000000]; scanf("%d", &N); gets(str); i=0;j=0; while(j<N-1){ sscanf(str,"%d ", &aij[j]); j++; } sscanf(str,"%d", &aij[j]); cnt=0; for(i=0;i<N;i++){ if(aij[aij[i]-1]==i+1) cnt++; }/* for(i=0;i<N;i++){ for(j=i+1; j<N ;j++){ if(aij[i] ==j && aij[j] == i)cnt++; } }*/ printf("%d\n", cnt/2); }
main.c:1:1: error: unknown type name 'File' 1 | File Edit Options Buffers Tools C Help | ^~~~ main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Options' 1 | File Edit Options Buffers Tools C Help | ^~~~~~~ main.c:1:11: error: unknown type name 'Options' 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>' In file included from main.c:3: /usr/include/stdlib.h:98:8: error: unknown type name 'size_t' 98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; | ^~~~~~ /usr/include/stdlib.h:42:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 41 | # include <bits/waitstatus.h> +++ |+#include <stddef.h> 42 | /usr/include/stdlib.h:531:25: error: unknown type name 'size_t' 531 | size_t __statelen) __THROW __nonnull ((2)); | ^~~~~~ /usr/include/stdlib.h:531:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:561:25: error: unknown type name 'size_t' 561 | size_t __statelen, | ^~~~~~ /usr/include/stdlib.h:561:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:661:42: error: unknown type name 'size_t' 661 | extern void arc4random_buf (void *__buf, size_t __size) | ^~~~~~ /usr/include/stdlib.h:661:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:672:22: error: unknown type name 'size_t' 672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ | ^~~~~~ /usr/include/stdlib.h:672:22: note: 'size_t' is defined in heade
s084416218
p03993
C++
#include <bits/stdc++.h> int main() { vector<int> pairs; int n; int value; cin>>n; for(int i=1;i<=n;i++) { cin>>value; pairs[i] = value; } int count =0; for(int i=1;i<=n;i++) { if(pairs[pairs[i]]==i) { count++; } cout<<count/2; } return 0; }
a.cc: In function 'int main()': a.cc:5:1: error: 'vector' was not declared in this scope 5 | vector<int> pairs; | ^~~~~~ a.cc:5:1: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:5:8: error: expected primary-expression before 'int' 5 | vector<int> pairs; | ^~~ a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin>>n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:12:1: error: 'pairs' was not declared in this scope 12 | pairs[i] = value; | ^~~~~ a.cc:17:4: error: 'pairs' was not declared in this scope 17 | if(pairs[pairs[i]]==i) | ^~~~~ a.cc:22:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 22 | cout<<count/2; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s340692051
p03993
C++
#include<iostream> #define rep(i,a,b) for(int i=a;i<b;i++) using namespace std; int main() { int N; int a[100000]; int sum = 0; cin >> N >> a; rep(i, 0, N) { if (i + 1 == a[i]) sum++; } cout << sum / 2 << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int [100000]') 10 | cin >> N >> a; | ~~~~~~~~ ^~ ~ | | | | | int [100000] | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 10 | cin >> N >> a; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(short int)((int*)(& a))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(short unsigned int)((int*)(& a))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(int)((int*)(& a))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(unsigned int)((int*)(& a))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(long int)((int*)(& a))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(long unsigned int)((int*)(& a))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(long long int)((int*)(& a))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 10 | cin >> N >> a; | ^ | | | int* a.cc:10:21: error: cannot bind rvalue '(long long unsigned int)((int*)(& a))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:10:21: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 10 | cin >> N >> a; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [100000]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [100000]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [100000]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [100000]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [100000]' to 'std::ba
s898325900
p03993
C
# include <stdio.h> //# include <iostream> //# include <cstdio> //# include <conio.h> //using namespace std; const int N = 100100; int n, a [N], i, j, k; int main () { scanf ("%d", &n); for ( i=1; i <= n; i++ ) scanf ("%d", &a [i]); for ( i=1; i <= n; i++ ) { j = a [i]; if ( a [j] == i ) k++; } printf ("%d", k/2); //getch(); return 0; }
main.c:10:8: error: variably modified 'a' at file scope 10 | int n, a [N], i, j, k; | ^
s210984925
p03993
C
#include <iostream> using namespace std; int main(){ int n; scanf("%d", &n); int *x = new int[n]; for (int i = 0; i < n; i++){ scanf("%d", &x[i]); } int count = 0; for (int i = 0; i < n-1; i++){ for (int j = i + 1; j < n; j++){ if (x[i] == j + 1 && x[j] == i+1){ count++; if (count == n / 2) break; break; } } } printf("%d", count); free(x); return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s280619676
p03993
C
#include <stdio.h> int main(){ int n; scanf("%d", &n); int *x = new int[n]; for (int i = 0; i < n; i++){ scanf("%d", &x[i]); } int count = 0; for (int i = 0; i < n-1; i++){ for (int j = i + 1; j < n; j++){ if (x[i] == j + 1 && x[j] == i+1){ count++; if (count == n / 2) break; break; } } } printf("%d", count); free(x); return 0; }
main.c: In function 'main': main.c:5:18: error: 'new' undeclared (first use in this function) 5 | int *x = new int[n]; | ^~~ main.c:5:18: note: each undeclared identifier is reported only once for each function it appears in main.c:5:22: error: expected ',' or ';' before 'int' 5 | int *x = new int[n]; | ^~~ main.c:21:9: error: implicit declaration of function 'free' [-Wimplicit-function-declaration] 21 | free(x); | ^~~~ main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'free' 1 | #include <stdio.h> +++ |+#include <stdlib.h> 2 | int main(){ main.c:21:9: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch] 21 | free(x); | ^~~~ main.c:21:9: note: include '<stdlib.h>' or provide a declaration of 'free'
s646131779
p03993
C++
#include <iostream> #include <sstream> #include <vector> template<typename type> std::vector<type> input_value(std::istream& ist, int n = 0) { type buffer; std::vector<type> ret; if (n > 0) ret.reserve(n); while (ist >> buffer) { ret.push_back(buffer); } return ret; } int main() { int n, count{ 0 }; std::string str; std::cin >> n; std::cin >> str; std::vector<int> rabbits{ input_value<int>(std::istringstream(str), n) }; for (auto i{ 0 }; i < rabbits.size(); ++i) { if (i == rabbits.at(rabbits.at(i))) ++count; } std::cout << count << std::endl; }
a.cc: In function 'int main()': a.cc:29:57: error: cannot bind non-const lvalue reference of type 'std::istream&' {aka 'std::basic_istream<char>&'} to an rvalue of type 'std::basic_istream<char>' 29 | std::vector<int> rabbits{ input_value<int>(std::istringstream(str), n) }; | ^~~~~~~~~~~~~~~~~~ a.cc:6:45: note: initializing argument 1 of 'std::vector<type> input_value(std::istream&, int) [with type = int; std::istream = std::basic_istream<char>]' 6 | std::vector<type> input_value(std::istream& ist, int n = 0) | ~~~~~~~~~~~~~~^~~ a.cc:29:80: error: no matching function for call to 'std::vector<int>::vector(<brace-enclosed initializer list>)' 29 | std::vector<int> rabbits{ input_value<int>(std::istringstream(str), n) }; | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = int; _Alloc = std::allocator<int>]' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; allocator_type = std::allocator<int>]' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:7: note: conversion of argument 1 would be ill-formed: /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>; std::__type_identity_t<_Alloc> = std::allocator<int>]' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = int; _Alloc = std::allocator<int>; allocator_type = std::allocator<int>; std::false_type = std::false_type]' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = int; _Alloc = std::allocator<int>; allocator_type = std::allocator<int>; std::true_type = std::true_type]' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>; std::__type_identity_t<_Alloc> = std::allocator<int>]' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: conversion of argument 1 would be ill-formed: /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: conversion of argument 1 would be ill-formed: /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int; value_type = int; allocator_type = std::allocator<int>]' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int; allocator_type = std::allocator<int>]' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: conversion of argument 1 would be ill-formed: /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; allocator_type = std::allocator<int>]' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: conversion of argument 1 would be ill-formed: /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = int; _Alloc = std::allocator<int>]' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 1 provided
s330005352
p03993
C++
# cook your code here a = int(raw_input()) ss = raw_input().split() lst = [] c = 0 i = 0 for s in ss: if s not in lst: if int(ss[int(ss[i])-1]) == i+1: c=c+1 lst.append(s) lst.append(ss[int(ss[i])-1]) i=i+1 print c
a.cc:1:3: error: invalid preprocessing directive #cook 1 | # cook your code here | ^~~~ a.cc:2:1: error: 'a' does not name a type 2 | a = int(raw_input()) | ^
s958736742
p03993
C++
# cook your code here a = int(raw_input()) ss = raw_input().split() lst = [] c = 0 i = 0 for s in ss: if s not in lst: if int(ss[int(ss[i])-1]) == i+1: c=c+1 lst.append(s) lst.append(ss[int(ss[i])-1]) i=i+1 print c
a.cc:1:3: error: invalid preprocessing directive #cook 1 | # cook your code here | ^~~~ a.cc:2:1: error: 'a' does not name a type 2 | a = int(raw_input()) | ^
s599198099
p03993
C++
#include <iostream> #include <string> using namespace std; int main(){ int number; cin >> number; string likes; cin >> likes; int pairs = 0; for(int i = 0; i < number; i++){ int r1 = i+1; int r1_likes = atoi(likes[i*2]); int r2_likes = atoi(likes[r1_likes*2]); if(r1 == r2_likes) pairs++; } cout << pairs << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:28: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive] 17 | int r1_likes = atoi(likes[i*2]); | ~~~~^~~~~~~~~~~~ | | | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char} In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, 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/stdlib.h:105:30: note: initializing argument 1 of 'int atoi(const char*)' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~ a.cc:18:28: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive] 18 | int r2_likes = atoi(likes[r1_likes*2]); | ~~~~^~~~~~~~~~~~~~~~~~~ | | | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char} /usr/include/stdlib.h:105:30: note: initializing argument 1 of 'int atoi(const char*)' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~