submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s257616748
p03784
C++
#i #d us in } in in } vo } in in }
a.cc:1:2: error: invalid preprocessing directive #i; did you mean #if? 1 | #i | ^ | if a.cc:2:2: error: invalid preprocessing directive #d 2 | #d | ^ a.cc:3:1: error: 'us' does not name a type 3 | us | ^~ a.cc:8:1: error: expected declaration before '}' token 8 | } | ^ a...
s946455412
p03784
C++
v#include <iostream> #include <sstream> #include <fstream> #include <string> #include <vector> #include <deque> #include <queue> #include <stack> #include <set> #include <map> #include <algorithm> #include <functional> #include <utility> #include <bitset> #include <cmath> #include <cstdlib> #include <ctime> #include <c...
a.cc:1:2: error: stray '#' in program 1 | v#include <iostream> | ^ a.cc:1:1: error: 'v' does not name a type; did you mean 'vi'? 1 | v#include <iostream> | ^ | vi In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/...
s408900813
p03784
C++
#include <iostream> #include <cstring> #include <cstdio> #include <vector> #include <set> #include <map> #include <queue> #include <algorithm> #include <stack> #include <cctype> #include <cmath> #include <vector> #include <sstream> #include <bitset> #include <deque> #include <iomanip> using namespace std; #define pr(x)...
a.cc:122:11: error: redefinition of 'const int MOD' 122 | const int MOD = 1e9 + 7; | ^~~ a.cc:30:11: note: 'const int MOD' previously defined here 30 | const int MOD = 1e9 + 7; | ^~~ a.cc:123:11: error: redefinition of 'const int inf' 123 | const int inf = 0x3f3f3f3f; | ...
s067227853
p03784
C++
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
a.cc: In function 'void solve()': a.cc:42:17: error: 'else' without a previous 'if' 42 | else { | ^~~~ a.cc:45:35: error: break statement not within loop or switch 45 | if(path.size()>B) break; | ^~~~~ a.cc: At global sc...
s866269848
p03784
C++
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <functional> #include <queue> #include <map> #include <set> #include <string> using namespace std; typedef long long int ll; typedef pair <int,int> P; char str[5]; int main() { int A,B; scanf("%d %d",&A,&B); if...
a.cc:83:6: error: redefinition of 'char str [5]' 83 | char str[5]; | ^~~ a.cc:16:6: note: 'char str [5]' previously declared here 16 | char str[5]; | ^~~ a.cc:85:5: error: redefinition of 'int main()' 85 | int main() | ^~~~ a.cc:18:5: note: 'int main()' previously defined here ...
s504566644
p03784
C++
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
a.cc: In function 'int ask(int, int)': a.cc:21:15: error: too few arguments to function 'int fflush(FILE*)' 21 | fflush(); | ~~~~~~^~ In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c+...
s422716867
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, C, K; cin >> N >> C >> K; vector<int> T(N); for(int i = 0; i < N; i++){ cin >> T.at(i); } sort(T.start(), T.end()); int res = 0; for(int i = 0; i < N){ res++; int start = i; while(i < N && T[i] - T[start] <= K && i ...
a.cc: In function 'int main()': a.cc:13:10: error: 'class std::vector<int>' has no member named 'start' 13 | sort(T.start(), T.end()); | ^~~~~ a.cc:15:23: error: expected ';' before ')' token 15 | for(int i = 0; i < N){ | ^ | ;
s784863407
p03785
C++
//コンパイラ最適化用 #pragma GCC optimize("Ofast") #define _GLIBCXX_DEBUG //インクルード(アルファベット順) #include<algorithm>//sort,二分探索,など #include<bitset>//固定長bit集合 #include<chrono>//実行時間計測 #include<cmath>//pow,logなど #include<complex>//複素数 #include<deque>//両端アクセスのキュー #include<functional>//sortのgreater #include<iomanip>//setprecision(浮動小数点...
a.cc: In function 'int main()': a.cc:93:21: error: 't' was not declared in this scope 93 | if(T[i]+K < t[j]){ | ^
s595199256
p03785
C++
//コンパイラ最適化用 #pragma GCC optimize("Ofast") #define _GLIBCXX_DEBUG //インクルード(アルファベット順) #include<algorithm>//sort,二分探索,など #include<bitset>//固定長bit集合 #include<chrono>//実行時間計測 #include<cmath>//pow,logなど #include<complex>//複素数 #include<deque>//両端アクセスのキュー #include<functional>//sortのgreater #include<iomanip>//setprecision(浮動小数点...
a.cc: In function 'int main()': a.cc:93:17: error: 'k' was not declared in this scope 93 | if(T[i]+k < t[j]){ | ^ a.cc:93:21: error: 't' was not declared in this scope 93 | if(T[i]+k < t[j]){ | ^
s008759964
p03785
C++
//コンパイラ最適化用 #pragma GCC optimize("Ofast") #define _GLIBCXX_DEBUG //インクルード(アルファベット順) #include<algorithm>//sort,二分探索,など #include<bitset>//固定長bit集合 #include<chrono>//実行時間計測 #include<cmath>//pow,logなど #include<complex>//複素数 #include<deque>//両端アクセスのキュー #include<functional>//sortのgreater #include<iomanip>//setprecision(浮動小数点...
a.cc: In function 'int main()': a.cc:92:24: error: expected ')' before ';' token 92 | if(int j =i+1;j<N;j++){ | ~ ^ | ) a.cc:92:25: error: 'j' was not declared in this scope 92 | if(int j =i+1;j<N;j++){ | ^
s386453323
p03785
C++
#include <bits/stdc++.h> using namespace std; main(){ 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()); int ans=0; for(int i = 0; i<n;){ ans++; int j = i; while(i-j<c && t[i]-t[j]<=k && i<n){ i++; } } cout << bus << endl; retu...
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:15:11: error: 'bus' was not declared in this scope 15 | cout << bus << endl; | ^~~
s937008740
p03785
C++
#nclude <bits/stdc++.h> using namespace std; int main(){ 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 bus=0; for(int i=0;i<n;){ for(int j=i+c;j<=i;j--){ if(t[i]+k>=t[j-1]){ i+=j+1; bus++; break; } } } cout << bus << endl; }
a.cc:1:2: error: invalid preprocessing directive #nclude; did you mean #include? 1 | #nclude <bits/stdc++.h> | ^~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> n >> c >> k; | ^~~ a.cc:1:1: note: 'std::cin' is defined in hea...
s564273189
p03785
C++
#nclude <bits/stdc++.h> using namespace std; int main(){ int n,c,k; cin >> n >> c >> k; int d[n]; for(int i =0;i<n;i++) cin >> t[i]; sort(t,t+n); int bus=0; for(int i=0;i<n;){ for(int j=i+c;j<=i;j--){ if(t[i]+k>=t[j-1]){ i+=j+1; bus++; break; } } } cout << bus << endl; }
a.cc:1:2: error: invalid preprocessing directive #nclude; did you mean #include? 1 | #nclude <bits/stdc++.h> | ^~~~~~ | include a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin >> n >> c >> k; | ^~~ a.cc:1:1: note: 'std::cin' is defined in hea...
s514450449
p03785
C++
// g++ .cpp && ./a.out #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef pair<int, int> p; typedef long long ll; const int mod = 1000000007; const int inf = 1000000007; int main() { int n, c, k; cin >> n >> c >> k; vector<int> t(n); rep(i, n) cin >> t[i]; ...
a.cc: In function 'int main()': a.cc:24:20: error: expected ';' before ':' token 24 | mx = t[i] + k: | ^ | ; a.cc:26:12: error: expected ';' before ':' token 26 | num++: | ^ | ;
s350545380
p03785
C++
// g++ .cpp && ./a.out #include <bits/stdc++.h> #define rep(i, n) for (ll i = 1; i < (n); ++i) using namespace std; typedef pair<int, int> p; typedef long long ll; const int mod = 1000000007; const int inf = 1000000007; int main() { int n, c, k; cin >> n >> c >> k; vector<int> t(n); rep(i, n) cin >> t[i]; ...
a.cc: In function 'int main()': a.cc:24:20: error: expected ';' before ':' token 24 | mx = t[i] + k: | ^ | ; a.cc:26:12: error: expected ';' before ':' token 26 | num++: | ^ | ;
s591128378
p03785
C++
#define rep(i,n) for (int i=0; i<(int)(n); i++) #define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, c, k; cin >> n >> c >> k; priority_queue<int, vector<int>, greater<int>> arrival; priority_queue<int, vector<int>, greater<in...
a.cc:5:11: error: 'pair' does not name a type 5 | using P = pair<int, int>; | ^~~~ a.cc: In function 'int main()': a.cc:8:16: error: 'cin' was not declared in this scope 8 | int n, c, k; cin >> n >> c >> k; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'...
s776093202
p03785
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int N, C, K, T[100001], b_cnt=1, p_cnt=1, tmp=0; cin >> N >> C >> K; for(int i=0; i<N; i++){ cin >> T[i]; } sort(T, T+N); tnmp = T[0]; for(int i=1; i<N; i++){ if(tmp+K < T[i] || p_cnt >= C){ if(i != N-1) b_cnt++; ...
a.cc: In function 'int main()': a.cc:12:3: error: 'tnmp' was not declared in this scope; did you mean 'tmp'? 12 | tnmp = T[0]; | ^~~~ | tmp
s361999813
p03785
C++
#include<iostream> using namespace std; int main(){ int N, C, K, T[100001], b_cnt=1, p_cnt=1, tmp=0; cin >> N >> C >> K; for(int i=0; i<N; i++){ cin >> T[i]; } tmp = T[0]; sort(T, T+N); for(int i=1; i<N; i++){ p_cnt++; if(tmp+K < T[i] || p_cnt >= C){ b_cnt++; p_cnt=1; tmp=T[...
a.cc: In function 'int main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(T, T+N); | ^~~~ | short
s833772483
p03785
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<n; i++) #define all(vec) vec.begin(),vec.end() int main() { int N,C,K; cin >> N >> C >> K; vector<int> T(N); rep(i,N) cin >> T.at(i); sort(all(T)); int bus = 1; int psng = 0; int bustime = T.at(0)+ K; //1台目の時間6 reo(i,N){ ...
a.cc: In function 'int main()': a.cc:14:7: error: 'i' was not declared in this scope 14 | reo(i,N){ | ^ a.cc:14:3: error: 'reo' was not declared in this scope; did you mean 'rep'? 14 | reo(i,N){ | ^~~ | rep
s431604656
p03785
C++
# include <iostream> # include <vector> # include <algorithm> using namespace std; # define ll long long int main(){ int n, capacity, late; cin >> n >> capacity >> late; int time[100005]; for(int i=0; i<N; i++) cin >> time[i]; sort(time, time+N); int ans = 1, currentCap = 1, firstPerson = time[0];...
a.cc: In function 'int main()': a.cc:14:18: error: 'N' was not declared in this scope 14 | for(int i=0; i<N; i++) cin >> time[i]; | ^ a.cc:15:19: error: 'N' was not declared in this scope 15 | sort(time, time+N); | ^
s545825431
p03785
C++
# include <iostream> # include <vector> # include <algorithm> using namespace std; # define ll long long int main(){ int N, capacity, late; cin >> N >> capacity >> late; int time[100005]; for(int i=0; i<N; i++) cin >> time[i]; sort(time, time+N); int ans = 1, currentCap = 1, firstPerson = time[0];...
a.cc: In function 'int main()': a.cc:18:18: error: 'n' was not declared in this scope 18 | for(int i=1; i<n; i++){ | ^
s915151852
p03785
C++
#include <string> #include <memory> #include <vector> #include <iostream> #include <set> using namespace std; int main() { std::ios_base::sync_with_stdio(0); cin.tie(0); int n, c, k; cin >> n >> c >> k; std::vector<int> v(n); for (auto& el : v) { cin >> el; } sort(v.begin(), v.end()); int cur ...
a.cc: In function 'int main()': a.cc:20:3: error: 'sort' was not declared in this scope; did you mean 'short'? 20 | sort(v.begin(), v.end()); | ^~~~ | short
s094267051
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,C,K; cin >> N >> C >> K; vector<int>data(N); for(int i=0;i<N;i++){ cin >> data.at(i); } sort(data.begin(),data.end()); int count=0; pair<int,int>start; start.first=-1; for(int i=0;i<N;i++){ if(start.first>=data.at(i)&&i-start....
a.cc: In function 'int main()': a.cc:20:7: error: 'startfirst' was not declared in this scope 20 | startfirst=data.at(i); | ^~~~~~~~~~
s734563826
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,C,K; cin >> N >> C >> K; vector<int>data(N); for(int i=0;i<N;i++){ cin >> data.at(i); } sort(data.begin(),data.end()); int count=0; pair<int,int>start; start.first=-1; for(int i=0;i<N;i++){ if(start.first>=data.at(i)&&i-start....
a.cc: In function 'int main()': a.cc:20:11: error: expected unqualified-id before '.' token 20 | pair.first=data.at(i); | ^ a.cc:21:11: error: expected unqualified-id before '.' token 21 | pair.second=i; | ^
s675075480
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,C,K; cin >> N >> C >> K; vector<int>data(N); for(int i=0;i<N;i++){ cin >> data.at(i); } sort(data.begin(),data.end()); int count=0; pair<int,int>start; start.first=-1 for(int i=0;i<N;i++){ if(start.first>=data.at(i)&&i-start.s...
a.cc: In function 'int main()': a.cc:14:17: error: expected ';' before 'for' 14 | start.first=-1 | ^ | ; 15 | for(int i=0;i<N;i++){ | ~~~ a.cc:15:15: error: 'i' was not declared in this scope 15 | for(int i=0;i<N;i++){ | ...
s866251374
p03785
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int main(){ 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()); int res=0,j; for(int i=0;i<N;){ res++; j=i; while(i<N && T[i]-T[j] && i-j<C)i++; } cout << r...
a.cc: In function 'int main()': a.cc:10:28: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 10 | for(int i=0; i<N;++i)cin >> T[i]; | ~~~ ^~ ~~~~ | | | | ...
s542365734
p03785
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ 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); reverse(T,T+N); int j=0,count=0; for(int i=0;i<N;i++){ if(-T[i]+T[j]<=K){ if(i==N-1 && j=0)count +=(N+C-1)/C; else co...
a.cc: In function 'int main()': a.cc:17:17: error: lvalue required as left operand of assignment 17 | if(i==N-1 && j=0)count +=(N+C-1)/C; | ~~~~~~~^~~~
s413834529
p03785
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define rep_bit(n) for (int bit = 0; bit < (1<<n); ++bit) #define all(x) (x).begin(),(x).end() #define ll long long #define ld long double #define CYES cout<<"Yes"<<endl #define CNO cout<<"No"<<endl #define SP <<" "<< #define CST(x) cout<<fixed<<setprecisio...
a.cc: In function 'int main()': a.cc:50:15: error: lvalue required as left operand of assignment 50 | if(now+c=i || t.at(now)+k < t.at(i)){ | ~~~^~
s453250073
p03785
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define rep_bit(n) for (int bit = 0; bit < (1<<n); ++bit) #define all(x) (x).begin(),(x).end() #define ll long long #define ld long double #define CYES cout<<"Yes"<<endl #define CNO cout<<"No"<<endl #define SP <<" "<< #define CST(x) cout<<fixed<<setprecisio...
a.cc: In function 'int main()': a.cc:50:12: error: 's' was not declared in this scope 50 | if(s+c=i || t.at(s)+k < t.at(i)){ | ^
s379121465
p03785
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) #define rep_bit(n) for (int bit = 0; bit < (1<<n); ++bit) #define all(x) (x).begin(),(x).end() #define ll long long #define ld long double #define CYES cout<<"Yes"<<endl #define CNO cout<<"No"<<endl #define SP <<" "<< #define CST(x) cout<<fixed<<setprecisio...
a.cc: In function 'int main()': a.cc:43:14: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long long int') 43 | cin >> n > c >> k; | ~~~~~~~~ ^ ~~~~~~ | | | | | long long int ...
s823845276
p03785
C++
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ ) #define all(x) (x).begin(),(x).end() using ll = long long; using namespace std; int main() { int n,c,k; cin>>n>>c>>k; vector<int> t(n); rep(i,n) cin>>t[i]; sort(all(t)); ///////////// // wakarannnnnnnnnn/////...
a.cc: In function 'int main()': a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 20 | cout<<ans<<endl; | ^~~ | abs
s098335777
p03785
C++
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(false); cin.tie(0); #define FOR(i,s,n) for(int i = (s); i < (n); i++) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) for(int i = (n); i >= 0; i--) #define ALL(n) (n).begin(), (n).end() #define RALL(n) (n).rbegin(), (n).rend() #define ATYN(n) ...
a.cc: In function 'int main()': a.cc:28:19: error: 't' was not declared in this scope 28 | c = 1, time = t[0]; | ^
s191962362
p03785
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (ll i = 0; i < n; i++) #define INF 9223372036854775807 #define all(x) (x).begin(), (x).end() ll ts = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, c, k; cin >> n >> c >> k; vector<ll> t(n)...
a.cc: In function 'int main()': a.cc:28:14: error: 'a' was not declared in this scope 28 | if (nk < a[i] || !nc) { | ^
s539989467
p03785
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define REP(i, n) for (ll i = 0; i < n; i++) #define INF 9223372036854775807 #define all(x) (x).begin(), (x).end() ll ts = 1000000007; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, c, k; cin >> n >> c >> k; vector<ll> t(n)...
a.cc: In function 'int main()': a.cc:28:14: error: 'a' was not declared in this scope 28 | if (nk < a[i] || !nc) { | ^
s923790795
p03785
C++
#include <bits/stdc++.h> using namespace std; int main(){ 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 bus_count = 0; int ninzu = 0; int i = 0; while(i < N) { bus_count++; bus_time = T[i] + K; int j = i; while...
a.cc: In function 'int main()': a.cc:21:5: error: 'bus_time' was not declared in this scope 21 | bus_time = T[i] + K; | ^~~~~~~~
s440783294
p03785
C++
// include // ------------------------------------------------ #include <bits/stdc++.h> #include <vector> #include <algorithm> #include <math.h> using namespace std; // func // ------------------------------------------------ int CalcSumOfDigit(int n); // 各桁の和を計算する。 int getDigit(int n); // 数字の桁数を取得する。...
a.cc:111:5: error: redefinition of 'int CalcSumOfDigit(int)' 111 | int CalcSumOfDigit(int n) | ^~~~~~~~~~~~~~ a.cc:83:5: note: 'int CalcSumOfDigit(int)' previously defined here 83 | int CalcSumOfDigit(int n) | ^~~~~~~~~~~~~~
s418600739
p03785
C++
#include <iostream> #include <vector> using namespace std; int main() { int N,C,K; cin>>N>>C>>K; vector<int> T(N); for(int i=0; i<N; i++) cin>>T[i]; int bus=0; int passenger=0; int first_wait; sort(T.begin(), T.end()); for(int i=0; i<N;) { passenger=1; f...
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(T.begin(), T.end()); | ^~~~ | short
s285702781
p03785
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)(n); ++i) using P = pair<int,int>; using ll = long long; static const int INF = 1000000000; static const ll MOD = 1000000007; ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;} ll lcm(ll a, ll b){return a / gcd(a, b) * b;} int main...
a.cc: In function 'int main()': a.cc:21:9: error: 'l' was not declared in this scope 21 | l tmpc = c; | ^ a.cc:24:17: error: 'tmpc' was not declared in this scope; did you mean 'tm'? 24 | tmpc--; | ^~~~ | tm
s970470710
p03785
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int n,c,k; cin >> n >> c >> k; vector<int> vec(n); for(int i=0;i<n;i++) cin >> vec.at(i); int bus=0,people=0; for(int i=0;i<n;){ if(i==n-1){bus++; break;} //最終乗客=第一乗客のときは専用バスあげて終了 int p0 = vec.at(i); //第一乗客の時刻 ...
a.cc: In function 'int main()': a.cc:22:6: error: expected '}' at end of input 22 | } | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s367809073
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { long long n,c,k,count=0; cin >> n >> c >> k; long long C=c; vector<int>t(n); for(int i=0; i<n; i++) cin >> t[i]; sort(t.begin(),t.end()); for(int i=0; i<n; i++){ t[i]+=k; C--; for(int j=i+1; j<n; j++){ if(t[j]>[i]){ ...
a.cc: In lambda function: a.cc:17:18: error: expected '{' before ')' token 17 | if(t[j]>[i]){ | ^ a.cc: In function 'int main()': a.cc:17:14: error: no match for 'operator>' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'main()::<lam...
s271035275
p03785
C++
#include<iostream> #include<fstream> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; int n,c,k,people,sign,bus; int timer[100010]; int main() { cin>>n>>c>>k; for(int i=1; i<=n; i++) scanf("%d",&timer[i]); sort(timer+1,timer+1+n); people=1; bus=1; sign=timer[1]+k; for(int i=2; i<=n; i+...
a.cc: In function 'int main()': a.cc:19:35: error: 'sum' was not declared in this scope 19 | if(sign<timer[i]||sum==c) | ^~~
s097658605
p03785
C++
#include<iostream> #include<fstream> #include<cstdio> #include<cmath> #include<algorithm> using namestiace std; int n,k,c,t[100010]; int per=1,cnt=1,tb; int main() { scanf("%d%d%d",&n,&c,&k); for(int i=1;i<=n;i++) { scanf("%d",&t[i]); } sort(t+1,t+1+n); tb=t[1]+k; for(int i=2;i<=n;i+...
a.cc:6:7: error: expected nested-name-specifier before 'namestiace' 6 | using namestiace std; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 16 | sort(t+1,t+1+n); | ^~~~ | std::sort In file includ...
s848300884
p03785
C++
#include<iostream> #include<fstream> #include<cstdio> #include<cmath> #include<algorithm> using namestiace std; int n,k,c,t[100010]; int per=1,cnt=1,tb; int main() { scanf("%d%d%d",&n,&c,&k); for(int i=1;i<=n;i++) { scanf("%d",&t[i]); } sort(t+1,t+n+1); tb=t[1]+k; for(int i=2;i<=n;i+...
a.cc:6:7: error: expected nested-name-specifier before 'namestiace' 6 | using namestiace std; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 16 | sort(t+1,t+n+1); | ^~~~ | std::sort In file includ...
s868003060
p03785
C++
#include <bits/stdc++.h> using namestiace std; int n,k,c,t[100010]; int per=1,cnt=1,tb; int main(){ scanf("%d%d%d",&n,&c,&k); for(int i=1;i<=n;i++){ scanf("%d",&t[i]); } sort(t+1,t+n+1); tb=t[1]+k; for(int i=2;i<=n;i++){ if(t[i]>tb||per==c){ cnt++; tb=t...
a.cc:3:7: error: expected nested-name-specifier before 'namestiace' 3 | using namestiace std; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 13 | sort(t+1,t+n+1); | ^~~~ | std::sort In file includ...
s982670636
p03785
C++
#include<iostream> #include<fstream> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; int n,c,k,ans,sign,sum; int time[100010]; int main() { cin>>n>>c>>k; for(int i=1; i<=n; i++) scanf("%d",&time[i]); sort(time+1,time+1+n); sum=1; ans=1; sign=time[1]; for(int i=2; i<=n; i++) if(sign+...
a.cc:8:16: error: 'int time [100010]' redeclared as different kind of entity 8 | int time[100010]; | ^ 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/b...
s909053471
p03785
C++
#include<iostream> #include<fstream> #include<cstdio> #include<cmath> #include<queue> #include<string> #include<cstring> #include<string.h> #include<algorithm> #include<iomanip> using namespace std; int n,c,k,ans,sign,sum; int time[100010]; int main() { cin>>n>>c>>k; for(int i=1; i<=n; i++) scanf("%d",&time[i]); s...
a.cc:13:16: error: 'int time [100010]' redeclared as different kind of entity 13 | int time[100010]; | ^ 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/...
s241647925
p03785
C++
#include<iostream> #include<fstream> #include<cstdio> #include<cmath> #include<queue> #include<string> #include<cstring> #include<string.h> #include<algorithm> #include<iomanip> using namespace std; int n,c,k,ans,sign,sum; int time[100010]; int main() { cin>>n>>c>>k; for(int i=1; i<=n; i++) scanf("%d",&time[i]); s...
a.cc:13:16: error: 'int time [100010]' redeclared as different kind of entity 13 | int time[100010]; | ^ 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/...
s741601834
p03785
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,C,K,S=0;cin>>N>>C>>K; vector<int>T(N); for(int i=0;i<N;i++)cin>>T.at(i): sort(T.begin(),T.end()); for(int i=0;i<N;i++){ S++;int j=1; while(j<C&&T.at(i)+C>=T.at(i+j))j++; i+=j-1; } cout<<S<<endl; }
a.cc: In function 'int main()': a.cc:6:35: error: expected ';' before ':' token 6 | for(int i=0;i<N;i++)cin>>T.at(i): | ^ | ;
s364842134
p03785
C++
//WAだけどどこが間違っているのかわからないので後日のために投げときます #include <bits/stdc++.h> using namespace std; int main(){ int N,C,K; cin >>N >> C >> K; int t[i]; for (int i=0;i<N;i++){ cin>>t[i]; } sort(t,t+N); vector <int> b; int num=0; b[num]=t[0]; int nowbus=1; for (int i=1;i<N;i++){ cout<<i<<" "<<num<<" "<<no...
a.cc: In function 'int main()': a.cc:9:9: error: 'i' was not declared in this scope 9 | int t[i]; | ^ a.cc:11:10: error: 't' was not declared in this scope 11 | cin>>t[i]; | ^ a.cc:13:8: error: 't' was not declared in this scope 13 | sort(t,t+N); | ^
s891130443
p03785
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int N, C, K; cin >> N >> C >> K; int Bus = 0; int Waiting = 0; int AngryTime = INFINITY; vector<int> Schedule(N, 0); for (int i = 0; i < N; i++) cin >> Schedule[i]; sort(Schedule.begin(), Schedule.end()); for (int i ...
a.cc: In function 'int main()': a.cc:12:25: error: 'INFINITY' was not declared in this scope 12 | int AngryTime = INFINITY; | ^~~~~~~~
s298983008
p03785
C++
#include<bits/stdc++.h> using namespace std; int main(){ long int N,C,K; long int ans = 0; cin >> N >> C >> K; vector<int> T(N); long int count = 1; for(int i = 0; i < N; i++) {cin >> T[i];} sort(T.begin(),T.end()); long int tt = -1; long int cnt = 0; for(int i = 1; i < N; i++){ if(T[i] <= tt && cnt + 1 ...
a.cc:31:2: error: 'cout' does not name a type 31 | cout << ans; | ^~~~ a.cc:35:1: error: expected declaration before '}' token 35 | } | ^
s745318693
p03785
C++
#include<bits/stdc++.h> using namespace std; int main(){ long int N,C,K; long int ans = 0; cin >> N >> C >> K; vector<int> T(N); long int count = 1; for(int i = 0; i < N; i++) {cin >> T[i];} sort(T.begin(),T.end()); long int tt = -1; long int cnt = 0; for(int i = 1; i < N; i++){ if(t[i] <= tt && cnt + 1 ...
a.cc: In function 'int main()': a.cc:20:7: error: 't' was not declared in this scope 20 | if(t[i] <= tt && cnt + 1 <=c){ | ^ a.cc:20:31: error: 'c' was not declared in this scope 20 | if(t[i] <= tt && cnt + 1 <=c){ | ^ a.cc: At global scope: a.cc:31:2: error: ...
s328395377
p03785
C++
#include <bits/stdc++.h> using namespace std; const int Maxn = 100005; int n, c, k; int a[Maxn]; int res; int main() { scanf("%d %d %d", &n, &c, &k); for (int i = 0; i < n; i++) scanf("%d", &a[i]); sort(a, a + n); int pnt = 0; while (pnt < n) { res++; pnt = min(upper_bound...
a.cc: In function 'int main()': a.cc:19:18: error: no matching function for call to 'min(long int, int)' 19 | pnt = min(upper_bound(a, a + n, a[pnt] + k) - a, pnt + c); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s515318366
p03785
C++
#include <bits/stdc++.h> using namespace std; const int Maxn = 100005; int n, c, k; int a[Maxn]; int res; int main() { scanf("%d %d %d", &n, &c, &k); for (int i = 0; i < n; i++) scanf("%d", &a[i]); sort(a, a + n); int pnt = 0; while (pnt < n) { res++; pnt = min(upper_bound...
a.cc: In function 'int main()': a.cc:19:18: error: no matching function for call to 'min(long int, int)' 19 | pnt = min(upper_bound(a, a + n, a[pnt] + k) - a, pnt + c); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, ...
s136333350
p03785
C++
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); typedef long long ll; // Welcome to my source code! int main() { 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); ll dep = t[0] + k, cnt =...
a.cc: In function 'int main()': a.cc:15:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if (dep < t || cnt == c) { | ~~~~^~~
s149134077
p03785
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; long int c, k; cin >> c >> k; vector<long int> t(n); for(int i = 0; i < n; i++){ cin >> t.at(i); } sort(t.begin(). t.end()); int rag = k; int count = 0; int bus = 0; for(int i = 0; i < n; i++){ if(count == c){ ...
a.cc: In function 'int main()': a.cc:13:19: error: 'std::vector<long int>::iterator' has no member named 't' 13 | sort(t.begin(). t.end()); | ^
s748082016
p03785
C++
#include<bits/stdc++.h> using namespace std; int main() { long long int n,c,k; cin >> n >> c >> k; vector<long long int> list(n); for (long long int i=0;i<n;i++) { cin >> list.at(i); } revers(list.begin(), list.end()); long long int count=1,temp_time=list.at(0),temp_num=0; for (int i=0;i<n;i++) ...
a.cc: In function 'int main()': a.cc:11:3: error: 'revers' was not declared in this scope 11 | revers(list.begin(), list.end()); | ^~~~~~ a.cc:22:25: error: expected '}' at end of input 22 | cout << count << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() ...
s386972485
p03785
C++
//Zory-2019 #include<bits/stdc++.h> using namespace std; namespace mine { typedef long long ll; #define pii pair<int,int> #define FR first #define SE second #define MP make_pair #define PB push_back #define vc vector #define all(x) (x).begin(),(x).end() #define sz(x) ((int)(x).size()...
a.cc: In function 'void mine::main()': a.cc:52:29: error: expected ';' before '{' token 52 | fo(i,1,n+1)9 | ^ | ; 53 | { | ~
s687449675
p03785
C++
//スギノキさんの写経コード #include <bits/stdc++.h> using namespace std; using ll =long long; using db = double; using vll = vector<long long>; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } re...
a.cc: In function 'bool coY()': a.cc:20:32: warning: no return statement in function returning non-void [-Wreturn-type] 20 | bool coY() {cout <<"Yes"<<endl;} | ^ a.cc: In function 'bool coN()': a.cc:21:30: warning: no return statement in function returning non-void [-Wreturn-type...
s282192981
p03785
C++
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int N, C, K; cin >> N >> C >> K; vector<int> T(N); for( int i = 0; i < N; i++ ) cin >> T.at(i); sort( T.begin(), T.end() ); int bus = 1; int count = 0; //乗客数カウント int time = 0; //1人目の客の乗車時刻 for( int i = 0; i < N;...
a.cc: In function 'int main()': a.cc:25:17: error: 'n' was not declared in this scope 25 | if(i+1>=n)break; | ^
s836272580
p03785
C++
#include <iostream> #include<string> #include<cmath> #include<algorithm> #include<cctype> #include<queue> #include<deque> #include<regex> #include<stack> #include<stdio.h> #include<vector> #include<set> #include<map> #include<iomanip> #define rep(i, n) for(int i=0;i<n;i++) typedef int long long ll; using namespace st...
a.cc:76:5: error: redefinition of 'int dx [4]' 76 | int dx[4] = {1, 0, -1, 0}; | ^~ a.cc:21:5: note: 'int dx [4]' previously defined here 21 | int dx[4] = {1, 0, -1, 0}; | ^~ a.cc:77:5: error: redefinition of 'int dy [4]' 77 | int dy[4] = {0, 1, 0, -1}; | ^~ a.cc:22:5: note: 'int ...
s746678257
p03785
C++
#include <iostream> #include <algorithm> using namespace std; cosnt int MAXN = 1e5 + 10; int n, k, c; int t[MAXN]; int main(){ cin >> n >> c >> k; for(int i = 0; i < n; i++) cin >> t[i]; sort(t, t + n); int cc = c, tt = k, b = 0; for(int i = 1; i <= n; i++){ if(cc < c && tt + t[i] - t[i - 1] <= k) { ...
a.cc:5:1: error: 'cosnt' does not name a type; did you mean 'const'? 5 | cosnt int MAXN = 1e5 + 10; | ^~~~~ | const a.cc:8:7: error: 'MAXN' was not declared in this scope 8 | int t[MAXN]; | ^~~~ a.cc: In function 'int main()': a.cc:14:24: error: 't' was not declared in this scope 14 |...
s727129990
p03785
C++
#include <iostream> #include <algorithm> using namespace std; cosnt int MAXN = 1e5 + 10; int n, k, c; int t[MAXN]; int main(){ cin >> n >> c >> k; for(int i = 0; i < n; i++) cin >> t[i]; sort(t, t + n); int cc = c, tt = k, b = 0; for(int i = 1; i <= n; i++){ if(cc < c && tt + t[i] - t[i - 1] <= k) { ...
a.cc:5:1: error: 'cosnt' does not name a type; did you mean 'const'? 5 | cosnt int MAXN = 1e5 + 10; | ^~~~~ | const a.cc:8:7: error: 'MAXN' was not declared in this scope 8 | int t[MAXN]; | ^~~~ a.cc: In function 'int main()': a.cc:14:24: error: 't' was not declared in this scope 14 |...
s319193876
p03785
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; ll INF = 1e10; int main() { ll 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()); queue<int> que; que.push(t[0]); ll ans = 0; fo...
a.cc: In function 'int main()': a.cc:21:26: error: no matching function for call to 'min(int, ll&)' 21 | ll loop = min(int(que.size()), c); | ~~~^~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++...
s303063696
p03785
C++
#include <iostream> using namespace std; int main(){ 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 ans = 0, c = 0, k = 0; bool dprt; for (int i = 0; i < N - 1; i++){ c++; k += T[i + 1] - T[i]; ...
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(T,T + N); | ^~~~ | short
s837744396
p03785
C++
#include <iostream> using namespace std; int N, C, K; //passengers, bus capacity, time capacity; int* T; int main() { cin >> N >> C >> K; T = new int[N+1]; for(int i = 1; i <= N; i++) cin >> T[i]; sort(T+1, T+N+1); int c = C, t = K, b = 0; for(int i = 1; i <= N; i++) { if(c < C &&...
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(T+1, T+N+1); | ^~~~ | short
s285838379
p03785
C++
include<bits/stdc++.h> using namespace std; int main() { int n = 0, c = 0, k = 0; int a[10000000]; cin >> n >> c >> k; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); cout << a[n-1]; int ans = 1, base = 0; int passenger = 0; int p = 0; while (p != n){ ...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin >> n >> c >> k; | ^~~ a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | ...
s310531934
p03785
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<map> #include<set> #include<cstdio> #include<cmath> #include<numeric> #include<queue> #include<stack> #include<cstring> #include<limits> #include<functional> #include<unordered_set> #define rep(i,a) for(int i=(int)0;i<(int)a;++i) #define ...
a.cc: In function 'void solve()': a.cc:40:19: error: 'ans' was not declared in this scope; did you mean 'abs'? 40 | ++ans; | ^~~ | abs a.cc:43:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 43 | cout<<ans<<endl; | ...
s981205646
p03785
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<map> #include<set> #include<cstdio> #include<cmath> #include<numeric> #include<queue> #include<stack> #include<cstring> #include<limits> #include<functional> #include<unordered_set> #define rep(i,a) for(int i=(int)0;i<(int)a;++i) #define ...
a.cc: In function 'void solve()': a.cc:41:24: error: 'cnt' was not declared in this scope; did you mean 'int'? 41 | ll nxt=cnt; | ^~~ | int a.cc:43:19: error: 'ans' was not declared in this scope; did you mean 'abs'? 43 | ++...
s905750213
p03785
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #in...
a.cc: In function 'void solve()': a.cc:61:46: error: no match for 'operator+' (operand types are 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} and 'int') 61 | s.erase(s.begin(), s.begin() + c); | ...
s789313434
p03785
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<unordered_map> #in...
a.cc: In function 'void solve()': a.cc:62:46: error: no match for 'operator+' (operand types are 'std::set<int>::iterator' {aka 'std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator'} and 'int') 62 | s.erase(s.begin(), s.begin() + c); | ...
s414675051
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { 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()); while(i < N){ int j = i; while(i - j < C && i < N && T[i] <= T[j] + K){ i++; ...
a.cc: In function 'int main()': a.cc:12:11: error: 'i' was not declared in this scope 12 | while(i < N){ | ^ a.cc:17:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 17 | ans++; | ^~~ | abs a.cc:20:13: error: 'ans' was not declared in this...
s696822557
p03785
C++
#include <iostream> #include <math.h> //#include <numeric> #include <vector> //#include <map> #include <algorithm> using namespace std; #define n_max 100000 #define N_max 100 #define rep(i, a, n) for(int i = a; i < n; i++) #define rrep(i, a, n) for(int i = a; i > n; i--) #define lrep(i, a, n) for(long int i = a; i < ...
a.cc: In function 'int main()': a.cc:41:13: error: 'all' was not declared in this scope 41 | all+= person; | ^~~
s859547631
p03785
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace st...
a.cc: In function 'int main()': a.cc:105:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 105 | ans++; | ^~~ | abs a.cc:111:3: error: 'ans' was not declared in this scope; did you mean 'abs'? 111 | ans++; | ^~~ | abs
s009884270
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { long n, c, k; cin >> n >> c >> k; long a[n]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a+n); int ran = 0, cnt = 0; for (int i = 0, i < n; i++) { if (a[i] - a[ran] > k||i-ran+1>c) { ran = i; cnt++; } } cout << cnt << ...
a.cc: In function 'int main()': a.cc:10:20: error: expected ';' before '<' token 10 | for (int i = 0, i < n; i++) { | ^~ | ; a.cc:10:21: error: expected primary-expression before '<' token 10 | for (int i = 0, i < n; i++) { | ^
s452389002
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { long n, c, k; cin >> n >> c >> k; long a[n]; for (int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); int ran = 0, cnt = 0; for (int i = 0, i < n; i++) { if (a[i] - a[ran] > K||i-ran+1>c) { ran = i; cnt++; } } cou...
a.cc: In function 'int main()': a.cc:8:10: error: request for member 'begin' in 'a', which is of non-class type 'long int [n]' 8 | sort(a.begin(), a.end()); | ^~~~~ a.cc:8:21: error: request for member 'end' in 'a', which is of non-class type 'long int [n]' 8 | sort(a.begin(), a.end()); ...
s044405207
p03785
C++
#include<iostream> #include<algorithm> using lint=int64_t; using namespace std; int main() { lint N,C,K; lint T[100010]={}; cin >> N >> C >> K; for(lint i=0;i<N;i++) cin >> T[i]; sort(T,T+N); lint base=T[0]; lint cnt=0; lint ans=0; for(lint i=0;i<N;i++) { if(T[i]>=base+K || cnt>=C) { ans++ ...
a.cc: In function 'int main()': a.cc:24:30: error: expected ';' before 'base' 24 | ans++ | ^ | ; 25 | base=T[i]; | ~~~~
s652919413
p03785
C++
#include <iostream> using namespace std; int main() { 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 res = 0; for(int i=0;i<n;i++){ int j = 0; while(j < c && (t[j+i+1] - t[i]) <= k ){ j++; i++; } ...
a.cc: In function 'int main()': a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(t, t+n); | ^~~~ | short
s179673452
p03785
C++
#include<bits/stdc++.h> using namespace std; const double pi=acos(-1); const int dx[]={0,1,0,-1}; const int dy[]={1,0,-1,0}; #define ll long long #define inf int(1e9+7) #define pb push_back #define mp make_pair pair<int,int>p[100005]; bool gone[100005]; int n,c,k; int main() { cin>>n>>c>>k; for(int i=0;i<n;i++) { ...
a.cc: In function 'int main()': a.cc:36:36: error: expected ';' before 'ans' 36 | sum=sum/k+1 | ^ | ; 37 | ans+=sum; | ~~~
s212399889
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int cnt=1, N, C, K, s=0; bool flg = true; cin >> N >> C >> K; vector<int> T(N,0); for (int i = 0; i<N; i++) cin >> T[i]; sort(T.begin(),T.end()); for (int i = 1; i<N; i++) { if(T[i]>T[s]+K || i==s+C) { cnt++; s=i; } } prin...
a.cc: In function 'int main()': a.cc:17:16: error: expected ')' before 'cnt' 17 | printf("%d\n" cnt); | ~ ^~~~ | )
s823140381
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int cnt=1, N, C, K, s=0; bool flg = true; cin >> N >> C >> K; vector<int> T(N,0); for (int i = 0; i<N; i++) cin >> T[i]; sort(T.begin(),T.end()); for (int i = 1; i<N; i++) { if(T[i]>T[s]+K || i==s+C) { cnt++; s=i; } } prin...
a.cc: In function 'int main()': a.cc:17:16: error: expected ')' before 'cnt' 17 | printf("d%\n" cnt); | ~ ^~~~ | )
s768865791
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int cnt=0, N, C, K, s=0; bool flg = true; cin >> N >> C >> K; vector<int> T(N,0); for (int i = 0; i<N; i++) cin >> T[i]; sort(T.begin(),T.end()); for (int i = 1; i<N; i++) { if(T[i]>T[s]+K || i=s+C) { cnt++; s=i; } } cout ...
a.cc: In function 'int main()': a.cc:12:20: error: lvalue required as left operand of assignment 12 | if(T[i]>T[s]+K || i=s+C) {
s639709830
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int cnt=0, s=0; long long N, C, K; vector<int> T(N,0); cin >> N >> C >> K; for (int i = 0; i<N; i++) cin >> T[i]; sort(T.begin(),T.end()); while(s < N) { cnt++; for (long long i = min(s,N)+1; i<min(C+s,N); i++) { if(T[i] > T[min(s,N...
a.cc: In function 'int main()': a.cc:13:27: error: no matching function for call to 'min(int&, long long int&)' 13 | for (long long i = min(s,N)+1; i<min(C+s,N); i++) { | ~~~^~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-...
s458914970
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, t, cnt=0, s=0; long long C, K; vector<int> T(N,0); cin >> N >> C >> K; for (int i = 0; i<N; i++) cin >> T[i]; sort(T.begin(),T.end()); while(s < N) { cnt++; for (long long i = min(s,N)+1; i<min(C+s,N); i++) { if(T[i] > T[min(...
a.cc: In function 'int main()': a.cc:13:41: error: no matching function for call to 'min(long long int, int&)' 13 | for (long long i = min(s,N)+1; i<min(C+s,N); i++) { | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/includ...
s394423241
p03785
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, t, cnt=0, s=0; long long C, K; vector<int> T(N,0); cin >> N >> C >> K; for (int i = 0; i<N; i++) cin >> T[i]; sort(T.begin(),T.end()); while(s < N) { cnt++; for (int i = min(s,N)+1; i<min(C+s,N); i++) { if(T[i] > T[min(s,N)]+...
a.cc: In function 'int main()': a.cc:13:35: error: no matching function for call to 'min(long long int, int&)' 13 | for (int i = min(s,N)+1; i<min(C+s,N); i++) { | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-lin...
s234551238
p03785
C++
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ long long int N,C; cin >> N >> C; float K; cin >> K; vector<float> A(N,0.0); for(long long int i = 0LL ; i < N; i++){ cin >> A[i]; } sort(A.begin(), A.end(), greater<long long int>()); long long int...
a.cc:22:1: error: extended character   is not valid in an identifier 22 |   if(p >= C || A[i+1] < fP - K){ | ^ a.cc: In function 'int main()': a.cc:22:1: error: '\U00003000' was not declared in this scope 22 |   if(p >= C || A[i+1] < fP - K){ | ^~
s707176771
p03785
C++
#include <bits/stdc++.h> using namespace std; #define ll long long #define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i]; #define REP(i,x) for(int i=0;i<(int)(x);i++) #define REPS(i,x) for(int i=1;i<=(int)(x);i++) #define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--) #define RREPS(i,x) for(int i=((int)(x));i>0;i--) const...
a.cc:65:10: error: redefinition of 'const long long int mod' 65 | const ll mod = 1e9 + 7; | ^~~ a.cc:11:10: note: 'const long long int mod' previously defined here 11 | const ll mod = 1e9 + 7; | ^~~ a.cc:76:5: error: redefinition of 'int main()' 76 | int main (){ | ^~~~ ...
s229481534
p03785
C++
#include <bits/stdc++.h> using namespace std; typedef ll long long int main() { int n; ll c,k; cin >> n >> k; ll t[n]; int ans = 1; ll start; for (int i = 0;i < n;i++) { cin >> t[i]; } sort(t,t+n); start = t[0]; for (int i = 1;i < n;i++) { if (t[i]-start > k) { ans++; start = t[i]; } } if (sta...
a.cc:3:9: error: 'll' does not name a type 3 | typedef ll long long | ^~
s214897719
p03785
C++
import qualified Data.ByteString.Char8 as C import Data.Maybe (isJust, fromJust) import Control.Monad (replicateM) import Data.List (sort, drop, length, filter, take) import qualified Data.Vector.Unboxed as U import Control.Arrow (first) -- first :: Arrow a => a b c -> a (b, d) (c, d) cReadLn :: IO Int cReadLn = fst ....
a.cc:17:73: warning: missing terminating ' character 17 | -- ts <- (U.fromList . sort) <$> replicateM n cReadLn -- i-th passenger's arrival time | ^ a.cc:17:73: error: missing terminating ' character 17 | -- ts <- (U.fromList . sort) ...
s467778922
p03785
C++
#include <iostream> int main(void) { int n, c, k, t[100000] = {}; int ans = 0, first = 0; std::cin >> n >> c >> k; for(int i = 0; i != n; i++) std::cin >> t[i]; std::sort(t, t + n); for(int i = 0; i != n; i++){ if(t[i] - t[first] > k || i - first >= c){ first = i; ans++; } } std::cout << ans + 1 << st...
a.cc: In function 'int main()': a.cc:8:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 8 | std::sort(t, t + n); | ^~~~ | qsort
s024332553
p03785
C++
#include <iostream> #include <vector> using namespace std; int main() { 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()); int ans = 0; for (int i = 0; i < n;) { int j = i + 1; int person = 1; ...
a.cc: In function 'int main()': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(t.begin(), t.end()); | ^~~~ | short
s584753991
p03785
C++
#include<bits/stdc++.h> #include <iostream> #include <stdio.h> #include <algorithm> #include <cmath> #include <math.h> #include <cstring> #include <string> #include <queue> #include <deque> #include <stack> #include <stdlib.h> #include <list> #include <map> #include <utility> #include <set> #include <bitset> #include <...
a.cc:84:5: error: redefinition of 'int min3(int, int, int)' 84 | int min3(int a,int b,int c){return min(min(a,b),c);} | ^~~~ a.cc:25:5: note: 'int min3(int, int, int)' previously defined here 25 | int min3(int a,int b,int c){return min(min(a,b),c);} | ^~~~ a.cc:85:5: error: redefinition of 'in...
s663210691
p03785
C++
#include<vector> #include<iostream> #include<algorithm> using namespace std; using ll = long long; const int INF = 1e9; const double PI = acos(-1.0); const ll MOD = 1e9 + 7; #define sz(x) ((int)(x).size()) #define all(x) (x).begin(), (x).end() #define debug(x) cout << #x << ": " << x << endl; #define popcnt __builti...
a.cc:9:19: error: 'acos' was not declared in this scope 9 | const double PI = acos(-1.0); | ^~~~
s614448663
p03785
C++
#include <iostream> #include <cstdlib> using namespace std; int main(void) { int n, c, k; cin >> n >> c >> k; int t[100000]; for (int i = 0; i < n; i++) { cin >> t[i]; } sort(t, t + n); int departure = -1; int got = 0; int res = 1; for (int i = 0; i < n; i++) { if (departure < 0) { ...
a.cc: In function 'int main()': a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(t, t + n); | ^~~~ | short
s157487606
p03785
C++
6 3 3 7 6 2 8 10 6
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 3 3 | ^
s650991652
p03785
C++
#include<bits/stdc++,h> using namespace std; #define ll long long int main(){ ll n,c,k; cin>>n>>c>>k; vector<ll> a(n); for(int i=0;i<n;i++){ cin>>a[i]; } sort(a.begin(),a.end()); ll cnt=1,knt=a[0],count=1; for(int i=1;i<n;i++){ if(a[i]-knt<=k&&cnt<c){ cnt++; }else{ count++; ...
a.cc:1:9: fatal error: bits/stdc++,h: No such file or directory 1 | #include<bits/stdc++,h> | ^~~~~~~~~~~~~~~ compilation terminated.
s150290569
p03785
C++
#include<bits/stdc++.h> using namespace std; int main() { int n, c, k; cin >> n >> c >> k; vector<int> t(n); for (int i = 0; i < n; i++) { cin >> t.at(i); sort(t.begin(), t.end()); int ans = 1; int count = 1; int ht = t.at(0); for (int i = 0; i < n; i++) { if (count == c + 1) { ...
a.cc: In function 'int main()': a.cc:39:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 39 | cout << ans << endl; | ^~~ | abs
s151019261
p03785
C++
#include<bits/stdc++.h> using namespace std; int main() { int n, c, k; cin >> n >> c >> k; vector<int> t(n); for (int i = 0; i < n; i++) { cin >> t.at(i); sort(t.begin(), t.end()); int ans = 1; int count = 1; int ht = t.at(0); for (int i = 0; i < n; i++) { if (count == c + 1) { ...
a.cc: In function 'int main()': a.cc:39:2: error: expected '}' at end of input 39 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s111583732
p03785
C++
#include<bits/stdc++.h> using namespace std; int main() { int n, c, k; cin >> n >> c >> k; vector<int> t(n); for (nit i = 0; i < n; i++) { cin >> t.at(i); sort(t.begin(), t.end()); int ans = 1; int count = 1; int ht = t.at(0); for (int i = 0; i < n; i++) { if (count == c + 1) { ...
a.cc: In function 'int main()': a.cc:12:14: error: 'nit' was not declared in this scope; did you mean 'int'? 12 | for (nit i = 0; i < n; i++) { | ^~~ | int a.cc:12:25: error: 'i' was not declared in this scope 12 | for (nit i = 0; i < n; i++) { | ...
s147686712
p03785
C++
#include<bits/stdd++.h> using namespace std; int main() { int n, c, k; cin >> n >> c >> k; vector<int> t(n); for (nit i = 0; i < n; i++) { cin >> t.at(i); sort(t.begin(), t.end()); int ans = 1; int count = 1; int ht = t.at(0); for (int i = 0; i < n; i++) { if (count == c + 1) { ...
a.cc:1:9: fatal error: bits/stdd++.h: No such file or directory 1 | #include<bits/stdd++.h> | ^~~~~~~~~~~~~~~ compilation terminated.