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...
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++...
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, ...
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 ...
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.prin...
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: inc...
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: ...
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]; | ...
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(...
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++) #defi...
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) + " " + l...
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);...
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 ma...
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...
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_...
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 ma...
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/...
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::ci...
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 ...
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 ...
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; } }...
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 ...
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; //両想いうさぎ fo...
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; //両想いうさぎ fo...
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; //両想いうさぎ fo...
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++){ ...
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-...
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.pri...
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...
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(in...
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 | ...
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 | ...
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_...
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 ...
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...
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...
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++; ...
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++; ...
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...
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++; ...
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...
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/iostrea...
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 <...
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/iostrea...
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/iostrea...
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/iostrea...
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)<...
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]] && ...
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.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<un...
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); | ^ | ...
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<un...
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; | ~ ...
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<un...
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 names...
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 #de...
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); ...
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 ...
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.c...
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....
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;...
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...
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[2000...
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 ...
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...
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 | ...
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; | ...
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; } } } ...
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 R...
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 R...
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); | ^~~~...
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 R...
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); | ...
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> >m...
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>::itera...
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 a...
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++;...
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 i...
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_...
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 [1000...
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]...
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;...
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; } } ...
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 |...
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 }; st...
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) }; | ...
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]); ...
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]); | ~~~~^~~~~~~~~~~~ | ...