submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s945357734
p03952
C++
#include <bits/stdc++.h> using namespace std; //repetition #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define rep(i, n) for(int i = 0; i < (int)(n); i++) //container util #define all(x) (x).begin(),(x).end() //typedef typedef long long ll; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<ll> VLL; type...
a.cc: In function 'int main()': a.cc:35:3: error: 'else' without a previous 'if' 35 | else if(n == 2){ | ^~~~
s069069410
p03952
C++
#include<bits/stdc++.h> using namespace std; #define MAX 1000000007 int main(){ int N,x,k,count=0; cin>>N>>x; if(x!=N/2 or x!=N/2+1 or x!=N/2-1){ cout<<"No"<<endl; }else{ cout<<"Yes"<<endl; for(int i=1;count<N/2-2;i++){ if(i<x-2 or i>x+2){ count++ ...
a.cc: In function 'int main()': a.cc:14:20: error: expected ';' before 'cout' 14 | count++ | ^ | ; 15 | cout<<i<<endl; | ~~~~
s683580317
p03952
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <limits.h> #include <queue> using namespace std; typedef long long ll; typedef unsigned long long ull; #define REP(i, n) for(int i=0; i<n; i++) const int INF = INT_MAX; int ans[300000]; bool used[300000]; int main(){ int N, X;...
a.cc: In function 'int main()': a.cc:26:5: error: 'else' without a previous 'if' 26 | else if(N == 2){ | ^~~~
s284439094
p03952
C++
#include<algorithm> #include<iostream> using namespace std; int main(){ int N,x; cin>>N>>x; if(x!=N){ cout<<"No"<<endl; } else{ cout<<"Yes"<<endl; REP(i,1,2*N+2){ cout<<i<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:13:9: error: 'i' was not declared in this scope 13 | REP(i,1,2*N+2){ | ^ a.cc:13:5: error: 'REP' was not declared in this scope 13 | REP(i,1,2*N+2){ | ^~~
s557430181
p03952
C++
use std::io::*; use std::str::FromStr; fn main(){ println!("{}", if read::<usize>() == read::<usize>() {"Yes"} else {"No"}); } fn read<T: FromStr>() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to re...
a.cc:1:1: error: 'use' does not name a type 1 | use std::io::*; | ^~~ a.cc:2:1: error: 'use' does not name a type 2 | use std::str::FromStr; | ^~~ a.cc:4:1: error: 'fn' does not name a type 4 | fn main(){ | ^~ a.cc:10:1: error: 'fn' does not name a type 10 | fn read<T: FromStr>() -> T {...
s009901520
p03952
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.*; public class AGC006B{ public static void main(String[] args) throws IOException { MyScanner sc = new MyScanner(System.in); int n=sc.nextInt(); int x = sc.nextInt(); if(...
Main.java:7: error: class AGC006B is public, should be declared in a file named AGC006B.java public class AGC006B{ ^ 1 error
s219318961
p03952
C++
#include <bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; signed main(){ int n,x; cin>>n>>x; if(n==2&&(x==3||x==1)){ cout<<"No"<<endl; return 0; } int a[n*2]; for(int i=(2*n)/2,j=0;j<2*n-1;j++i=(i+1)%(2*n-1)){ a[i]=x++; } cout<<"Yes"<<endl; r(i,2*n-1)cout<<a[i]<<endl; }
a.cc: In function 'int main()': a.cc:12:42: error: expected ')' before 'i' 12 | for(int i=(2*n)/2,j=0;j<2*n-1;j++i=(i+1)%(2*n-1)){ | ~ ^ | ) a.cc:12:57: error: expected ';' before ')' token 12 | for(int i=(...
s369978874
p03952
C++
// ------------------------------------ // Date:2018/ 3/29 // Problem:_ _ _ c.cpp // // ------------------------------------ #include <bits/stdc++.h> using namespace std; #define EACH(i,a) for (auto& i : a) #define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i) #define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i) #defin...
a.cc:65:18: error: extended character   is not valid in an identifier 65 |  d.push_back(i); | ^ a.cc:66:9: error: extended character   is not valid in an identifier 66 |    } | ^ a.cc:66:12: error: extended character   is not valid in an identifier ...
s150947785
p03952
C++
#include <iostream> #include <iomanip> #include <vector> #include <queue> #include <map> #include <string> #include <math.h> #include <algorithm> using namespace std; typedef long long ll; typedef pair<ll, ll> P; int main() { ll n, x; cin >> n >> x; if (x == 1 || x == 2 * n - 1)cout << "No" << endl; else { cout <...
a.cc: In function 'int main()': a.cc:32:56: error: 'ans' was not declared in this scope; did you mean 'abs'? 32 | for (int i = 0; i < 2 * n; i++)cout << ans[i] << endl; | ^~~ | ab...
s359384841
p03952
C++
#include<bits/stdc++.h> #define vi vector<int> #define vvi vector<vector<int> > #define vl vector<ll> #define vvl vector<vector<ll>> #define vb vector<bool> #define vc vector<char> #define vs vector<string> using ll = long long; using ld =long double; #define int ll #define INF 1e9 #define EPS 0.0000000001 #define rep(...
a.cc:64:33: error: redefinition of 'template<class T, class S> void cmin(T&, const S&)' 64 | template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; } | ^~~~ a.cc:17:33: note: 'template<class T, class S> void cmin(T&, const S&)' previously declared here 17 |...
s217365923
p03952
C++
int n, x; int main() { cin >> n >> x; if (n == 2) { if (x == 2) { cout << "Yes" << endl; rep(i, 3) { cout << i + 1 << endl; } } else cout << "No" << endl; } else { if (x == 2 * n - 1 || x == 1)cout << "No" << endl; else { cout << "Yes" << endl; vector<int> vi; rep(i, 2 * n - 1) { ...
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> n >> x; | ^~~ a.cc:7:25: error: 'cout' was not declared in this scope 7 | cout << "Yes" << endl; | ^~~~ a.cc:7:42: error: 'endl' was not de...
s676413436
p03952
C++
import sys N, x = map(int, sys.stdin.readline().split()) if N == x: print('Yes') print(' '.join(map(lambda x: str(x+1), range(N*2-1)))) else: print('No')
a.cc:4:9: warning: multi-character character constant [-Wmultichar] 4 | print('Yes') | ^~~~~ a.cc:7:9: warning: multi-character character constant [-Wmultichar] 7 | print('No') | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note:...
s140735143
p03952
C++
#include <iostream> #include <vector> #include <map> #include <string> #include <cstdlib> #include <algorithm> #include <numeric> #define NMAX 100000 #define MMAX 10000 using namespace std; int N,x,judge = 0,dp[NMAX][NMAX*2] = {}; vector<int > med; int main(){ ios::sync_with_stdio(false); cin >> N >> x; vector<in...
/tmp/cc0l5s6l.o: in function `main': a.cc:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against symbol `med' defined in .bss section in /tmp/cc0l5s6l.o a.cc:(.text+0x185): relocation truncated to fit: R_X86_64_PC32 against symbol `med' defined in .bss section in /tmp/cc0l5s6l.o a.cc:(.text+0x1c5): relocatio...
s295450958
p03952
C++
#include<bits/stdc++.h> using namespace std; int main() { string s,t; int n,N,len=1; cin >> N >> n; if(n==1||n==(N*2-1)){ cout <<"No" << endl; }else if(N>2){ cout << "Yes" << endl; for(int i=0;i<(N*2-1);i++){ if(i==(N-2))cout << (n+1) << endl; else if(i==(N-1))cou...
a.cc: In function 'int main()': a.cc:25:6: error: expected '}' before 'else' 25 | }else if(N==2){ | ^~~~ a.cc:10:18: note: to match this '{' 10 | }else if(N>2){ | ^ a.cc: At global scope: a.cc:31:5: error: expected unqualified-id before 'return' 31 | return 0; ...
s917164050
p03952
C++
#include <iostream> #include<cstdio> const int N = 200000 + 10; int n, x; int ans[N]; int main() { scanf_s("%d%d", &n, &x); if (x == 1 || x == 2 * n - 1) return puts("No"), 0; puts("Yes"); ans[n] = x; static bool flag[N]; flag[x] = true; ans[n - 1] = 2 * n - 1; ans[n + 1] = 1; ans[n + 2] = x + 1; flag[1...
a.cc: In function 'int main()': a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 9 | scanf_s("%d%d", &n, &x); | ^~~~~~~ | scanf
s112440203
p03952
Java
import java.util.*; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int x = sc.nextInt(); if (x == 1 || x == 2 * N - 1) { out.println("No"); ...
Main.java:5: error: cannot find symbol PrintWriter out = new PrintWriter(System.out); ^ symbol: class PrintWriter location: class Main Main.java:5: error: cannot find symbol PrintWriter out = new PrintWriter(System.out); ^ symbol: class PrintWriter locat...
s115564878
p03952
Java
//----------------------------------------------------------- // すぐ使える //----------------------------------------------------------- import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new Buffere...
Main.java:24: error: unexpected type if( (N-1)=x ){ ^ required: variable found: value Main.java:31: error: unexpected type if( (N+1)=x ){ ^ required: variable found: value 2 errors
s895783660
p03952
Java
import java.util.Scanner; public class Main { public static void main(String args[] ) throws Exception { new Main().exec(args); } public Main() { } public void exec(String args[]) throws Exception { Scanner sc = new Scanner(System.in); int N=sc.nextInt(); int x=sc.nextInt(); ...
Main.java:71: error: reached end of file while parsing } ^ 1 error
s383887558
p03952
C++
#include <algorithm>//min/max/sort(rand-access it)/merge #include <array> #include <bitset> // #include <chrono>//std::chrono::/system_clock/steady_clock/high_resolution_clock/duration #include <climits>//INT_MAX/INT_MIN/ULLONG_MAX #include <cmath>//fmin/fmax/fabs/sin(h)/cos(h)/tan(h)/exp/log/pow/sqrt/cbrt/ceil/floor/r...
a.cc: In function 'int main()': a.cc:59:18: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int') 59 | cout << x==2 ? "Yes\n1\n2\n3" : "No" << endl; | ~~~~~~~~~^~~ | | | | ...
s929145336
p03952
Java
/* Filename: AGC006B.java * Author: Mushiyo */ import java.util.Scanner; import java.util.Arrays; public class AGC006B { public static void main(String[] args) { Scanner input = new Scanner(System.in); while (input.hasNext()) { int N = input.nextInt(); int x = input.nextInt(); int rowNLen = 2 * N - ...
Main.java:8: error: class AGC006B is public, should be declared in a file named AGC006B.java public class AGC006B { ^ 1 error
s874165558
p03952
C++
#include <iostream> #include <vector> int main(void){ int n, x; std::cin >> n >> x; std::vector<int> v; for(int i=1; i<=2*n-1; i++){ v.push_back(i); } if(x<2 || 2*n-2<x){ std::cout << "No" << std::endl; }else{ std::cout << "Yes" << std::endl; int slide = n-x; for(int i=0; i<2*n-1; ...
a.cc:25:2: error: stray '#' in program 25 | }#include <iostream> | ^ a.cc:25:3: error: 'include' does not name a type 25 | }#include <iostream> | ^~~~~~~
s095042742
p03952
Java
import java.util.Scanner; public class MedianPyramidEasy { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int x = sc.nextInt(); if(x == n){ System.out.println("Yes"); for(int i = 1;i < 2*n;i++){ System.out.println(i); } }else{ System.out....
Main.java:3: error: class MedianPyramidEasy is public, should be declared in a file named MedianPyramidEasy.java public class MedianPyramidEasy { ^ 1 error
s742954624
p03952
C++
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) for(int i=0;i<(n);i++) #define RREP(i,n) for(int i=(n)-1;i>=0;i--) using namespace std; int main() { int N, x; scanf("%d%d", &N, &x); if (N == 2) { if (x == 2) { printf("Yes\n"); printf("1\...
a.cc: In function 'int main()': a.cc:29:16: error: expected primary-expression before '<' token 29 | if (x =< N) { | ^ a.cc:38:24: error: expected ';' before '}' token 38 | i++ | ^ | ; 39 | ...
s147468457
p03952
C++
// #ifndef GLOBAL_JUDGE // freopen("txt.in","r",stdin); // freopen("txt.out","w",stdout); // #endif // GLOBAL_JUDGE
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s286063888
p03952
C++
#include <iostream> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, x; cin >> N >> x; if(x==1 || x==2*N-1){ cout << "No" << endl; return 0; } if(x==2){ int cur = 3; for(int i=1; i<N-2; i++){ if(cur==x) cur++; ...
a.cc: In function 'int main()': a.cc:33:10: error: expected '}' at end of input 33 | } | ^ a.cc:18:13: note: to match this '{' 18 | if(x==2){ | ^ a.cc:33:10: error: expected '}' at end of input 33 | } | ^ a.cc:4:11: note: to match this '{' ...
s858768642
p03952
C++
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int N; int x; int n; std::cin >> N; std::cin >> x; if(x < 2 || x > 2N) { std::cout << "No" << std::endl; return 0; } else { std::cout << "Yes" << std::endl; } n = 2*N-1; for(int i = 1; i <= n; i++) {...
a.cc: In function 'int main()': a.cc:15:25: error: unable to find numeric literal operator 'operator""N' 15 | if(x < 2 || x > 2N) | ^~
s811605751
p03952
C++
#include "bits/stdc++.h" using namespace std; int main(){ long long n,x; cin >> n >> x; if(n == 1){ cout << "Yes\n"; cout << 1 << endl; } else if(n == 2){ if(x == 2){ cout << "Yes\n"; cout << 1 << endl << 2 << endl << 3 << endl; } else{ cout << "No\n"; } } else{ if(x =...
a.cc: In function 'int main()': a.cc:48:58: error: 't' was not declared in this scope 48 | arr[i] = count++;t | ^
s292735574
p03952
C
#include<stdio.h> #include<stdlib.h> int mai() { int N; int x; int loop; scanf("%d %d", &N, &x); exit(0); if (N == x) { printf("Yes\n"); for (loop = 0; loop < 2*N - 1; loop++)printf("%d\n", loop); } else printf("No\n"); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s599254649
p03952
C
#include<stdio.h> int mai() { int N; int x; int loop; scanf("%d %d", &N, &x); if (N == x) { printf("Yes\n"); for (loop = 0; loop < 2N - 1; loop++)printf("%d\n", loop); } else printf("No\n"); return 0; }
main.c: In function 'mai': main.c:11:39: error: invalid suffix "N" on integer constant 11 | for (loop = 0; loop < 2N - 1; loop++)printf("%d\n", loop); | ^~
s346555442
p03952
C++
print('No')
a.cc:1:7: warning: multi-character character constant [-Wmultichar] 1 | print('No') | ^~~~ a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token 1 | print('No') | ^
s445779766
p03952
Java
import java.io.*; import java.util.*; public class R6qB { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); int n = in.nextInt(); int x = in.nextInt(); if (n != x) { if (x <= 1 ||...
Main.java:4: error: class R6qB is public, should be declared in a file named R6qB.java public class R6qB { ^ 1 error
s727500943
p03952
C++
#include <cassert> #include <cstring> #include <iostream> #include <set> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define TRACE(x) cout << #x << " = " << x << endl #define _ << " _ " << typedef long long llint; int main(void) { int N, x; scanf("%d...
a.cc: In function 'int main()': a.cc:25:3: error: 'vector' was not declared in this scope 25 | vector<int> a; | ^~~~~~ a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 5 | #include <set> +++ |+#include <vector> 6 | a.cc:25:10: ...
s001268151
p03953
C
#include<bits/stdc++.h> #define int long long using namespace std; const int maxn=1e5+10; int c[maxn],a[maxn],to[maxn],ans[maxn],tmp[maxn],p[maxn],pos[maxn],K,now; int n,m; void solve(int y) { for(;y;y>>=1) { if (y&1) { for (int i=1;i<=n;++i)p[i]=ans[to[i]]; for (int i=1;i<=n;++i)ans[i]=p[i]; } for (int...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s393205231
p03953
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<algorithm> using namespace std; const int maxn=100000+10; int n,m,a[MAXN],ans[MAXN],res[MAXN],tmp[MAXN]; long long k; int main(){ scanf("%d",&n); for(int i=1;i<=n;++i)scanf("%d",a+i); for(int i=1;i<n;++i)ans[i]=...
a.cc:9:11: error: 'MAXN' was not declared in this scope 9 | int n,m,a[MAXN],ans[MAXN],res[MAXN],tmp[MAXN]; | ^~~~ a.cc:9:21: error: 'MAXN' was not declared in this scope 9 | int n,m,a[MAXN],ans[MAXN],res[MAXN],tmp[MAXN]; | ^~~~ a.cc:9:31: error: 'MAXN' was not declared ...
s117283052
p03953
C++
#include<bits/stdc++.h> using namespace std; using Lint=long long; vector<int> mul(vector<int>& a,vector<int>& b) { const int N=a.size(); vector<int> res(N); for(int i=0;i<N;i++) res[i]=b[a[i]]; return res; } vector<int> pow(vector<int>& p,Lint K) { const int N=p.size(); vector<int> res(N); for(...
a.cc: In function 'int main()': a.cc:43:4: error: 'res' was not declared in this scope 43 | res=pow(p,K); | ^~~
s199308360
p03953
C++
#include <cstdio> #include <cmath> #include <algorithm> #include <queue> using namespace std; #define ll long long const int maxn=1e5+10; const int mod=1e9+7; namespace gengyf{ inline ll read(){ int f=1,x=0;char s=getchar(); while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();} while(s>='0'&&s<='9'){x=x*10+s-'0';s=getcha...
a.cc: In function 'int gengyf::main()': a.cc:21:17: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 21 | scnaf("%lld",a+i); | ^~~~~ | scanf
s185025758
p03953
C++
// luogu-judger-enable-o2
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s349056139
p03953
C++
#include<bits/stdc++.h> namespace my_std{ using namespace std; #define reg register #define Rint register int #define FOR(i,a,b) for(register int i=(a);i<=(b);++i) #define ROF(i,a,b) for(register int i=(a);i>=(b);--i) #define FORit(templ,arr,i,a,b) for(register templ *i=(arr)+(a);i!=(arr)+(b)+1;++i) #define ROFi...
a.cc: In function 'int main()': a.cc:38:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 38 | FOR(i,1,n) x[i] = read() , pos[i] = i; | ^ a.cc:6:45: note: in definition of macro 'FOR' 6 | #define FOR(i,a,b) for(register int i=(a);i<=(b);++i) ...
s782942765
p03953
C++
​ #include<bits/stdc++.h> using namespace std; long long n,x[111111],p[111111],y[111111],siz[111111],cir[111111],m,k,sum; bool vis[111111]; int main(){ scanf("%lld",&n); for(int i=1;i<=n;i++)scanf("%lld",&x[i]),p[i]=i,y[i]=x[i]-x[i-1]; scanf("%lld%lld",&m,&k); for(int i=1,a;i<=m;i++)scanf("%lld",&a),swap(p[a],p[a+1...
a.cc:1:1: error: '\U0000200b' does not name a type 1 | ​ | 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:2: /usr/include/c++/14/...
s184629641
p03953
C++
#include<bits/stdc++.h> using namespace std; typedef long long LL; typedef double db; #define go(u) for(int i = head[u], v = e[i].to; i; i=e[i].lst, v=e[i].to) #define rep(i, a, b) for(int i = a; i <= b; ++i) #define pb push_back #define re(x) memset(x, 0, sizeof x) inline int gi() { int x = 0,f = 1; char ch = ...
a.cc: In function 'int main()': a.cc:27:35: error: reference to 'replace' is ambiguous 27 | rep(i, 1, n) x[i] = gi(), replace[i] = i; | ^~~~~~~ In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc+...
s118058570
p03953
C++
/** SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAj...
a.cc:61:13: error: '__int64' does not name a type; did you mean '__int64_t'? 61 | #define int __int64 | ^~~~~~~ a.cc:63:1: note: in expansion of macro 'int' 63 | int a[MAXN]; | ^~~ a.cc:61:13: error: '__int64' does not name a type; did you mean '__int64_t'? 61 | #define int __int64 ...
s147468963
p03953
C++
#include <iostream> #include <fstream> using namespace std; const int nmax=100005; int x[nmax],p[nmax],dif[nmax],viz[nmax],cyc[nmax],newp[nmax]; long long k; int n,i,j,xx,m,nr; int main() { //freopen("data.in","r",stdin); ios_base::sycn_with_stdio(false); cin>>n; for(i=1;i<=n;i++) { cin>>x[i...
a.cc: In function 'int main()': a.cc:11:15: error: 'sycn_with_stdio' is not a member of 'std::ios_base' 11 | ios_base::sycn_with_stdio(false); | ^~~~~~~~~~~~~~~
s809832917
p03953
C++
# include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn(1e5 + 5); int n, m, b[maxn], que[maxn], len, vis[maxn]; ll k, f[maxn], g[maxn]; int main() { int i, j; scanf("%d", &n); for (i = 1; i <= n; ++i) scanf("%lld", &f[i]), b[i] = i; for (i = n; i; --i) f[i] -= f[i - 1];...
a.cc: In function 'int main()': a.cc:21:52: error: 'nxt' was not declared in this scope 21 | for (j = 1; j <= len; ++j) nxt[que[j]] = que[(k + j - 1) % len + 1]; | ^~~ a.cc:23:43: error: 'nxt' was not declared in this scope 23 | ...
s704182948
p03953
C++
#include <stdio.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string...
a.cc:35:13: error: 'std::vector<int>' is not a template 35 | #define vec vector<int> | ^~~~~~~~~~~ a.cc:56:1: note: in expansion of macro 'vec' 56 | vec<vec> mv(N,v); | ^~~ a.cc:56:16: error: no matching function for call to 'std::vector<int>::vector(int, std::vector<int>&)' 56 | vec<ve...
s541089439
p03953
C++
} for (int i=1;i<n;i++) { if (vis[i]) continue; int x=i,cnt=0,y; while(!vis[x]) cnt++,vis[x]=1,x=a[x]; y=x=i; for (int j=1;j<=(int)(k%cnt);j++) y=a[y]; while(!ans[x]) ans[x]=v[y+1]-v[y],x=a[x],y=a[y]; } ll now=v[1]; for (int i=1;i<=n;i++) printf("%lld.0\n",now),now+=ans[i]; ...
a.cc:1:9: error: expected declaration before '}' token 1 | } | ^ a.cc:2:5: error: expected unqualified-id before 'for' 2 | for (int i=1;i<n;i++) | ^~~ a.cc:2:18: error: 'i' does not name a type 2 | for (int i=1;i<n;i++) | ^ a.cc:2:22: error: 'i'...
s214770989
p03953
C++
#include<bits/stdc++.h> using namespace std; #define int long long typedef long long ll; typedef double db; const int N=1e5+10; int n,m,tot,st,d[N],id[N],nt[N],K,ans[N],q[N],cnt,vs[N],p[N]; signed main(){ scanf("%lld",&n); for (int i=1;i<=n;i++)scanf("%d",&p[i]); for (int i=2;i<=n;i++)d[i]=p[i]-p[i-1],id[i]=i; scan...
a.cc: In function 'int main()': a.cc:14:31: error: 'x' was not declared in this scope 14 | scanf("%lld",&x); | ^ a.cc:21:36: error: 'j' was not declared in this scope 21 | for (cnt=0,j=i;!vs[j];j=nt[j]){ | ...
s606183067
p03953
C++
#include <cstdio> #include <algorithm> using namespace std; #define int long long const int maxn=1e5+5; ll k; int n,m; int c[maxn]; bool bo[maxn]; int a[maxn],ans[maxn]; int read() { int x=0,f=1;char ch=getchar(); for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')f=-1; for(;ch>='0'&&ch<='9';ch=getchar())x=x*10+ch-'0'; ...
a.cc:8:1: error: 'll' does not name a type 8 | ll k; | ^~ cc1plus: error: '::main' must return 'int' a.cc: In function 'int main()': a.cc:25:32: error: 'k' was not declared in this scope 25 | m=read();scanf("%lld",&k); | ^
s592849419
p03953
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int MAXN = 100005; int a[MAXN],d[MAXN],n,m,p[MAXN],ret[MAXN],t[MAXN]; typedef long long ll; ll k; inline void ksm(ll k) { for(int i=1;i<=n;++i)ret[i]=i; while(k){ if(k&1){ for(int i=1;i<=n;++i)ret[i]=p[ret[i]]; } for(int i=1;...
a.cc: In function 'int main()': a.cc:36:30: error: 'sum' was not declared in this scope 36 | printf("%d ",sum+=d[ans[i]]); | ^~~
s309850117
p03953
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int MAXN = 100005; int a[MAXN],d[MAXN],n,m,p[MAXN],ret[MAXN],t[MAXN]; typedef long long ll; ll k; inline void ksm(ll k) { for(int i=1;i<=n;++i)ret[i]=i; while(k){ if(k&1){ for(int i=1;i<=n;++i)ret[i]=p[ret[i]]; } for(int i=1;...
a.cc: In function 'void ksm(ll)': a.cc:21:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 21 | int main() | ^~ a.cc:21:9: note: remove parentheses to default-initialize a variable 21 | int main() | ^~ | -- a.cc:21:9: note: or re...
s932472145
p03953
C++
inline
a.cc:1:7: error: expected unqualified-id at end of input 1 | inline | ^
s891613175
p03953
C++
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=100005; int n,m,x[N],a[N]; int b[N],vis[N],tmp[N],t; int ans[N]; LL K; int main(){ scanf("%d",&n); for (int i=1;i<=n;i++) scanf("%d",&x[i]); scanf("%d%lld",&m,&K); for (int i=1;i<n;i++) b[i]=i; for (int i=1;i<=m;i++){ scanf("%d",...
a.cc: In function 'int main()': a.cc:34:23: error: 'i' was not declared in this scope; did you mean 'il'? 34 | for (int il=1;i<n;i++) | ^ | il
s116998634
p03953
C++
#include <cstdio> #include <algorithm> #include <vector> #define int long long using namespace std; const int N=100005; int n,m; int x[N],a[N],poi[N],cf[N],cnt; long long k; int block[N],num[N],vis[N]; vector<int>q[N]; void dfs(int x,int dep) { num[x]=dep;vis[x]=1;block[x]=cnt; q[cnt].push_back(x); if(!...
a.cc: In function 'int main()': a.cc:30:30: error: 'vicf' was not declared in this scope 30 | for(int i=1;i<n;++i) if(!vicf[i]) cnt++,dfs(i,0); | ^~~~
s676196354
p03953
C++
def process(x, a, k): n = len(x) f = range(0, n) for i in a: f[i], f[i+1] = f[i+1], f[i] #print 'f=%s' % str(f) b = 1 while b<=k: if (k&b)!=0: t = [0 for i in xrange(n)] for i in xrange(n): t[i] = x[f[i]] x = [i for i in t] ...
a.cc:6:6: error: invalid preprocessing directive #print 6 | #print 'f=%s' % str(f) | ^~~~~ a.cc:14:14: error: invalid preprocessing directive #print 14 | #print 'x=%s' % str(x) | ^~~~~ a.cc:19:10: error: invalid preprocessing directive #print 19 | #print '...
s832490578
p03953
C++
#include<bits/stdc++.h> using namespace std; #define LL long long int n,m,f[maxn],fk[maxn],dep[maxn]; LL k,x[maxn],y[maxn]; int main() { int i,pos; scanf("%d",&n); for (i=1;i<=n;i++) scanf("%lld",&x[i]); for (i=n;i>=1;i--) x[i]-=x[i-1]; for (i=1;i<=n;i++) f[i]=i; scanf("%d%lld",&m,&k); for (i=1;i<=m;i++) { ...
a.cc:6:11: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:20: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:30: error: 'maxn' was not declared in this scope 6 | i...
s771521929
p03953
C++
#include<bits/stdc++.h> using namespace std; #define LL long long int n,m,f[maxn],fk[maxn],dep[maxn]; LL k,x[maxn],y[maxn]; int main() { int i,pos; scanf("%d",&n); for (i=1;i<=n;i++) scanf("%lld",&x[i]); for (i=n;i>=1;i--) x[i]-=x[i-1]; for (i=1;i<=n;i++) f[i]=i; scanf("%d%lld",&m,&k); for (i=1;i<=m;i++) { ...
a.cc:6:11: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:20: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:30: error: 'maxn' was not declared in this scope 6 | i...
s134742663
p03953
C++
#include<bits/stdc++.h> using namespace std; #define LL long long int n,m,f[maxn],fk[maxn],dep[maxn]; LL k,x[maxn],y[maxn]; int main() { int i,pos; scanf("%d",&n); for (i=1;i<=n;i++) scanf("%lld",&x[i]); for (i=n;i>=1;i--) x[i]-=x[i-1]; for (i=1;i<=n;i++) f[i]=i; scanf("%d%lld",&m,&k); for (i=1;i<=m;i++) { ...
a.cc:6:11: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:20: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:30: error: 'maxn' was not declared in this scope 6 | i...
s296024806
p03953
C++
#include<bits/stdc++.h> using namespace std; #define LL long long int n,m,f[maxn],fk[maxn],dep[maxn]; LL k,x[maxn],y[maxn]; int main() { int i,pos; scanf("%d",&n); for (i=1;i<=n;i++) scanf("%lld",&x[i]); for (i=n;i>=1;i--) x[i]-=x[i-1]; for (i=1;i<=n;i++) f[i]=i; scanf("%d%lld",&m,&k); for (i=1;i<=m;i++) { ...
a.cc:6:11: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:20: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:30: error: 'maxn' was not declared in this scope 6 | i...
s106164161
p03953
C++
#include<bits/stdc++.h> using namespace std; #define LL long long int n,m,f[maxn],fk[maxn],dep[maxn]; LL k,x[maxn],y[maxn]; int main() { int i,pos; scanf("%d",&n); for (i=1;i<=n;i++) scanf("%lld",&x[i]); for (i=n;i>=1;i--) x[i]-=x[i-1]; for (i=1;i<=n;i++) f[i]=i; scanf("%d%lld",&m,&k); for (i=1;i<=m;i++) { ...
a.cc:6:11: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:20: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:30: error: 'maxn' was not declared in this scope 6 | i...
s674045174
p03953
C++
#include<bits/stdc++.h> using namespace std; #define LL long long int n,m,f[maxn],fk[maxn],dep[maxn]; LL k,x[maxn],y[maxn]; int main() { int i,pos; scanf("%d",&n); for (i=1;i<=n;i++) scanf("%lld",&x[i]); for (i=n;i>=1;i--) x[i]-=x[i-1]; for (i=1;i<=n;i++) f[i]=i; scanf("%d%lld",&m,&k); for (i=1;i<=m;i++) { ...
a.cc:6:11: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:20: error: 'maxn' was not declared in this scope 6 | int n,m,f[maxn],fk[maxn],dep[maxn]; | ^~~~ a.cc:6:30: error: 'maxn' was not declared in this scope 6 | i...
s820192303
p03953
C++
#include<bits/stdc++.h> #define N 100005 #define int long long using namespace std; int n,m,x[N],a[N]; long long k; int main() { cin>>n; for(int i=1;i<=n;i++)cin>>x[i]; cin>>m>>k; for(int i=1;i<=m;i++)cin>>a[i]; k%=4; for(int cas=1;cas<=k;cas++) { for(int i=1;i<=m;i++) { ...
cc1plus: error: '::main' must return 'int'
s254532055
p03953
C++
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back using namespace std; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef long long ll; const int N = 1e5+5; ll A[N]; a[N]; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for(int i = ...
a.cc:13:1: error: 'a' does not name a type 13 | a[N]; | ^ a.cc: In function 'int main()': a.cc:25:24: error: 'a' was not declared in this scope 25 | cin >> a[i]; | ^ a.cc:29:27: error: 'a' was not declared in this scope 29 | A[a[i]] = A...
s482910317
p03953
C++
#include <cstdio> #include <cstring> #include <vector> #include <queue> #include <string> #include <algorithm> #include <iostream> #include <string> #include <cmath> #include <map> #include <set> #include <functional> #include <iostream> #define MOD 1000000007LL #define EPS 1e-8 using namespace std; typedef long long l...
a.cc: In function 'int main()': a.cc:34:17: error: reference to 'next' is ambiguous 34 | next[i]=i; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/vector:62, from a.cc:3: /usr/include/c++/14/bit...
s099224303
p03953
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Main { void solve() throws IOException { int n = ni(); int[] x = nia(n); int m = ni(); long k = nl(); int[] a = nia(m); ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ 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.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fm...
s550584284
p03953
C++
#include<iostream> #include<iomanip> #include<map> #include<unordered_map> #include<set> #include<unordered_set> #include<vector> #include<array> #include<string> #include<stack> #include<queue> #include<algorithm> #include<cassert> #include<functional> #include<random> #include<complex> #include<bitset> #include<chron...
a.cc: In function 'int main()': a.cc:81:31: error: invalid initialization of reference of type 'const std::vector<long int>&' from expression of type 'int64_t [100000]' {aka 'long int [100000]'} 81 | auto permK = pow_perm(perm, K); | ^~~~ a.cc:50:40: note: in passing argum...
s017183510
p03953
Java
import java.io.IOException; import java.io.InputStream; import java.util.*; import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; public class Main { void run() { int n = ni(); long[] x = new long[n + 1]; for (int i = 1; i <= n; ++i) { x[i] = ...
Main.java:41: error: incompatible types: possible lossy conversion from long to int d_[i] = d[tikanD[i]]; ^ Main.java:43: error: incompatible types: int[] cannot be converted to long[] d = d_; ^ 2 errors
s142791659
p03953
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define print(x) #endif const int inf=1e9; const int64_t inf64=1e18; c...
a.cc: In function 'void solve()': a.cc:48:41: error: expected ';' before ')' token 48 | rep(i,1,n) ans[i]=diff[(i+k%loop)%n]); | ^ | ;
s685687249
p03953
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) #define all(c) c.begin(),c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x,y) x=min(x,y) #define chmax(x,y) x=max(x,y) using...
a.cc: In function 'int main()': a.cc:33:17: error: 'dfs' was not declared in this scope; did you mean 'ffs'? 33 | dfs(i,-1); | ^~~ | ffs
s566139308
p03953
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; template<typename T> using Graph = vector<vector<T>>; #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, a) REP(i, 0, a) #define EACH(i, a) for (auto i: a) #define ITR(x, a) for (__typeof(a.begin()) x = a.begin(); x != a.end...
a.cc:18:6: error: expected initializer before 'k' 18 | ll K k; | ^ a.cc: In function 'int main()': a.cc:32:15: error: 'K' was not declared in this scope 32 | cin >> M >> K; | ^ a.cc:33:3: error: 'k' was not declared in this scope 33 | k = K; | ^
s939882007
p03953
C++
#include <cstdio> #include <algorithm> #include <map> using namespace std; namespace { int x[100000]; int a[100000]; using S = map<int, int>; S op(const S &p, const S &q, const S &r) { // p + q - r S ans; for(auto i : p) ans[i.first] += i.second; for(auto i : q) ans[i.first] += i.second; ...
a.cc: In function 'void {anonymous}::op(const S*, const S*, S*, int)': a.cc:30:22: error: 'ans' was not declared in this scope; did you mean 'abs'? 30 | for(auto i = ans.begin(); i != ans.end();) | ^~~ | abs
s877976149
p03953
C++
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef vector<int> vi; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define rep(i,n) rep2(i,0,n) #define rep2(i,m,n) for(int i=m;i<(n);i++) #define ALL(c) (c).begin(...
a.cc: In function 'int main()': a.cc:36:25: error: return-statement with no value, in function returning 'int' [-fpermissive] 36 | if (K>=1000000) return ; | ^~~~~~
s806329959
p03953
C
#include<stdio.h> #define NMAX 100001 int x[NMAX], x_fast[NMAX], x_slow[NMAX], a[NMAX]; int main(void){ int N, j, M; __int64 i, start, end, period, K; scanf("%ld", &N); for(j = 1; j <= N; j++){ scanf("%ld", &(x[j])); x_fast[j] = x_slow[j] = x[j]; } scanf("%ld", &M); s...
main.c: In function 'main': main.c:9:5: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 i, start, end, period, K; | ^~~~~~~ | __int64_t
s444983957
p03953
C++
#include<bits/stdc++.h> using namespace std; long long mod = 1e9 + 9; int a[100005], h[100005]; map<long long, int> M; int n, m; long long k; long long v[100005]; long long hash() { long long res = 0; for (int i = 0; i < n; i++) res = ((res * v[i]) % mod + a[i]) % mod; return res; } int main() { ios::sync_with...
a.cc: In function 'int main()': a.cc:30:11: error: reference to 'hash' is ambiguous 30 | M[hash()] = 0; | ^~~~ In file included from /usr/include/c++/14/string_view:50, from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, ...
s052830645
p03954
C++
#include<bits/stdc++.h> using namespace std; int main() { scanf("%d",&n); printf("%d\n",n); return 0; }
a.cc: In function 'int main()': a.cc:5:17: error: 'n' was not declared in this scope; did you mean 'yn'? 5 | scanf("%d",&n); | ^ | yn
s102154144
p03954
C++
#include<bits/stdc++.h> using namespace std; int a[400005],n; int small(int i,int k) { return a[i+1]<=k&&a[i]<=k;//判断小于等于 } int big(int i,int k) { return a[i+1]>k&&a[i]>k;//判断大于 } int check(int k) { for(int i=0;i<=n-1;i++)//从中心开始看是否有两个连续的1或0 { if(small(n+i,k)==1||small(n-i-1,k)==1)//如果小于等于k的数在最...
a.cc: In function 'int check(int)': a.cc:20:43: error: '\U00005982\U0000679c\U00005927\U00004e8ek\U00007684\U00006570\U00005728\U00006700\U00004e0a\U00009762' was not declared in this scope 20 | if(big(n+i,k)==1||big(n-i-1,k)==1)如果大于k的数在最上面 | ^~~~~~~~~~~~~~~~~~...
s913180894
p03954
C++
/************************************************************************* > File Name: AT2165.cpp > Author: s-k-y > Mail: zhoutianyi0330@qq.com > Created Time: 2019年11月07日 星期四 08时54分07秒 ************************************************************************/ #include<bits/stdc++.h> #define ll long long #define...
a.cc: In function 'long long int pd(long long int)': a.cc:20:11: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 20 | F(i,2,n*2-1){ | ^ a.cc:11:41: note: in definition of macro 'F' 11 | #define F(i,a,b) for(register long long i=a;i<=b;i++) | ...
s835739221
p03954
C++
#include <bits/stdc++.h> using namespace std; typedef pair <int, int> pii; typedef long long ll; const int N = 1e5 + 10, inf = 1e6; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >> n; for (int i = 0; i < n + n - 1; i++) cin >> a[i]; int ans; for (int i = 1; i < n + n - 2; i+...
a.cc: In function 'int main()': a.cc:16:24: error: 'a' was not declared in this scope 16 | cin >> a[i]; | ^ a.cc:20:20: error: 'a' was not declared in this scope 20 | if(a[i] <= a[i + 1] && a[i] >= a[i - 1]) | ^
s442274582
p03954
C++
#include<bits/stdc++.h> #define For(i,a,b) for(int i=a;i<=b;++i) #define Rof(i,a,b) for(int i=a;i>=b;--i) #define Go(x) for(int i=First[x];i;i=Next[i]) #define mp maxe_pair #define fi first #define se second typedef long long longint; using namespace std; /*************head*************/ const int MAXN=1e5+10; bool t[2...
a.cc:22:8: error: ISO C++ forbids declaration of 'Init' with no type [-fpermissive] 22 | inline Init(int x) | ^~~~ a.cc: In function 'int Init(int)': a.cc:26:1: warning: no return statement in function returning non-void [-Wreturn-type] 26 | } | ^
s734764680
p03954
C++
#include <iostream> using namespace std; int a[200005],n; bool b[200005]; bool pd(int x){for(int i=1;i<=n*2-1;i++) b[i]=(a[i]>=x);b[0]=b[1]; for(int i=n;i<=n+n;i++){if(b[i]==b[i+1])return b[i];if(b[n+n-i]==b[n+n-i-1])return b[n+n-i];} } int main(){ cin>>n; for(int i=1;i<=n*2-1;i++)cin>>a[i]; int l=1,r=n*2,A=0,md; whil...
a.cc: In function 'int main()': a.cc:12:46: error: 'elser' was not declared in this scope 12 | while(l<=r){md=(l+r)/2;if(pd(md))l=md+1,A=md;elser=md-1;}cout<<A;} | ^~~~~ a.cc: In function 'bool pd(int)': a.cc:7:1: warning: control reaches end of non-void function [-...
s630405030
p03954
C++
#include<bits/stdc++.h> #define For(i,a,b) for(int i=a;i<=b;++i) #define Rof(i,a,b) for(int i=a;i>=b;--i) #define Go(x) for(int i=First[x];i;i=Next[i]) #define mp make_pair #define fi first #define se second typedef long long longint; using namespace std; /*************head*************/ const int MAXN=1e5+10; bool t[2...
a.cc: In function 'bool Check(int)': a.cc:24:9: error: 'Init' was not declared in this scope 24 | Init(x); | ^~~~
s045383267
p03954
C
#include<bits/stdc++.h> using namespace std; const int Max_N=1e5; int N,A[Max_N*2+10]={},B[Max_N*2+10]={}; inline bool Chck(int x){ if(B[N-1]==B[N]||B[N]==B[N+1]) return B[N]; int L=N-2,R=N+2; for(;L>=1&&R<=2*N-1;){ if(B[L]==B[L+1]) return B[L]; if(B[R]==B[R-1]) return B[R]; --L; ++R; } return B[1]; } int m...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s119053958
p03954
C++
#if 0 date 假设最终答案为 x ,那么其他的数其实可以分为三种:x ,小于 x 和大于 x 。 只需要关注与 x 的大小,把小于 x 的全设为 -INF ,大于 x 的全设为 INF ,得出的结果一定仍是 x 。 但这仍然难以处理,考虑枚举一个值 x ,把所有数分为两种:小于等于 x (0) 和大于 x (1) 。 如此将原数列转换为 01 串,若最后剩下的是 0 ,那么答案一定小于 x ,否则答案一定大于 x 。 那么 x 的值可以二分,接下来问题转换为 01 串上求最后剩下的数。 首先,如果两个相等的值相邻,那么在之后的操作中这两个位置的值始终不变。 那么如果中间的值 a[mid] 与 a[mid - 1] 或 ...
a.cc:4:70: error: extended character 。 is not valid in an identifier 4 | 假设最终答案为 x ,那么其他的数其实可以分为三种:x ,小于 x 和大于 x 。 | ^ a.cc:5:92: error: extended character 。 is not valid in an identifier 5 | 只需要关注与 x 的大小,把小于 x 的全设为 -INF ,大于 x 的全设为 INF ,...
s243354722
p03954
C++
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include <random> #include...
a.cc: In function 'int solve(int)': a.cc:52:24: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing] 52 | int itr[2] = { 1e9,1e9}; | ^~~ a.cc:52:28: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing] 52 | int itr[2] = {...
s693815109
p03954
C++
#include<bits\stdc++.h> using namespace std; int n,a[200001]; bool checx(int x) { if((a[n-1]<=x&&a[n]<=x)||(a[n]<=x&&a[n+1]<=x))return 1; if((a[n-1]> x&&a[n]> x)||(a[n]> x&&a[n+1]> x))return 0; for(int i=1;i<n-1;i++){ if((a[n+i]<=x&&a[n+i+1]<=x)||(a[n-i]<=x&&a[n-i-1]<=x))return 1; if((a[n+i]...
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s888879179
p03954
C
#include<bits/stdc++.h> using namespace std; int n; vector<int>v; int main() { cin>>n; for(int i=1;i<2*n;i++) { int a; cin>>a; v.push_back(a); } while(v.size()!=1) { vector<int>vv; for(int i=1;i<v.size()-1;i++)vv.push_back(v[i-1]+v[i]+v[i+1]-min(v[i-1],min(v[i],v[i+1]))-max(v[i-1],max(v[i],v[i+1]))); ...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s146794691
p03954
C++
#include<bits/stdc++.h> using namespace std; int n,ans=-1; vector<int> v; int middle(int a,int b,int c) { if((a>=b&&a<=c)||(a>=c&&a<=b)) return a; if((b>=a&&b<=c)||(b>=c&&b<=a)) return b; if((c>=a&&c<=b)||(c>=b&&c<=a)) return c; } void dfs(vector<int> a) { if(a.size()==1) { ans=a[0]; return; } vector<i...
a.cc:38:2: error: stray '#' in program 38 | }#include<bits/stdc++.h> | ^ a.cc:38:3: error: 'include' does not name a type 38 | }#include<bits/stdc++.h> | ^~~~~~~ a.cc:40:5: error: redefinition of 'int n' 40 | int n,ans=-1; | ^ a.cc:3:5: note: 'int n' previously declared here 3 | in...
s759226682
p03954
C++
//NOT A FSKY CODE #include <algorithm> #include <cstdio> #include <iostream> #include <cfloat> #include <climits> #include <cstdlib> #include <cstring> #include <cmath> #include <queue> #include <sstream> #include <stack> #include <time.h> #include <vector> #include <complex> #include <map> #include <set> #include <iom...
a.cc: In function 'int main()': a.cc:55:15: error: 'mid' was not declared in this scope 55 | cout<<mid; | ^~~
s238277062
p03954
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <cfloat> #include <climits> #include <cstdlib> #include <cstring> #include <cmath> #include <queue> #include <sstream> #include <stack> #include <time.h> #include <vector> #include <complex> #include <map> #include <set> #include <iomanip> #include <ma...
a.cc: In function 'void qq()': a.cc:39:19: error: 'x' was not declared in this scope 39 | cout<<sum/x | ^
s945001997
p03954
C++
#include<bits/stdc++.h> using namespace std; int arr[100010]; int main(0) { int n; cin >> n; for(int i=0; i<n; i++) { cin >> arr[i]; } sort(arr, arr+n); cout << arr[n-1] << endl; return 0; }
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main(0) | ^~~~ a.cc:5:1: error: expected ',' or ';' before '{' token 5 | { | ^
s690283028
p03954
C++
#include <bits/stdc++.h> using namespace std; const int N = 200010; int n, a[N << 1]; int sma (int i, int j, int k) { return a[i] <= k && a[j] <= k; } int big (int i, int j, int k) { return a[i] > k && a[j] > k; } int check (int k) { for (int i = 0; i < n - 1; ++i) {//枚举距离判断 if (big (n + i, n ...
a.cc: In function 'int check(int)': a.cc:21:12: error: 'small' was not declared in this scope; did you mean 'sma'? 21 | return small (1, 1, k);//没有重合的特判 | ^~~~~ | sma
s479231463
p03954
C++
#include <stdio.h> #include <string.h> #include <algorithm> using namespace std; const int N=2e5+2,inf=1e9; int a[N],b[N]; int n,m,i,x,l,r,mid,c,zx,as; inline void read(int &x) { c=getchar(); while ((c<48)||(c>57)) c=getchar(); x=c^48;c=getchar(); while ((c>=48)&&(c<=57)) { x=x*10+(c^48); c=getchar(); } } inl...
a.cc: In function 'bool pd()': a.cc:39:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 39 | int main() | ^~ a.cc:39:9: note: remove parentheses to default-initialize a variable 39 | int main() | ^~ | -- a.cc:39:9: note: or repla...
s458261847
p03954
C++
#include <bits/stdc++.h> using namespace std; int kt(vector<int> &vi) { int n = vi.size(); int mid = vi.size()/2; { int a1 = vi[mid], a2 = vi[mid-1], a3 = vi[mid+1]; if(a1==a2||a2==a3) return a2; } int l = mid, r = mid; while(l>=0) { if(a[l]==(1-a[l-1])) ...
a.cc: In function 'int kt(std::vector<int>&)': a.cc:16:12: error: 'a' was not declared in this scope 16 | if(a[l]==(1-a[l-1])) | ^ a.cc:23:12: error: 'a' was not declared in this scope 23 | if(a[r]==(1-a[r+1])) | ^ a.cc:30:20: error: 'a' was not declared in this s...
s930642054
p03954
C++
//============================================================================ // Name : test.cpp // Author : aelgawah // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #incl...
a.cc:10:10: fatal error: set.h: No such file or directory 10 | #include <set.h> | ^~~~~~~ compilation terminated.
s328332364
p03954
C++
#include<iostream> #include<cstdio> using namespace std; int n,a[200005]; inline bool check(const int &k){ if((a[n-1]<=k&&a[n]<=k)||(a[n]<=k&&a[n+1]<=k))return 1; if((a[n-1]> k&&a[n]> k)||(a[n]> k&&a[n+1]> k))return 0; for(int i=1;i<n-1;i++){ if((a[n+i]<=k&&a[n+i+1]<=k)||(a[n-i]<=k&&a[n-i-1]<=k))r...
a.cc: In function 'int main()': a.cc:26:20: error: expected '}' at end of input 26 | printf("%d",l); | ^ a.cc:17:11: note: to match this '{' 17 | int main(){ | ^
s201269170
p03954
C++
#include<bits/stdc++.h> using namespace std; int n,a[2000005]; inline bool check(int k) { if((a[n-1]<=k&&a[n]<=k)||(a[n]<=k&&a[n+1]<=k)) return true; if((a[n-1]>k&&a[n]>k)||(a[n]>k&&a[n+1]>k)) return false; for(int i=1;i<n-1;i++) { if((a[n+i]<=k&&a[n+i+1]<=k)||(a[n-i]<=k&&a[n-i-1]<=k)) retur...
a.cc: In function 'bool check(int)': a.cc:19:5: error: 'else' without a previous 'if' 19 | else | ^~~~ a.cc: In function 'int main()': a.cc:24:12: error: expected ';' before 'scanf' 24 | freopen | ^ | ; 25 | scanf("%d",&n); | ~~~~~
s736245432
p03954
C++
#include <iostream> #include<bits/stdc++.h> #define RE register using namespace std; const int maxn = 1e6; int n,a[maxn*2 - 1]; void read(int &x){ x=0;int f=1;char s ;s=getline(); while(s<'0'||s>'9'){if(s='-')f=-1;s=getline();} while(s>='0'&&s<='9'){x=x*10+s-'0';s=getline()} x*=f; } inline bool small(i...
a.cc: In function 'void read(int&)': a.cc:8:34: error: no matching function for call to 'getline()' 8 | x=0;int f=1;char s ;s=getline(); | ~~~~~~~^~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s308845090
p03954
C++
#include <iostream> #include <ctime> #include <algorithm> #include <cstdlib> #include <cstdio> #include <cstring> using namespace std; const int MAXN = 200005; int a[MAXN],t[MAXN],n; inline bool check(int limit) { for(int i=1;i<=n*2-1;++i) t[i]=(a[i]>=limit); int l=-1,r=-1,lpos=-0x3f3f3f3f,rpos=0x3f3f3f3f; for(int...
a.cc: In function 'bool check(int)': a.cc:20:20: error: 'mid' was not declared in this scope 20 | if(mid&1)return t[mid]; | ^~~ a.cc:22:27: error: 'mid' was not declared in this scope 22 | else return (rpos-mid>mid-lpos?l:r); | ^~~
s637649540
p03954
C++
#include <bits/stdc++.h> using namespace std; int main(){ scanf("%d",&n); printf("%d\n",n); }
a.cc: In function 'int main()': a.cc:4:13: error: 'n' was not declared in this scope; did you mean 'yn'? 4 | scanf("%d",&n); | ^ | yn
s643667341
p03954
C++
#include<cstdio> #include<algorithm> using namespace std; int n,a[200010],ans; bool p[200010]; bool check(int mid){ for(int i=1;i<=n*2-1;i++) p[i]=(a[i]<=mid); for(int i=0;i<n-1;i++){ if(p[n-i]==p[n-i-1]) return p[n-i]; if(p[n+i]==p[n+i+1]) return p[n+i+1]; } return p[1]; } int rd(){ int x=0; char c; ...
a.cc: In function 'int rd()': a.cc:21:16: error: 'isdigit' was not declared in this scope 21 | while(!isdigit(c)); | ^~~~~~~
s358158603
p03954
C++
#include<bits/stdc++.h> using namespace std; int n,a[20000010]; bool x(int i,int j,int k) { return a[i]<=k&&a[j]<=k; } bool y(int i,int j,int k){ return a[i]>k&&a[j]>k; } bool check(int a){ for(int i=0;i<n-1;i++){ if(y(n+i,n+i+1,a)||y(n-i,n-i-1,a)) return 0; if(x(n+i,n+i+1,a)||x(n-i,n-i-1,a...
a.cc: In function 'bool check(int)': a.cc:15:18: error: 'k' was not declared in this scope 15 | return x(1,1,k); | ^
s070512299
p03954
C++
#include<bits/stdc++.h> using namespace std; int n,a[20000010]; bool x(int i,int j,int k) { return a[i]<=k&&a[j]<=k; } bool y(int i,int j,int k){ return a[i]>k&&a[j]>k; } bool check(int a){ for(int i=0;i<n-1;i++){ if(y(n+i,n+i+1,a)||y(n-i,n-i-1,a)) return 0; if(x(n+i,n+i+1,a)||x(n-i,n-i-1,a...
a.cc: In function 'bool check(int)': a.cc:15:18: error: 'k' was not declared in this scope 15 | return a(1,1,k); | ^ a.cc:15:19: error: 'a' cannot be used as a function 15 | return a(1,1,k); | ^