submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s168135887
p03785
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> #include<utility> #include<numeric> #include<vector> #include<map> #include<unordered_map> #include<set> #include<tuple> #include<stack> #include<queue> #include<functional> #include<iterator> #include<cmath> #include<cctype> using namespace std;...
a.cc: In function 'int main()': a.cc:46:24: error: no matching function for call to 'min(long int, int&)' 46 | tmp=min(e-(&t[i]),c); | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s077352747
p03785
Java
public int solve() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int C = sc.nextInt(); int K = sc.nextInt(); int T[] = new int[N]; for(int i = 0; i < N; i++) { T[i] = sc.nextInt(); } int res = 1; int people = 0; int start = T[0] + K; int j = 0; while(j < N) { while(pe...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public int solve() { ^ (use --enable-preview to enable unnamed classes) 1 error
s455699258
p03785
Java
public void solve(int testNumber, InputReader in, PrintWriter out) { System.out.println("Enter data"); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int C = sc.nextInt(); int K = sc.nextInt(); int T[] = new int[N]; for(int i = 0; i < N; i++) { T[i] = sc.nextInt(); } int res = 1; int...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public void solve(int testNumber, InputReader in, PrintWriter out) { ^ (use --enable-preview to enable unnamed classes) 1 error
s817467197
p03785
Java
// A. Airport bus import java.util.*; public class AtCoder011A { public void solve(int testNumber, InputReader in, PrintWriter out) { System.out.println("Enter data"); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int C = sc.nextInt(); int K = sc.nextInt(); int T[] = new int[N]; for(int i...
Main.java:5: error: class AtCoder011A is public, should be declared in a file named AtCoder011A.java public class AtCoder011A { ^ Main.java:6: error: cannot find symbol public void solve(int testNumber, InputReader in, PrintWriter out) { ^ symbol: class InputReader loc...
s888298564
p03785
Java
// A. Airport bus import java.util.*; public class AtCoder011A { public void solve() { System.out.println("Enter data"); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int C = sc.nextInt(); int K = sc.nextInt(); int T[] = new int[N]; for(int i = 0; i < N; i++) { T[i] = sc.nextInt(); } ...
Main.java:4: error: class AtCoder011A is public, should be declared in a file named AtCoder011A.java public class AtCoder011A { ^ 1 error
s718868090
p03785
Java
// A. Airport bus import java.util.*; public class AtCoder011A { public static void main(String args[]) { System.out.println("Enter data"); Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int C = sc.nextInt(); int K = sc.nextInt(); int T[] = new int[N]; for(int i = 0; i < N; i++) { T[i] = ...
Main.java:4: error: class AtCoder011A is public, should be declared in a file named AtCoder011A.java public class AtCoder011A { ^ 1 error
s330883461
p03785
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int a[100005]; int main(){ ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int n, c, k; cin >> n >> c >> k; for(int i = 0 ; i < n ; i++)cin >> a[i]; sort(a,a+n); int i = 0; int cnt =0; while(i!=n){ i = min(i+c, (upper_bound(a,a+n,...
a.cc: In function 'int main()': a.cc:15:12: error: no matching function for call to 'min(int, long int)' 15 | i = min(i+c, (upper_bound(a,a+n,a[i]+k)-a)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linu...
s703067106
p03785
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int a[100005]; int main(){ ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int n, c, k; cin >> n >> c >> k; for(int i = 0 ; i < n ; i++)cin >> a[i]; sort(a,a+n); int i = 0; int cnt =0; while(i!=n-1){ int j = min(i+c-1, (upper_boun...
a.cc: In function 'int main()': a.cc:15:16: error: no matching function for call to 'min(int, long int)' 15 | int j = min(i+c-1, (upper_bound(a,a+n,a[i]+k)-a)-1); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/inc...
s819361377
p03785
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; typedef long long ll; int n,c,k,ans,x,b; int t[100005]; int main(void){ scanf("%d%d%d",&n,&c,&k); for(int i=0;i<n;i++)scanf("%d"t+i); sort(t,t+n); x=c+1; for(int i=0;i<n;i++){ if(++x>c||b+k<t){ ans++;...
a.cc: In function 'int main()': a.cc:10:31: error: unable to find string literal operator 'operator""t' with 'const char [3]', 'long unsigned int' arguments 10 | for(int i=0;i<n;i++)scanf("%d"t+i); | ^~~~~ a.cc:14:22: error: ISO C++ forbids comparison between pointer and integ...
s534825365
p03785
C++
#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) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define ALL(a) (a).begin(),(a).end()#define debug(x) cerr << #x << ":" << ...
a.cc:10:14: error: '#' is not followed by a macro parameter 10 | #define ALL(a) (a).begin(),(a).end()#define debug(x) cerr << #x << ":" << x << endl; | ^ a.cc: In function 'int main()': a.cc:39:8: error: 'ALL' was not declared in this scope 39 | sort(ALL(T)); | ^~~
s310098920
p03785
C++
def minimumNumberOfBus(a, c, k): foo = 0 a = sorted(a) cur = 0 while cur<len(a): departing_time = a[cur]+k space = c while space>0 and cur<len(a) and a[cur]<=departing_time: cur += 1 space -= 1 foo += 1 return foo def main(): n, c, k = [in...
a.cc:21:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 21 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def minimumNumberOfBus(a, c, k): | ^~~
s877596995
p03785
C++
include<iostream> #include<algorithm> using namespace std; typedef long long int ll; int main(){ int N, C, K, T[100000]; cin >> N >> C >> K; for(int i = 0; i < N; i++) cin >> T[i]; sort(T, T + N); int ans = 0; for(int i = 0; i < N; i++){ int s = T[i]; int cnt = 1; while(cnt < C && T[i + 1] - s <= K){ cnt...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g...
s093670062
p03785
Java
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class Task { public void solve(int testNumber, Scanner in, PrintWriter out) { int n = in.nextInt(); int c = in.nextInt(); ...
Main.java:8: error: class Task is public, should be declared in a file named Task.java public class Task { ^ 1 error
s343287980
p03785
Java
package codes; import java.util.Scanner; import java.io.PrintWriter; import java.util.Arrays; public class Task { public void solve(int testNumber, Scanner in, PrintWriter out) { int n = in.nextInt(); int c = in.nextInt(); int k = in.nextInt(); int []t = new int[n]; for (in...
Main.java:7: error: class Task is public, should be declared in a file named Task.java public class Task { ^ 1 error
s971157402
p03785
C++
#include<bits/stdc++.h using namespace std; using ll = int64_t; int main(){ ll n, c, k; cin >> n >> c >> k; ll t[n]; for(ll i = 0; i < n; i++) cin >> t[i]; sort(t, t + n); ll ans = 0, num = 1, s = t[0]; for(ll i = 1; i < n; i++){ if(t[i] > s + k || num == c){ num = 0; ans++; s = t[i...
a.cc:1:23: error: missing terminating > character 1 | #include<bits/stdc++.h | ^
s765217251
p03785
C++
#include <cassert> #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> /* //#if __cplusplus >= ...
a.cc: In function 'int main()': a.cc:114:24: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<long long int>') 114 | vector<ll> t(n);cin>>t; | ~~~^~~ | | | | | st...
s351229826
p03785
C++
#include <cassert> #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> /* //#if __cplusplus >= ...
a.cc: In function 'int main()': a.cc:114:5: error: 'vll' was not declared in this scope; did you mean 'ull'? 114 | vll t(n);cin>>t; | ^~~ | ull a.cc:114:19: error: 't' was not declared in this scope 114 | vll t(n);cin>>t; | ^
s814989395
p03785
C++
#define _CRT_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> #include <list> #include <utility> #include <algorithm> #include <functional> #include <cmath> #include <stack> #include <queue> #include <set> ...
a.cc:87:9: error: 'MInt' does not name a type 87 | MInt a, b, c; | ^~~~
s217938058
p03785
Java
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int c = sc.nextInt(); int k = sc.nextInt(); int[] t = new int[n]; for(int i=0; i<n; i++){ ...
Main.java:33: error: class, interface, enum, or record expected } ^ 1 error
s350145604
p03785
C++
#include <cstdio> #include <algorithm> using namespace std; int n, c, k, ans, x, a[100005]={-1e9}; int main() { int i; scanf("%d%d%d", &n, &c, &k); for(i=1; i<=n; i++) scanf("%d", &a[i]); sort(a, a+n+1); for(i=1; i<=n; i++) { if(x==0 || a[i]-a[i-1]>k) ans++, x=c; x--; } printf("%d", ans); return 0; }
a.cc:4:33: error: narrowing conversion of '-1.0e+9' from 'double' to 'int' [-Wnarrowing] 4 | int n, c, k, ans, x, a[100005]={-1e9}; | ^~~~
s223910232
p03785
Java
package main; import java.io.PrintWriter; import java.io.InputReader; public class TaskA { public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); int c = in.nextInt(); int k = in.nextInt(); int[] t = new int[n]; for (int i = 0; i < n; i++) { t[i] = in.nextInt(); } A...
Main.java:6: error: class TaskA is public, should be declared in a file named TaskA.java public class TaskA { ^ Main.java:4: error: cannot find symbol import java.io.InputReader; ^ symbol: class InputReader location: package java.io Main.java:7: error: cannot find symbol public void solve...
s270092514
p03785
C++
#include "bits/stdc++.h" using namespace std; int main(){ long long int n,c,k; cin>>n>>c>>k; vector<int> t(n); for(int i=0;i<n;i++)cin>>t[i]; sort(t.begin(),t.end()); long long int np=0; long long int ans=0; long long int count=0; for(int i=0;i<n;i++){ if(cout>c){ ans++; count=1; np=t[i]; }el...
a.cc: In function 'int main()': a.cc:16:24: error: no match for 'operator>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'long long int') 16 | if(cout>c){ | ~~~~^~ | | | | | long long int ...
s705462506
p03785
C++
#include<cmath> #include<math.h> #include<ctype.h> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cerrno> #include<cfloat> #include<ciso646> #include<climits> #include<clocale> #include<complex> #include<csetjmp> #include<csignal> #include<cstdarg> #include<cstddef> #include<cstdio> #i...
a.cc: In function 'void add(int, int)': a.cc:64:9: error: reference to 'next' is ambiguous 64 | next[cnt]=head[x]; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmat...
s195701006
p03785
C++
¥#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <queue> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set...
a.cc:1:1: error: extended character ¥ is not valid in an identifier 1 | ¥#include <vector> | ^ a.cc:1:2: error: stray '#' in program 1 | ¥#include <vector> | ^ a.cc:1:1: error: '\U000000a5' does not name a type 1 | ¥#include <vector> | ^ In file included from /usr/include/c++/14/iosfwd:42...
s404856230
p03785
C++
¥#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <queue> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set...
a.cc:1:1: error: extended character ¥ is not valid in an identifier 1 | ¥#include <vector> | ^ a.cc:1:2: error: stray '#' in program 1 | ¥#include <vector> | ^ a.cc:1:1: error: '\U000000a5' does not name a type 1 | ¥#include <vector> | ^ In file included from /usr/include/c++/14/iosfwd:42...
s387799573
p03785
C++
#include <iostream> #include <algorithm> using namespace std; int n, c, k; int t[100010]; int main(){ cin >> n >> c >> k; for(int i = 0; i < n; i++) cin >> t[i]; sort(t, t+n); int count = 0; int j = 0; while(j < n){ int hito = 0; while(hito < c){ if(t[j+1] <= t[j]+k){ hito++; ...
a.cc: In function 'int main()': a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s315507722
p03785
C++
#include <iostream> #include <algorithm> using namespace std; int n, c, k; int t[100010]; int main(){ cin >> n >> c >> k; for(int i = 0; i < n; i++) cin >> t[i]; sort(t, t+n); int count = 0; int j = 0; while(j < n){ int hito = 0; while(hito < c){ if(t[j+1] <= t[j]+k){ hito++; ...
a.cc: In function 'int main()': a.cc:23:8: error: '\U000000e5' was not declared in this scope 23 | }å | ^ a.cc:28:2: error: expected '}' at end of input 28 | } | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s791013078
p03785
C++
Last login: Wed Jul 26 10:34:29 on ttys000 [csws037:~] t1745036% ls Desktop Library PWD_REMAIN_DAY Source Documents Movies Pictures a.out Downloads Music Public [csws037:~] t1745036% ls Desktop Library PWD_REMAIN_DAY Source Documents Movies Pictures a.out Downloads Music Public [csws037:~] t1745036% ls Desktop ...
a.cc:21:41: warning: `\U000030d5\U0000309a\U000030ed\U00006f141' is not in NFC [-Wnormalized=] 21 | MyObjCApp <U+30D5><U+309A><U+30ED><U+6F14>1-2Q<U+30EC><U+30DB><U+309A><U+30FC>?<U+30C8>.docx | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:21:49: ...
s522370393
p03785
Java
import java.util.*; public class agco11A { public static void main(String args[]) { int n,c,k; Scanner sc=new Scanner(System.in); n=sc.nextInt(); c=sc.nextInt(); k=sc.nextInt(); int[] t=new int[n]; for(int i=0;i<n;i++) t[i]=sc.nextInt(); Arrays.sort(t); int i=0,start,bus=1,people=...
Main.java:3: error: class agco11A is public, should be declared in a file named agco11A.java public class agco11A ^ 1 error
s188539530
p03785
C++
#include <cstdio> #include <cstring> #include <iostream> #include <vector> #include <algorith> using namespace std; #define int long long #define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl; #define REP(i,y) for(int i=0;i<(int)(y);i++) #define REPP(i,y) for(int i=1;i<=(int)(y);i++) #define sci(x) int x;scanf("%d",...
a.cc:5:10: fatal error: algorith: No such file or directory 5 | #include <algorith> | ^~~~~~~~~~ compilation terminated.
s429372672
p03785
C++
#include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; #define int long long #define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl; #define REP(i,y) for(int i=0;i<(int)(y);i++) #define REPP(i,y) for(int i=1;i<=(int)(y);i++) #define sci(x) int x;scanf("%d",&x); #define scii(x,...
a.cc: In function 'int main()': a.cc:26:3: error: 'sort' was not declared in this scope; did you mean 'short'? 26 | sort(T.begin(),T.end()); | ^~~~ | short
s807613473
p03785
C++
left = middle; } } int pos = left; if(t[right]<=x){ pos = right; } return pos; } bool vis[maxn]; int main(){ int i,j; scanf("%d%d%d",&n,&c,&k); for(i=1;i<=n;i++){ scanf("%lld",t+i); } sort(t+1, t+1+n); mem...
a.cc:2:13: error: 'left' does not name a type 2 | left = middle; | ^~~~ a.cc:3:9: error: expected declaration before '}' token 3 | } | ^ a.cc:4:5: error: expected declaration before '}' token 4 | } | ^ a.cc:5:15: error: 'left' was not declare...
s695163036
p03785
C++
// 簡易競プロテンプレ #include <bits/stdc++.h> #define ll long long using namespace std; ll n, c, k; ll t[114514]; int main(void){ cin >> n >> c >> k; for(int i=0;i<n;i++) cin >> t[i]; sort(&t[0], &t[n]); ll ans = 0, offs = 0; for(int i=1;i<n;i++){ if (t[offs]+k>t[i] && i+1<n) continue; offs = min(offs+c, i); ans++; ...
a.cc: In function 'int main()': a.cc:14:13: error: no matching function for call to 'min(long long int, int&)' 14 | offs = min(offs+c, i); ans++; | ~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s354182858
p03785
Java
public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int c = sc.nextInt(); int k = sc.nextInt(); int[] a = new int[n]; for(int i = 0;i < n; i++){ a[i] = sc.nextInt(); } Arrays.sort(a); int cnt = 1; int wait = a[0]; int ans = 1; ...
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:11: error: cannot find symbol ...
s304939766
p03785
C++
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #ifdef PRINT...
a.cc: In function 'int solve()': a.cc:56:1: warning: no return statement in function returning non-void [-Wreturn-type] 56 | } | ^ At global scope: cc1plus: error: '::main' must return 'int'
s337182970
p03785
Java
import java.util.Arrays; import java.util.Scanner; public class AirportBus { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int n = s.nextInt(); int c = s.nextInt(); int k = s.nextInt(); int a[] = new int[n]; int b[] = new int[n]; int ...
Main.java:5: error: class AirportBus is public, should be declared in a file named AirportBus.java public class AirportBus { ^ 1 error
s019362466
p03785
Java
import java.util.Arrays; import java.util.Scanner; public class airportbus { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int n = s.nextInt(); int c = s.nextInt(); int k = s.nextInt(); int ans = 0, count = 0; int curr = Integer.MIN_VAL...
Main.java:5: error: class airportbus is public, should be declared in a file named airportbus.java public class airportbus { ^ 1 error
s702817084
p03785
C++
#include<bits/stdc++.h> #include<sstream> #include<ext/pb_ds/tree_policy.hpp> using namespace std; #define mod 1000000007 #define all(v) v.begin(),v.end() #define loop(i,a,b) for(i=(ll)a;i<(ll)b;i++) #define revloop(i,a,b) for(i=(int)a;i>=(int)b;i--) #define stloop(it,v) for(it=v.begin();it!=v.end();++it) #define ii pa...
a.cc:22:1: error: extended character   is not valid in an identifier 22 |     int i=0,j,Lm; | ^ a.cc:22:1: error: extended character   is not valid in an identifier a.cc:22:1: error: extended character   is not valid in an identifier a.cc:23:1: error: extended character   is not valid in an identifier 23 | ...
s405752967
p03785
C++
/code #include<bits/stdc++.h> #include<sstream> #include<ext/pb_ds/tree_policy.hpp> using namespace std; #define mod 1000000007 #define all(v) v.begin(),v.end() #define loop(i,a,b) for(i=(ll)a;i<(ll)b;i++) #define revloop(i,a,b) for(i=(int)a;i>=(int)b;i--) #define stloop(it,v) for(it=v.begin();it!=v.end();++it) #define...
a.cc:23:1: error: extended character   is not valid in an identifier 23 |     int i=0,j,Lm; | ^ a.cc:23:1: error: extended character   is not valid in an identifier a.cc:23:1: error: extended character   is not valid in an identifier a.cc:24:1: error: extended character   is not valid in an identifier 24 | ...
s700329707
p03785
Java
import java.util.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int C = sc.nextInt(); int K = sc.nextInt(); int a[] = new int[N]; for (int i = 0; i < N; i++) a[i] = sc.nextInt(); Arrays.sort(a); int ans = 0, cnt = 0, st = 0; ...
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s266727229
p03785
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,c,k,ans=0;bool t=true; scanf("%d %d %d", &n, &c,&k); vector<int>v(n); for(int i=0;i<n;++i)scanf("%d",&v[i]); sort(v.begin(),v.end()); for(auto it=v.cbegin();t;++ans){ const int x=*it+k; for(int i=0;*it<=x&&i<c&&t=it!=v.cend();++i,++it); ...
a.cc: In function 'int main()': a.cc:11:28: error: lvalue required as left operand of assignment 11 | for(int i=0;*it<=x&&i<c&&t=it!=v.cend();++i,++it); | ~~~~~~~~~~~^~~
s076232640
p03785
C++
// ALLAH \\ whoishussain.org #include<bits/stdc++.h> using namespace std; main(){ int n, t = 0, sum = 0; cin >>n; for(int i = 0;i < n;i ++){ int a;cin >> a; if( sum * 2 < a ) t = i; sum += a; } cout << n - t << 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:13:23: error: expected '}' at end of input 13 | cout << n - t << endl; | ^ a.cc:5:7: note: to match this '{' 5 | main(){ | ...
s843807941
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { /*freopen("in.txt","r",stdin); freopen("out.txt","w",stdout);*/ int n,c,k; cin>>n>>c>>k; int t[n]; for(int i=0;i<n;i++) { cin>>t[i]; } sort(t,t+n); int j=0,b=0,cpt=0; for(int i=0;i<n;i++) { if(t[i]...
a.cc:34:5: error: redefinition of 'int main()' 34 | int main() | ^~~~ a.cc:4:5: note: 'int main()' previously defined here 4 | int main() | ^~~~
s281418384
p03785
C++
#include <iostream> using namespace std; #define MAX 100000 int p[MAX]; int main() { int N,C,K; int b=0; cin>>N>>C>>K; for(int i=0;i<N;i++) { cin>>p[i]; } sort(p,p+N); int end,cap; for(int i=0;i<N;) { end=p[i]+K-1; cap=1; b++; while (cap < C &...
a.cc: In function 'int main()': a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(p,p+N); | ^~~~ | short
s243938583
p03785
C++
c#include <algorithm> #include <bitset> #include <deque> #include <exception> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef ...
a.cc:1:2: error: stray '#' in program 1 | c#include <algorithm> | ^ a.cc:1:1: error: 'c' does not name a type 1 | c#include <algorithm> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/bitset:49, from a.cc:2: /usr/inclu...
s889470166
p03785
C++
#include "stdafx.h" #include <iostream> #include <vector> #include <algorithm> using namespace std; #define int long long int n, c, k; int T[101010]; bool Tv[101010] = { false }; signed main() { cin >> n >> c >> k; for (int i = 0; i < n; i++) { cin >> T[i]; } sort(T, T + n); int busCnt = 0; for (int i = ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s434752675
p03785
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstdlib> #include <cstring> using namespace std; #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define REP(i,n) FOR(i,0,n) typedef long long ll; ll t[100001]; ll time[100001]; int main(){ ll n, c, k; scanf("%lld %lld %lld", &n, &c, &k...
a.cc:15:15: error: 'll time [100001]' redeclared as different kind of entity 15 | ll time[100001]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bit...
s008593270
p03785
C++
#include <algorithm>//min/max/sort(rand-access it)/merge #include <iostream>//cin/cout/wcin/wcout/left/right/internal/dec/hex/oct/fixed/scientific #include <vector> using namespace std; typedef unsigned long long ull; int main(void) { ui n, c, k; cin >> n >> c >> k; std::vector<ui> t; for (size_t i =...
a.cc: In function 'int main()': a.cc:11:5: error: 'ui' was not declared in this scope 11 | ui n, c, k; | ^~ a.cc:12:12: error: 'n' was not declared in this scope 12 | cin >> n >> c >> k; | ^ a.cc:12:17: error: 'c' was not declared in this scope 12 | cin >> n >> c >> k; ...
s845398555
p03785
Java
import java.util.Scanner; public class AtCoder_GrandContest11_1 { static int N; static long C, K; static long[] T; public static void main(String[] args) { Scanner in = new Scanner(System.in); N = Integer.valueOf(in.nextInt()); // Number of passengers C = Long.valueOf(in.nextLong()); // Size of bus K = L...
Main.java:3: error: class AtCoder_GrandContest11_1 is public, should be declared in a file named AtCoder_GrandContest11_1.java public class AtCoder_GrandContest11_1 { ^ 1 error
s846179023
p03785
C++
#include <iostream> #include <stdlib.h> #include <utility> using namespace std; const int MaxN=100003; int n,c,k,res=0,nnx=0,nny=0,idx[MaxN],idy[MaxN],trx[8*MaxN],trey[8*MaxN]; bool dau[MaxN]; struct ta{ int x,y;}; ta a[MaxN]; ta b[2*MaxN]; void upx(int i){ if (idx[i]==0){ nnx++; idx[i]=nnx; ...
a.cc:105:1: error: '::main' must return 'int' 105 | void main(){ | ^~~~
s292682879
p03785
C++
#include <iostream> #include <stdlib.h> #include <utility> using namespace std; const int MaxN=100003; int n,c,k,res=0,nnx=0,nny=0,idx[MaxN],idy[MaxN]; bool dau[MaxN]; struct ta{ int x,y;}; ta a[MaxN]; ta b[2*MaxN],trx[8*MaxN],trey[8*MaxN]; void upx(int i){ if (idx[i]==0){ nnx++; idx[i]=nnx; ...
a.cc: In function 'void upx(int)': a.cc:16:18: error: no match for 'operator=' (operand types are 'ta' and 'int') 16 | trx[nnx]=i; | ^ a.cc:8:8: note: candidate: 'constexpr ta& ta::operator=(const ta&)' 8 | struct ta{ int x,y;}; | ^~ a.cc:8:8: note: no known conversi...
s979610134
p03785
C++
#include <iostream> #include <stdlib.h> #include <utility> using namespace std; const int MaxN=100003; int n,c,k,res=0,nnx=0,nny=0; bool dau[MaxN]; struct ta{ int x,y;}; ta a[MaxN]; ta b[2*MaxN],trx[8*MaxN],idx[MaxN],idy[MaxN],trey[8*MaxN]; void upx(int i){ if (idx[i]==0){ nnx++; idx[i]=nnx; ...
a.cc: In function 'void upx(int)': a.cc:13:15: error: no match for 'operator==' (operand types are 'ta' and 'int') 13 | if (idx[i]==0){ | ~~~~~~^~~ | | | | ta int In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/io...
s804201491
p03785
C++
#pragma comment(linker, "/STACK:1000000000") #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <queue> #include <deque> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <bitse...
a.cc: In function 'int main()': a.cc:47:24: error: no matching function for call to 'min(int, long int)' 47 | p = min(p + c, upper_bound(a, a + n, a[p] + k) - a); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, ...
s795929913
p03785
C
#include<stdio.h> int N,C,K,M; int T[100001]; int i,j,k,ans=0,max; int array[100001]; int can_ride(int Time); int main(void){ scanf("%d %d %d",&N,&C,&K); for(i=0;i<N;i++){ scanf("%d",&T[i]); } //puts("data seted."); //printf("%d\n",can_ride(4)); //printf("%d\n",array[0]); if(C<N){ while(C){ ...
main.c: In function 'main': main.c:43:6: error: expected ';' before 'while' 43 | M=N | ^ | ; 44 | while(M){ | ~~~~~
s304517349
p03785
C
#include<stdio.h> #include<stdlib.h> int int_sort(const void * a, const void * b) { return *(long int*)a - *(long int*)b; } int main() { long int N, C, K; long int *T; long int nBus; long int i,j; scanf("%d %d %d",&N,&C,&K); T = (long int *)malloc(sizeof(long int)*N); for (i = 0; i < N; i++) { scanf("%d"...
main.c: In function 'main': main.c:34:9: error: unknown type name 'prlong'; did you mean 'ulong'? 34 | prlong intf("%d\n", nBus); | ^~~~~~ | ulong main.c:34:21: error: expected declaration specifiers or '...' before string constant 34 | prlong intf("%d\n", nBus); ...
s632320126
p03785
C++
#include <stdio.h> int N; long long int C, K; long long int T[100001]; long long int a = 1; long long int b; long long int ans=0; bool flag; int main() { scanf_s("%d %lld %lld", &N, &C, &K); for (int i = 1; i <= N; i++) { scanf_s("%lld", &T[i]); } for (int i = 1; i <= N; i++) { for (int j = i + 1; j <= N; j+...
a.cc: In function 'int main()': a.cc:13:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 13 | scanf_s("%d %lld %lld", &N, &C, &K); | ^~~~~~~ | scanf
s002239235
p03785
C
#include<stdio.h> #include<stdlib.h> int main() { int N,C,K,B,P,s,F; int *T int i,j; scanf("%d %d %d",&N,&C,&K); T = (int *)malloc(N * sizeof(int)); B=0; P=0; for(i=0;i<N;i++){ scanf("%d",&T[i]); } for(i=0;i<N;i++){ for(j=N-1;j>i;j--){ if(T[j]<T[j-1]){ s=T[j]; T[j]=T[j-1]; T[j-1]=s; } } } F=T[0]; for(i=0;i<N;i++)...
main.c: In function 'main': main.c:7:7: error: expected ';' before 'int' 7 | int *T | ^ | ; 8 | int i,j; | ~~~ main.c:11:1: error: 'T' undeclared (first use in this function) 11 | T = (int *)malloc(N * sizeof(int)); | ^ main.c:11:1: note: each undeclared identifier is ...
s650135526
p03785
Java
import java.io.*; import java.util.*; import java.math.*; class Main { InputStream is; PrintWriter out; boolean possible(int[] A , int [] B , int x) { long current = A[x]; boolean f = true; int lim = (int)(1e9); for(int i = 1;i < A.length;i++) { if (B[i] == A[x...
Main.java:50: error: cannot find symbol Solution play = new Solution(); ^ symbol: class Solution location: class Main Main.java:50: error: cannot find symbol Solution play = new Solution(); ^ symbol: class Solution location: class Main 2 errors
s620816701
p03785
Java
public class Main { public static void main(String args[]){ Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int C = scan.nextInt(); int K = scan.nextInt(); int tempT = 0; int tempC = 0; int tempB = 0; int Ti = 0; Ti = scan.nextInt(); tempT = Ti + K; tempC = 1; tempB = 1; while ...
Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s829208395
p03785
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = Integer.valueOf(in.nextInt()); // Number of passengers long C = Long.valueOf(in.nextLong()); // Size of bus long K = Long.valueOf(in.nextLong()); // Max wait time long[] T = ne...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s485726467
p03785
C++
import java.util.Scanner; public class AtCoder_GrandContest11_1 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = Integer.valueOf(in.nextInt()); // Number of passengers long C = Long.valueOf(in.nextLong()); // Size of bus long K = Long.valueOf(in.nextLong()); // Max wait ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class AtCoder_GrandContest11_1 { | ^~~~~~
s397537455
p03785
Java
public class Main { public static void main(String args[]){ Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int C = scan.nextInt(); int K = scan.nextInt(); int tempT = 0; int tempC = 0; int tempB = 0; int Ti = 0; while (scan.hasNext()) { Ti = scan.nextInt(); if (tempC < C && Ti <...
Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s162164540
p03785
C
#include<stdio.h> #include<stdlib.h> int main() { int N,C,K,B,P,S,F; int *T; int i,j; scanf("%d %d %d",&N,&C,&K); T = (int *)malloc(N * sizeof(int)); B=0; for(i=0;i<N;i++){ scanf("%d",&T[i]); } for(i=0;i<N;i++){ for(j=N-1;j>i;j--){ if(T[j]<T[j-1]){ s=T[j]; T[j]=T[j-1]; T[j-1]=s; } } } F=T[0]; for(i=0;i<N;i++){ if...
main.c: In function 'main': main.c:22:1: error: 's' undeclared (first use in this function) 22 | s=T[j]; | ^ main.c:22:1: note: each undeclared identifier is reported only once for each function it appears in
s517383028
p03785
C++
#include<stdio.h> #include<stdlib.h> #include<algorithm> /* ソート関数 */ int int_sort(const void * a, const void * b) { /* 引数はvoid*型と規定されているのでint型にcastする */ if (*(int *)a < *(int *)b) { return -1; } else if (*(int *)a == *(int *)b) { return 0; } return 1; } int main() { int N, C, K; int *T; int nBus; in...
a.cc: In function 'int main()': a.cc:29:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 29 | scanf_s("%d", &T[i]); | ^~~~~~~ | scanf
s797672699
p03785
C++
#include<stdio.h> #include<stdlib.h> #include<algorithm> /* ソート関数 */ int int_sort(const void * a, const void * b) { /* 引数はvoid*型と規定されているのでint型にcastする */ if (*(int *)a < *(int *)b) { return -1; } else if (*(int *)a == *(int *)b) { return 0; } return 1; } int main() { int N, C, K; int *T; int nBus; in...
a.cc: In function 'int main()': a.cc:29:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 29 | scanf_s("%d", &T[i]); | ^~~~~~~ | scanf
s851316233
p03785
C++
#include<stdio.h> #include<stdlib.h> #include<algorithm> /* ソート関数 */ int int_sort(const void * a, const void * b) { /* 引数はvoid*型と規定されているのでint型にcastする */ if (*(int *)a < *(int *)b) { return -1; } else if (*(int *)a == *(int *)b) { return 0; } return 1; } int main() { int N, C, K; int *T; int nBus; in...
a.cc: In function 'int main()': a.cc:24:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 24 | scanf_s("%d %d %d",&N,&C,&K); | ^~~~~~~ | scanf
s200501024
p03785
C++
// ConsoleApplication2.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include <iostream> #include <algorithm> int n, c, k, t[100005], tf, ans, cnt; int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); std::cin >> n >> c >> k; for (int i = 0; i < n; ++i) std::cin >> t[i]; std::sort(t,...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s397782457
p03785
Java
mport java.util.Arrays; import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int C = sc.nextInt(); int K = sc.nextInt(); int[] T = new int[N]; ...
Main.java:1: error: class, interface, enum, or record expected mport java.util.Arrays; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.Scanner; ^ 2 errors
s088281690
p03785
Java
public class Main { private static int solve(int n, int c, int k, int[] ts) { int count = 0; int r = 0; int maxT = -1; for (int t : ts) { if (maxT == -1) { maxT = t + k; } if (maxT >= t && count < c) { count++; ...
Main.java:27: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:27: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:35: e...
s141587418
p03785
C++
#include <iostream> #include <sstream> #include <algorithm> #include <numeric> #include <functional> #include <iterator> #include <bitset> #include <string> #include <list> #include <vector> #include <stack> #include <queue> #include <set> #include <map> typedef signed long long int slli; typedef unsigned long long ...
a.cc: In function 'int main()': a.cc:61:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<unsigned int>') 61 | std::cerr << T << std::endl; | ~~~~~~~~~ ^~ ~ | | | | | std::vector<unsigned int> ...
s272168982
p03785
C++
#include <bits\stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); long long n, c, k; cin >> n >> c >> k; vector<long long> t(n); for (auto &a : t) { cin >> a; } sort(t.begin(), t.end()); int ans = 1; int time = t[0] + k; int count = 1; for (long long i = 0; i < n;...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s441025310
p03785
C++
#include "bits\stdc++.h" using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); long long n, c, k; cin >> n >> c >> k; vector<long long> t(n); for (auto &a : t) { cin >> a; } sort(t.begin(), t.end()); int ans = 1; int time = t[0] + k; int count = 1; for (long long i = 0; i < n;...
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory 1 | #include "bits\stdc++.h" | ^~~~~~~~~~~~~~~ compilation terminated.
s567289558
p03785
C++
N,C,K = map(int,input().split()) A = [] for n in range(N): a = int(input()) A.append(a) A.sort() b = 0 for a in A: if b == 0: b = 1 c = 1 t = a elif c >= C: b = b + 1 c = 1 t = a elif a <= t + K and c < C: c = c + 1 elif a > t + K: b = b + 1 c = 1 t = a print(b)
a.cc:1:1: error: 'N' does not name a type 1 | N,C,K = map(int,input().split()) | ^
s145070760
p03785
C++
n,c,k = map(int, input().split()) t = [] for i in range(n): t.append(int(input())) t.sort() ni,nt,ans = 0,0,0 while 1: if ni >= n: break nt = t[ni] for i in range(1,c+1): if ni+i<n and t[ni+i] < nt + k: ni += 1 else: break ni += 1 ans += 1 print(a...
a.cc:1:1: error: 'n' does not name a type 1 | n,c,k = map(int, input().split()) | ^
s088091901
p03785
Java
import java.util.*; public class A{ static Scanner s = new Scanner(System.in); public static void main(String[] args) { int n=s.nextInt(),c=s.nextInt(),k=s.nextInt(); boolean[] t = new boolean[1000001]; for(int i=0;i<n;i++) t[s.nextInt()]=true; int result=0,bus; for(int i=0;i<t.length;i++) { if(t[i]) { ...
Main.java:2: error: class A is public, should be declared in a file named A.java public class A{ ^ 1 error
s148925121
p03785
C++
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <set> using namespace std; const int MAXN=200001; int arr[MAXN]; int main(){ set<int> st; int n,c,k; cin>>n>>c>>k; for(int i=1;i<=n;i++)cin>>arr[i]; sort(arr+1,arr+n+1); int ret=0; for(int i=1;i<=n;i++){ ...
a.cc: In function 'int main()': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(arr+1,arr+n+1); | ^~~~ | short
s963585559
p03785
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n, c, k; cin >> n >> c >> k; vector<int> v(n); for (int i = 0; i < n; ++i) { cin >> v[i]; } sort(v.begin(), v.end()); int j = 0; int ans = 0; for (int i = 0; i < n; ++i) { if (i - j + 1 >...
a.cc: In function 'int main()': a.cc:10:5: error: 'vector' was not declared in this scope 10 | vector<int> v(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 | ...
s623271966
p03785
C++
// // main.cpp // A // // Created by 黄宇凡 on 2017/3/12. // Copyright © 2017年 黄宇凡. All rights reserved. // #include <iostream> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int maxn = 1e5 + 5; long long T[maxn]; long long K,C; int n; int main(int argc, const char * argv[]) {...
a.cc: In function 'int main(int, const char**)': a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'short'? 30 | sort(T + 1,T + 1 + n); | ^~~~ | short
s641795416
p03785
C++
#include<iostream> #include<cstdio> #include<string> #include<algorithm> #include<vector> #include<list> #include<map> #include<set> #include<unordered_map> #include<unordered_set> using namespace std; int d[100000]; signed main() { int a, b, c; scanf("%d%d%d", &a, &b, &c); for (int e = 0; e < a; e++) { scanf("%d"...
a.cc: In function 'int main()': a.cc:20:40: error: 'INT_MIN' was not declared in this scope 20 | int sum = 0, hito = 0, hazime =INT_MIN; | ^~~~~~~ a.cc:11:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' ...
s951960385
p03785
C++
use std::io::{self, Stdin}; use std::str::{self, FromStr}; use std::error::Error; fn exec() { let mut sc = Scanner::new(); let (n, c, k): (usize, usize, i64) = (sc.ne(), sc.ne(), sc.ne()); let mut t: Vec<i64> = (0..n).map(|_| sc.ne()).collect(); t.sort(); let mut ans = 0; let mut cnt = 0; l...
a.cc:8:28: error: too many decimal points in number 8 | let mut t: Vec<i64> = (0..n).map(|_| sc.ne()).collect(); | ^~~~ a.cc:13:14: error: too many decimal points in number 13 | for i in 0..n { | ^~~~ a.cc:41:2: error: invalid preprocessing directive #[...
s189934489
p03785
C++
//#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; ll n,c,k,a[111111],cnt,last,ans; int main() { cin>>n>>c>>k; for(ll i=1;i<=n;i++) scanf("%lld",&a[i]); sort(a+1,a+n+1); for(ll i=1;i<=n;i++) { if(cnt==0||a[i]-last>k) cnt=c,last=a[i],ans++; cnt--; } cout<<ans; }
a.cc: In function 'int main()': a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(a+1,a+n+1); | ^~~~ | short
s502959418
p03786
C++
#include <bits/stdc++.h> using namespace std; #include <math.h> #include <iomanip> template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const int64_t INF=1e18+1; const int mod = 100000000...
a.cc: In function 'int main()': a.cc:19:7: error: no match for 'operator=' (operand types are 'std::vector<long int>' and 'std::vector<int>') 19 | sum=A; | ^ In file included from /usr/include/c++/14/vector:72, from /usr/include/c++/14/functional:64, from /usr/include/...
s877727250
p03786
C++
#include <its//stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long int ll; int main() { int n,cnt = 0; cin >> n; vector<int> a(n); rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); ll sum = 0; rep(i, n - 1) { sum += a[i]; if (sum * 2 < a[i + 1]) cnt = i+1; }cou...
a.cc:1:10: fatal error: its//stdc++.h: No such file or directory 1 | #include <its//stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s051037864
p03786
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> #include <queue> #include <deque> #include <list> #include <set> #include <functional> #include <cmath> #include <numeric> #include <iomanip> #define REP(i,n) for(lint i{}, i##_len=(n); i<i##_len; ++i) #define DREP(i, h, j, w) f...
a.cc: In function 'int main()': a.cc:144:16: error: expected ';' before '}' token 144 | ++c | ^ | ; 145 | } | ~
s782077723
p03786
C++
#include<bits/stdc++.h> #include<atcoder/all> using namespace std; using namespace atcoder; /******* All Required define Pre-Processors and typedef Constants *******/ #define rep(i,n) for(int i=0; i<(n); ++i) #define rep2(i,a,b) for(int i=a; i<=(b); ++i) #define rep3(i,a,b) for(int i=a; i>=(b); --i) #define all(cont) ...
a.cc:2:9: fatal error: atcoder/all: No such file or directory 2 | #include<atcoder/all> | ^~~~~~~~~~~~~ compilation terminated.
s027755447
p03786
Java
import java.util.*; import java.io.*; import java.math.*; public class Main{ //Don't have to see. start------------------------------------------ static class InputIterator{ ArrayList<String> inputLine = new ArrayList<String>(1024); int index = 0; int max; String read; InputIterator(){ BufferedReader br = ne...
Main.java:78: error: array required, but ArrayList<Integer> found sumlist[i] = list[i]; ^ Main.java:84: error: array required, but ArrayList<Integer> found if(sumlist[i] * 2 >= list[i + 1]){ ^ Note: Main.java uses unchecked or unsafe operations. Note: Recompile with...
s955144373
p03786
C++
#include<bits/stdc++.h> using namespace std; inline int read(){ int res=0; char c; bool zf=0; while(((c=getchar())<'0'||c>'9')&&c!= '-'); if(c=='-')zf=1; else res=c-'0'; while((c=getchar())>='0'&&c<='9')res=(res<<3)+(res<<1)+c-'0'; if(zf)return -res; return res; } int data[100005]; s...
a.cc: In function 'int main()': a.cc:17:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 17 | for(register int i=1;i<=n;i++){ | ^ a.cc:18:17: error: reference to 'data' is ambiguous 18 | data[i]=read(); | ...
s627005950
p03786
C++
#include<bits/stdc++.h> using namespace std; inline int read(){ int res=0; char c; bool zf=0; while(((c=getchar())<'0'||c>'9')&&c!= '-'); if(c=='-')zf=1; else res=c-'0'; while((c=getchar())>='0'&&c<='9')res=(res<<3)+(res<<1)+c-'0'; if(zf)return -res; return res; } int data[100005]; s...
a.cc: In function 'int main()': a.cc:17:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 17 | for(register int i=1;i<=n;i++){ | ^ a.cc:18:17: error: reference to 'data' is ambiguous 18 | data[i]=read(); | ...
s863043423
p03786
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) typedef long long ll; typedef pair<int, int> P; const int INF = 100100100; const int MOD = (int)1e9 + 7; const double EPS = 1e-9; struct Edge { ll to; ll cost;b }; ...
a.cc:12:11: error: 'b' does not name a type 12 | ll cost;b | ^
s367965984
p03786
C++
#include <bits/stdc++.h> #解説みた。 using namespace std; typedef long long ll; #define MOD (long long)(1e9+7) #define INF (1LL<<60) #define rep(i,n) for(ll i = 0; i < (n); i++) #define rep1(i,n) for(ll i = 1; i <= (n); i++) template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } ...
a.cc:2:2: error: extended character 。 is not valid in an identifier 2 | #解説みた。 | ^ a.cc:2:2: error: invalid preprocessing directive #\U000089e3\U00008aac\U0000307f\U0000305f\U00003002 2 | #解説みた。 | ^~~~~~~~~~
s298569062
p03786
C++
#include <string> #include <memory> #include <vector> #include <iostream> #include <set> #include <algorithm> using namespace std; int main() { std::ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; std::vector<int> v(n); std::vector<int64_t> mxs; for (auto& el : v) { cin >> el; } st...
a.cc: In function 'int main()': a.cc:26:22: error: no matching function for call to 'max(int64_t, long long int)' 26 | mxs.push_back(max((el - 2 * cur_sum + 1) / 2, 0LL)); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from a.c...
s552266120
p03786
C++
using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define INF 1000000000000000000 int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<ll> A(N); map<ll, ll> ma; rep(i, N) { cin >> A[...
a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope 8 | cin.tie(0); | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:9:5: error: '...
s284148139
p03786
C++
#include <bits/stdc++.h> using namespace std; //long long using ll = long long; // pair<int, int> using PII = pair<int, int>; //最大値、mod const int MOD = 1000000007; const int mod = 1000000007; const int INF = 1000000000; const long long LINF = 1e18; const int MAX = 510000; //出力系 #define print(x) cout << x << e...
a.cc: In function 'int main()': a.cc:243:20: error: expected ';' before 'vector' 243 | int n; cin >> n | ^ | ; 244 | vector<int>a(n); | ~~~~~~ a.cc:245:22: error: 'a' was not declared in this scope 245 | REP(i, n) cin >> a[i]; ...
s355378830
p03786
C++
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG int64_t MOD=1000000007; int main() { int64_t N; cin>>N; vector<int64_t> S(N); for(int i=0;i<N;i++) cin>>S.at(i); sort(S.begin(),S.end()); int64_t total=S.at(0); for(int i=1;i<N;i++){ if(2*total<S.at(i)) S.at(i-1)=0; total+=S.at(...
a.cc: In function 'int main()': a.cc:22:13: error: expected '}' at end of input 22 | cout<<ans; | ^ a.cc:6:12: note: to match this '{' 6 | int main() { | ^
s801492328
p03786
C++
#include <iostream> #include <vector> #include <queue> using namespace std; vector<long long> a; int main(int argc, char* argv[]) { int N; cin >> N; a.resize(N); vector<long long> indices(N); for (int i = 0; i < N; ++i) { cin >> a[i]; indices[i] = i; } sort(a.begin(), a.end()); long long r...
a.cc: In function 'int main(int, char**)': a.cc:20:3: error: 'sort' was not declared in this scope; did you mean 'short'? 20 | sort(a.begin(), a.end()); | ^~~~ | short
s296792928
p03786
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int64_t>A(N); for(int i=0;i<N;i++) cin>>A.at(i); sort(A.begin(),A.end()); int left=-1; int right=N; while(1<right-left){ int mid=left+(right-left)/2; int64_t sum=0; for(int i=0;i<=mid;i++) sum+=A.at(i); b...
a.cc: In function 'int main()': a.cc:25:14: error: 'mid' was not declared in this scope 25 | }int ans=N-mid; | ^~~
s384979950
p03786
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int n;cin>>n; vector<long long>A(n); vector<long long>B(n+2); for(int i = 0; n > i; i++){ cin>>A[i]; } sort(A.begin(),A.end()); B[0] = 0; for(int i = 0; n > i; i++){ B[i+1] = B[i]+A[i]; } B[n+1] = 0; for(int i = 1; n...
a.cc: In function 'int main()': a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<long long>A(n); | ^~~~~~ a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 2 | #include <algorithm> +++ |+#include <vector> 3 | ...
s283320271
p03786
C
#include <bits/stdc++.h> using ll = long long; using namespace std; ll GCD(ll a, ll b){ return a ? GCD(b % a, a) : b; } int main(){ int n; cin>>n; vector<ll> a(n); for(int i=0; i<n; i++) cin>>a[i]; sort(a.begin(),a.end()); vector<ll> sum(n+1); sum[0]=0; for(int i=0; i<n; i++) sum[i+1] = ...
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s598582678
p03786
C++
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") #define all(x) (x).begin(),(x).end() #define rep(i, n) for(int (i) = 0; i < (n); i++) #define REP(i, m, n) for(int (i) = (m); (i) < (n); (i)++) #define INF LLONG_MAX - 10 #define MOD 1000000007 #define fcout cout << fixed << setprecision(15) #d...
a.cc: In function 'int main()': a.cc:32:5: error: 'itn' was not declared in this scope; did you mean 'int'? 32 | itn n; | ^~~ | int a.cc:33:12: error: 'n' was not declared in this scope; did you mean 'yn'? 33 | cin >> n; | ^ | yn a.cc:35:22: error: 'a'...
s701817357
p03786
C++
n = int(input()) a = [ int(x) for x in input().split() ] a.sort() t = 0 s = 0 for k, v in enumerate(a): s += v if k+1 < n and s*2 < a[k+1]: t = k+1 print(n-t)
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^