submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s066245252 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int n; cin>>n;
string b;
if(n==1){
int a; cin>>a;
cout<<a;
return 0;
}
rep(i,n){
string a; cin>>a;
b+=a;
reverse(b.begin(),b.end());
}
rep(i,n){
... | a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
21 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s273760603 | p03673 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = Integer.parseInt(scan.next());
List<int> b = new ArrayList<int>();
int a
for(int i = 0; i < n; i++){
a = Integer.parseInt(scan.next());
... | Main.java:7: error: ';' expected
int a
^
1 error
|
s491062004 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define INF 100000000
typedef long long ll;
int main() {
int n;
cin>>n;
vector<int>q;
for(int i=0;i<n;i++){
int a;
cin>>a;
if(i%2==0){
q.push_back(... | a.cc: In function 'int main()':
a.cc:18:9: error: 'class std::vector<int>' has no member named 'push_front'
18 | q.push_front(a);
| ^~~~~~~~~~
|
s167700650 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> b;
for(int i=0;i<n;i++){
char a;
cin >> a;
if(i%2) b.push_back(a);
else b.pop_back(a);
}
if(n%2) reverse(b.begin(),b,end());
for(int i=0;i<n-1;i++) cout << b.at(i) << " ";
cout << b.at(n-1) << endl;
} | a.cc: In function 'int main()':
a.cc:12:20: error: no matching function for call to 'std::vector<int>::pop_back(char&)'
12 | else b.pop_back(a);
| ~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/... |
s624748545 | p03673 | C | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(a... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s962381623 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
const int inf=1010001000;
const ll INF=1001000100010001000;
const int mod=(int)1e9+7;
int main(){
int n;
cin>>n;
vector<int>a... | a.cc: In function 'int main()':
a.cc:21:21: error: statement cannot resolve address of overloaded function
21 | if(i%2==0)b.push_front;
| ~~^~~~~~~~~~
|
s522918662 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin>>N;
list<long long>A;
for(int i=0;i<N;i++){
long long a;
cin>>a;
if(i%2==0){
A.push_back(a);
}
else{
A.push_front(a);
}
}
if(N%2==1){
reverse(A.begin(),A.end());
}
for_each(A.cbegin(), A.cen... | a.cc: In function 'int main()':
a.cc:22:5: error: expected ';' before '}' token
22 | })
| ^
| ;
23 | }
| ~
|
s392741209 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin>>N;
list<long long>A;
for(int i=0;i<N;i++){
long long a;
cin>>a;
if(i%2==0){
A.push_back(a);
}
else{
A.push_front(a);
}
}
if(N%2==1){
reverse(A.begin(),A.end());
}
for_each(ls.cbegin(), ls.c... | a.cc: In function 'int main()':
a.cc:20:12: error: 'ls' was not declared in this scope
20 | for_each(ls.cbegin(), ls.cend(), [](long long x){
| ^~
|
s853226683 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin>>N;
list<long long>A;
for(int i=0;i<N;i++){
long long a;
cin>>a;
if(i%2==0){
A.push_back(a);
}
else{
A.push_front(a);
}
}
if(N%2==1){
reverse(A.begin(),A.end());
}
for(int i=0;i<N;i++){
... | a.cc: In function 'int main()':
a.cc:21:12: error: no match for 'operator[]' (operand types are 'std::__cxx11::list<long long int>' and 'int')
21 | cout<<A[i]<<" ";
| ^
|
s036725612 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin>>N;
list<long long>A;
for(int i=0;i<N;i++){
long long a;
cin>>a;
if(i%2==0){
A.push_back(a);
}
else{
A.push_front(a);
}
}
if(N%2==1){
reverse(A.begin(),A.end());
}
for(int i=0;i<N;i++){
... | a.cc: In function 'int main()':
a.cc:21:13: error: 'class std::__cxx11::list<long long int>' has no member named 'at'
21 | cout<<A.at(i)<<" ";
| ^~
|
s286018395 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin>>N;
vector<long long>A;
for(int i=0;i<N;i++){
long long a;
cin>>a;
if(i%2==0){
A.push_back(a);
}
else{
auto it;
it = A.begin();
it = A.insert(it,a);
}
}
if(N%2==1){
reverse(A.be... | a.cc: In function 'int main()':
a.cc:14:7: error: declaration of 'auto it' has no initializer
14 | auto it;
| ^~~~
|
s930386709 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin>>N;
vector<long long>A;
for(int i=0;i<N;i++){
long long a;
cin>>a;
if(i%2==0){
A.push_back(a);
}
else{
it = A.begin();
it = A.insert(it,a);
}
}
if(N%2==1){
reverse(A.begin(),A.end());... | a.cc: In function 'int main()':
a.cc:14:7: error: 'it' was not declared in this scope; did you mean 'i'?
14 | it = A.begin();
| ^~
| i
|
s034768242 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N;
cin>>N;
vector<long long>A;
for(int i=0;i<N;i++){
long long a;
cin>>a;
if(i%2==0){
A.push_back(a);
}
else{
A.push_front(a);
}
}
if(N%2==1){
reverse(A.begin(),A.end());
}
for(int i=0;i<N;i++){
... | a.cc: In function 'int main()':
a.cc:14:9: error: 'class std::vector<long long int>' has no member named 'push_front'
14 | A.push_front(a);
| ^~~~~~~~~~
a.cc:21:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<long long int>')... |
s792289987 | p03673 | C++ | #define rep(i, n) for(int i=0; i<n; ++i)
using namespace std;
using ll = int64_t;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
int n;
cin >> n;
vi a(n);
rep(i, n) {
cin >> a[i];
}
vi b;
rep(i, n) {
if(i+1 <= (n+1)/2) {
b.push_back(a[n-2*i-1]);
... | a.cc:3:12: error: 'int64_t' does not name a type
3 | using ll = int64_t;
| ^~~~~~~
a.cc:1:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
+++ |+#include <cstdint>
1 | #define rep(i, n) for(int i=0; i<n; ++i)
a.cc:4:12: error: 'vecto... |
s803057806 | p03673 | C++ | #define rep(i, n) for(int i=0; i<n; ++i)
using namespace std;
using ll = int64_t;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
int n;
cin >> n;
vi a(n);
rep(i, n) {
cin >> a[i];
}
vi b;
rep(i, n) {
if(i+1 <= (n+1)/2) {
b.push_back(a[n-2*i-1]);
... | a.cc:3:12: error: 'int64_t' does not name a type
3 | using ll = int64_t;
| ^~~~~~~
a.cc:1:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
+++ |+#include <cstdint>
1 | #define rep(i, n) for(int i=0; i<n; ++i)
a.cc:4:12: error: 'vecto... |
s952893343 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i=0;i<n;i++){
cin >> a[i];
}
if(i%2==0){
for(int i=n-1;i>0;i=i-2){
cout << a[i] << ' ';
}
for(int i=0;i<n;i=i+2){
cout << a[i] << ' ';
}
}
else{
for(int i=n-1;i>0;i=i-2){
... | a.cc: In function 'int main()':
a.cc:10:6: error: 'i' was not declared in this scope
10 | if(i%2==0){
| ^
|
s615518833 | p03673 | C++ | #include <bits/stdc++.h>
#include<chrono>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
int n;
cin >> n;
deque<ll> A;
if (n % 2 == 0) {
rep(i, n/2) {
ll a1, a2; ... | a.cc: In function 'int main()':
a.cc:17:24: error: no matching function for call to 'std::deque<long long int>::pop_front(ll&)'
17 | A.pop_front(a2);
| ~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/deque:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/std... |
s948818228 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<long long> a;
vector<long long> b;
for (int i=1;i<=n;++i){
int n;
cin >> n;
b.push_back(a);
sort(b.begin(),b.end());
cout << b[i] << endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:16: error: no matching function for call to 'std::vector<long long int>::push_back(std::vector<long long int>&)'
13 | b.push_back(a);
| ~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
... |
s800242581 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<long long> a(n);
for (int i=1;i<=n;++i) cin >> a[i];
vector<long long> b(n);
for (int i=1;i<=n;++i){
b.push_back(a);
sort(b.begin(),b.end());
cout << b[i] << endl;
}
}
| a.cc: In function 'int main()':
a.cc:12:16: error: no matching function for call to 'std::vector<long long int>::push_back(std::vector<long long int>&)'
12 | b.push_back(a);
| ~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
... |
s434563045 | p03673 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;
int main(){
int n; scanf("%d", &n);
deque<int> d;
rep(i, n){
int a; scanf("%d", &a);
if(i & 1) d.push_front(a);
else d.push_back(a);
}
if(n & 1){
rep(i, n){
printf("%d", d.front());
d.pop_fr... | a.cc: In function 'int main()':
a.cc:27:15: error: expected ';' before 'return'
27 | printf("\n")
| ^
| ;
28 | return 0;
| ~~~~~~
|
s997449705 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
vector<int>A(N);
for(int i=0;i<N;i++)
cin>>A.at(i);
vector<int>B(N);
for(int i=0;i<N){
if(i<=(N-1)/2){
B.at(i)=A.at(N-1-2*i);
}else{
B.at(i)=A.at((N%2)+2*(i-(N+1)/2));
}
}for(int i=0;i<N;i++)
cout<<B.at(i)<<" ";
c... | a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before ')' token
10 | for(int i=0;i<N){
| ^
| ;
|
s582796994 | p03673 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
ll n,a;
cin >> n;
ll i;
for(i=0;i<n;i++){
cin >> a[i];
... | a.cc: In function 'int main()':
a.cc:19:17: error: invalid types 'long long int[long long int]' for array subscript
19 | cin >> a[i];
| ^
a.cc:22:18: error: invalid types 'long long int[long long int]' for array subscript
22 | cout << a[n-1-2*i] << " ";
| ... |
s196015634 | p03673 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
ll n,a;
ll i;
for(i=0;i<n;i++){
cin >> a[i];
}
for(i=... | a.cc: In function 'int main()':
a.cc:18:17: error: invalid types 'long long int[long long int]' for array subscript
18 | cin >> a[i];
| ^
a.cc:21:18: error: invalid types 'long long int[long long int]' for array subscript
21 | cout << a[n-1-2*i];
| ^
a.... |
s987035746 | p03673 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
ll n,a;
for(i=0;i<n;i++){
cin >> a[i];
}
for(i=0;i<=n/2;i... | a.cc: In function 'int main()':
a.cc:16:9: error: 'i' was not declared in this scope
16 | for(i=0;i<n;i++){
| ^
a.cc:19:9: error: 'i' was not declared in this scope
19 | for(i=0;i<=n/2;i++){
| ^
a.cc:22:9: error: 'i' was not declared in this scope
22 | for(i=0;i<n/2;i++)... |
s582223450 | p03673 | C++ | import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
begin = a[0::2]
end =a[1::0]
if n%2 == 0:
end = end[:-1]
ans = np.concatenate(end,begin)
else:
begin = begin[::-1]
ans = np.concatenate(begin,end)
print(ans)
| a.cc:1:1: error: 'import' does not name a type
1 | import numpy as np
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s510508835 | p03673 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(long long i = 0; i < n; i++)
using namespace std;
signed main(void)
{
long long n;
cin >> n;
long long a[n];
deque<long long> dq;
bool ok;
rep(i, n) cin >> a[i];
ok = false;
rep(i, n)
{
ok ^= 1;
if (i % 2 == 0)
dq.push_back(a[i]);
else
dq.push_front(... | a.cc: In function 'int main()':
a.cc:27:17: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
27 | prlong longf("%d ", dq.front());
| ^~~~~~
| ulong
|
s651618602 | p03673 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
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 ... | a.cc: In function 'int main()':
a.cc:73:22: error: 'i' was not declared in this scope
73 | for (i = n - 1;i >= 0;--i) {
| ^
|
s200930272 | p03673 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cmath>
#define ll long long
#define rep(i,a,n) for(int i=(a);i<(n);i++)
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n),ans;
rep(i, 1,n+1) {
cin >> a... | In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46,
from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_ba... |
s392392573 | p03673 | C++ | #include<cstdio>
using namespce std;int n,a[200010];inline int read(){ register int ret=0;char c=getchar();while(c<'0'||c>'9')c=getchar();while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();return ret;}int main(){n=read();for(register int i=1;i<=n;++i)a[i]=read();for(register int i=n;i>0;i-=2)printf("%d ",a[i... | a.cc:2:7: error: expected nested-name-specifier before 'namespce'
2 | using namespce std;int n,a[200010];inline int read(){ register int ret=0;char c=getchar();while(c<'0'||c>'9')c=getchar();while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();return ret;}int main(){n=read();for(register int i=1;i<=n;++i)a... |
s258787096 | p03673 | C++ | #include<iostream>
using namespace std;
#include<string>
#include<vector>
int main(){
string s="";
int n;
cin>>n;
vector<int> a(n);
for(int i=0;i<n;i++){
cin>>a[i];
if((n-i)/2==1)s=s+a[i]+'0';
else s+=a[i]+'0';
}
cout<<s<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:22: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
12 | if((n-i)/2==1)s=s+a[i]+'0';
In file included from /usr/include/c++/14/strin... |
s154884602 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n; cin >> n;
vector<ll> vec1;
vector<ll> vec2;
for (ll i = 0;i<n;i++) {
ll a;
cin >> a;
if (i%2==0) {
vec1.push_back(a);
}
else vec2.push_back(a);
}
reverse(vec2.begin(),vec2.end());
for (ll i =... | a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
|
s231639970 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina c... | a.cc: In function 'int main()':
a.cc:31:15: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
31 | out(c[c.size - 1 - i]... |
s584073701 | p03673 | C++ | #include<bits/stdc++.h>
using namespace std;
long long a[200003],l,r,n,g;
int main(){
cin>>n;
l=n/2-1,r=n/2+1,g=?;
cin>>a[n/2];
for(int i=1;i<n;i++){
if(g==0) cin>>a[l],l--;
else cin>>a[r],r++;
g=!g;}
for(int i=0;i<n;i++) cout<<a[i]<<" ";} | a.cc: In function 'int main()':
a.cc:6:19: error: expected primary-expression before '?' token
6 | l=n/2-1,r=n/2+1,g=?;
| ^
a.cc:6:20: error: expected primary-expression before ';' token
6 | l=n/2-1,r=n/2+1,g=?;
| ^
a.cc:6:20: error: expected ':' before ';' token... |
s423971994 | p03673 | C++ |
#include <bits/stdc++.h>
#define rep(i, n) for (ll i=0;i<(n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
//vector<vector<ll> > comb(ll n, ll b){
void comb(vector<vector <ll> > &v, ll n){
cout << v.size();
rep(i, n){
v[i][0] = 1;
v[i][i] = 1;
}
rep(j, n) {
rep(k,j) ... | a.cc: In function 'int main()':
a.cc:43:3: error: expected '}' before 'else'
43 | else {
| ^~~~
a.cc:38:14: note: to match this '{'
38 | if (n%2==0){
| ^
a.cc: At global scope:
a.cc:54:1: error: expected declaration before '}' token
54 | }
| ^
|
s960059966 | p03673 | C++ | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
const ll LL_MAX=LLONG_MAX;
struct In{
template<typename T>
operator T(){
T x;
cin >> x;
return x;
}
};
template <typename T,typename U>
void forin(T* x,U n){
for ... | a.cc: In function 'int main()':
a.cc:47:9: error: 'i' was not declared in this scope
47 | if (i%2!=0) reverse(ans.begin(),ans.end());
| ^
|
s930115567 | p03673 | C++ | #include <iostream>
#include <deque>
using namespace std;
#define pb push_back
#define pf push_front
int n, t;
deque<int> b;
bool rev;
int main(void)
{
cin >> n;
for (int i = 0; i < n; i++) {
cin >> t;
if (!rev) {
b.pb(t);
rev = true;
} else {
b.pf(t);
rev = false;
}
}
if (!rev) {
for (int ... | a.cc:35:1: error: expected declaration before '}' token
35 | }
| ^
|
s540384640 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(),x.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
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;}
typedef long long ll;
int n,m,k... | a.cc: In function 'int main()':
a.cc:23:30: error: 'pop_front' was not declared in this scope
23 | if(n%2==0) x=b.front(),b,pop_front();
| ^~~~~~~~~
|
s101802854 | p03673 | C++ | #include <iostream>
#include<vector>
using namespace std;
#define int long long int
#include<deque>
#include<algorithm>
//Compiler version g++ 6.3.0
deque<int> d;
signed main()
{
int n,t;cin>>n;
for(int i=1;i<=n;i++){
cin>>t;
if(i&1){
d.push_back(t);
}
else {
d.push_front(t);
}
}
... | /usr/include/c++/14/bits/uniform_int_dist.h: In member function 'std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&, const param_type&)':
a.cc:4:18: error: 'long long long' is too long for GCC
4 | #define int long long int
| ... |
s870722882 | p03673 | C++ | #include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<(n);++i)
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
using namespace std;
typedef long long ll;
int main() {
int n;
vector <int> a(200005);
vector <int> b;
cin>>n;
rep(i,n) cin>>a.at(i... | a.cc: In function 'int main()':
a.cc:21:21: error: no matching function for call to 'std::vector<int>::insert(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
21 | b.insert(a[i]);
| ~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/vector:66,
fr... |
s644685973 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] m = new int[N];
int[] ans = new int[];
for(int i=0;i<N;i++)
{
m[i] = sc.nextInt();
}
if(N%2==0)
{
for(int i =0;i<N/2;i++) ans[i] = m... | Main.java:8: error: array dimension missing
int[] ans = new int[];
^
1 error
|
s258373896 | p03673 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 100000... | a.cc: In function 'int main()':
a.cc:72:21: error: 'dqq' was not declared in this scope; did you mean 'deq'?
72 | ans.push_back(dqq.front()) ;
| ^~~
| deq
|
s626485919 | p03673 | C++ | #include <bits/stdc++.h>
#define maxn 200005
#define ll long long
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> v;
for(int i=0;i<n;i++){
cin>>pre[i];
}
int i;
for(i=n-1;i>=0;i-=2){
v.push_back(pre[i]);
}
i ++;
if(n % 2 == 1) i += 2;
for(;i<=n-2;i+=2){
v.push_back(pre[i]... | a.cc: In function 'int main()':
a.cc:12:10: error: 'pre' was not declared in this scope; did you mean 'pread'?
12 | cin>>pre[i];
| ^~~
| pread
a.cc:16:17: error: 'pre' was not declared in this scope; did you mean 'pread'?
16 | v.push_back(pre[i]);
| ^~~
... |
s599566180 | p03673 | C++ | #include <iostream>
#include<string>
#include<vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
vector<long long int>vec_a,vec_b;
for (int i = 0; i < n; i++)
{
int num;
cin >> num;
vec_a.push_back(num);
}
for (int i = 0; i < n; i++)
{
vec_b.push_back(vec_a[i]);
reverse(... | a.cc: In function 'int main()':
a.cc:28:10: error: expected '}' at end of input
28 | }
| ^
a.cc:8:1: note: to match this '{'
8 | {
| ^
|
s818969980 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<long> a(n),b(n);
for(int i=0; i<n; i++){
cin >> a.at(i);
}
if(n%2){
for(int i=0; i<n; i++){
if(i<(n+1)/2){cout << a.at(n-1-2*i) << ' ';}
else if(i!=n-1){cout << a.at(2*i-n) << ' ';}
else{cout << a... | a.cc: In function 'int main()':
a.cc:20:8: error: 'i' was not declared in this scope
20 | if(i<n/2){cout << a.at(n-1-2*i) << ' ';}
| ^
|
s099234354 | p03673 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int n; cin>>n;
deque<int> Q;
rep(i,n){
int a; cin>>a;
if(i%2==0) Q.emplace_back(a);
else Q.emplace_front(a);
}
if(i%2==0){
rep(i,n) cout<<Q[i]<<endl;
}
else{
rep(i,n) cout<<Q[n-i-1]<<endl;
}
r... | a.cc: In function 'int main()':
a.cc:16:12: error: 'i' was not declared in this scope
16 | if(i%2==0){
| ^
|
s836424812 | p03673 | C | #include<cstdio>
int n,a[200010];
inline int read(){
register int ret=0;char c=getchar();
while(c<'0'||c>'9')c=getchar();
while(c>='0'&&c<='9')ret=(ret<<1)+(ret<<3)+(c^48),c=getchar();
return ret;
}
int main()
{
n=read();
for(register int i=1;i<=n;++i)a[i]=read();
for(register int i=n;i>0;i... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s513103768 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main()
{
int n;
cin >> n;
vector<int> a;
vector<int> b;
int j = 0;
rep(i, n){
cin >> a[i];
b.push_back(a[i]);
reverse(b.begin, b.end);
}
reverse(b.begin, b.end);
rep(i... | a.cc: In function 'int main()':
a.cc:14:16: error: no matching function for call to 'reverse(<unresolved overloaded function type>, <unresolved overloaded function type>)'
14 | reverse(b.begin, b.end);
| ~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
... |
s839149597 | p03673 | C++ | #include <iostream>
#include <vector>
#include <list>
using namespace std;
int main(){
int n;cin>>n;
vector<long long> sequence(n);for (int i=0;i<n;i++){cin>>sequence[i];}
list<long long> output;
for(int i=0;i<n;i++){
if (i%2==0){
if (n%2==0){
output.push_back(sequen... | a.cc: In function 'int main()':
a.cc:26:32: error: no match for 'operator-' (operand types are 'std::__cxx11::list<long long int>::iterator' and 'int')
26 | if (it == output.end() - 1){
| ~~~~~~~~~~~~ ^ ~
| | |
| |... |
s140866582 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
cin>>n;
int a;
vector<int> v;
for (int i=0;i<n;i++) {
cin>>a;
if (i%2==0)
v.push_back(a);
else
v.insert(0,a);
}
if (n%2)
reverse(v.begin(),v.end())... | a.cc: In function 'int main()':
a.cc:15:21: error: no matching function for call to 'std::vector<int>::insert(int, int&)'
15 | v.insert(0,a);
| ~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
fr... |
s720986286 | p03673 | C++ | #include<iostream>
#include<vecor>
using namespace std;
int main(){
int n;
int i;
cin >> n;
vector<int> a(n+1);
for(i=1; i <= n; i++){
int tmp;
cin >> tmp;
a[i] = tmp;
}
if(n%2){
for(i=n; i>0; i-=2){
cout << a[i];
}
for(i=2; i<n; i+=2){
cout << a[i];
}
} else {
for(i=n; i>1; i-=2){
cou... | a.cc:2:9: fatal error: vecor: No such file or directory
2 | #include<vecor>
| ^~~~~~~
compilation terminated.
|
s547137393 | p03673 | 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:52:12: error: 'N' was not declared in this scope
52 | rep(i, N) {
| ^
a.cc:29:32: note: in definition of macro 'rep'
29 | #define rep(i,n) for(int i=0;i<n;i++)
| ^
|
s011774365 | p03673 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int M... | a.cc: In function 'int main()':
a.cc:55:31: error: expected ';' before '}' token
55 | b.push_front(a[i])
| ^
| ;
56 | }
| ~
|
s899229737 | p03673 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int M... | a.cc: In function 'int main()':
a.cc:53:18: error: no matching function for call to 'std::vector<long long int>::reserve()'
53 | b.reserve();
| ~~~~~~~~~^~
In file included from /usr/include/c++/14/vector:72,
from /usr/include/c++/14/functional:64,
from /usr/in... |
s134928021 | p03673 | C++ | #include <iostream>
#include <vector>
int main()
{
int n;
std::cin >> n;
std::vector<int> as;
for(int i=0; i<n; i++)
{
int a;
std::cin >> a;
as.push_back(a);
}
std::vector<int> bs;
for(int i=((as.size()-1)/2)*2; 0<=i; i-=2)
{
bs.push_back(as[i]);
}
for(int i=1; i<as.size(); i+=2... | a.cc: In function 'int main()':
a.cc:28:28: error: 'reverse' is not a member of 'std'
28 | if( ! evenFirst ) { std::reverse(bs.begin(), bs.end()); }
| ^~~~~~~
|
s584316112 | p03673 | C++ | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
using namespace std;
#define INF 1000000007
using P = pair<int, int>;
using ll ... | a.cc: In function 'int main()':
a.cc:28:29: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
28 | for(int i=0;i<k.size();k++)cout<<k[i]<<" ";
| ~^~
|
s066428577 | p03673 | C++ | #include<stdio.h>
#include<vector>
#include<iostream>
#include<deque>
using namespace std;
int main() {
int n; cin >> n;
deque<int> b;
for(int i = 0; i < n; i++){
int tmp; cin >> tmp;
if(i % 2 == 0){
b.push_back(tmp);
}else{
b.push_front(tmp);
}
}
if(n % 2 != 0){
reverse(b.be... | a.cc: In function 'int main()':
a.cc:20:5: error: 'reverse' was not declared in this scope
20 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s227127524 | p03673 | C++ | #include<stdio.h>
#include<vector>
#include<iostream>
using namespace std;
int main() {
int n; cin >> n;
vector<int> b;
for(int i = 0; i < n; i++){
int tmp;
cin >> tmp;
b.push_back(tmp);
reverse(b.begin(), b.end());
}
for(int x: b){
cout << x << " ";
}
}
| a.cc: In function 'int main()':
a.cc:15:5: error: 'reverse' was not declared in this scope
15 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s367856027 | p03673 | C++ | #include<bits.stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int>a(n);
for(int i=0; i<n; ++i){
cin >> a[i];
reverse(a.begin(), a.end());
}
for(int i=0; i<n; ++i){
cout << a[i] << endl;
}
| a.cc:1:9: fatal error: bits.stdc++.h: No such file or directory
1 | #include<bits.stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s766116632 | p03673 | C | #include<stdio.h>
int main(){
int i,j,k,n,left,right;
left=249999;
right=250001;
int A[500000];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d ",&k);
if(i==0){
A[250000]=k;
}
else{
if(n%2 == (i+1)%2){
A[left--]=k;
}
else
A[right++]=k;
}
}
f... | main.c: In function 'main':
main.c:25:5: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
25 | pritnf("%d ",&A[i]);
| ^~~~~~
| printf
|
s307703167 | p03673 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
int N;
cin >> N;
vector<int>num(N,0);
for(int i=0;i<N;i++){
cin >> num[i];
}
vector<int>ans;
for(int i=0;i<num.size();i++){
ans.push_back(num[i]);
reverse(ans,ans + ans.size());
}
for(i... | a.cc: In function 'int main()':
a.cc:17:21: error: no match for 'operator+' (operand types are 'std::vector<int>' and 'std::vector<int>::size_type' {aka 'long unsigned int'})
17 | reverse(ans,ans + ans.size());
| ~~~ ^ ~~~~~~~~~~
| | |
| ... |
s989422605 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for(int i=0;i<n;i++){
cin >> a.ats(i);
}
if(n == 1){
cout << a.at(0) << endl;
}
else if(n%2 == 0){
vector<int> b(n/2);
vector<int> c(n/2);
for(int i=0;i<n;i++){
if(i%2 == 0){
... | a.cc: In function 'int main()':
a.cc:9:14: error: 'class std::vector<int>' has no member named 'ats'; did you mean 'at'?
9 | cin >> a.ats(i);
| ^~~
| at
|
s246178372 | p03673 | C++ | #include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
typedef long long int ll;
using namespace std;
int main()
{
int n;
cin >> n;
vector<ll> b(n);
vector<ll> a(n);
for(int i=0; i<n; i++){
cin >> a.at(i);
}
if(n%2==0){
for(int i=n-1; i>=0... | a.cc:38:1: error: 'pro' does not name a type
38 | pro
| ^~~
|
s088193178 | p03673 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
int main() {
int n,a[200000];
cin >> n;
for(int i=0; i<n; i++) {
cin >> a[i];
}
for(int i=n-1; i>=0; i-=2) {
cout << a[i] << " ";
}
for(int i=n%2; i<n; i+=2) {
cout << a[i] << " ";
}... | a.cc:8:2: error: extended character is not valid in an identifier
8 | int n,a[200000];
| ^
a.cc: In function 'int main()':
a.cc:8:2: error: '\U00003000int' was not declared in this scope
8 | int n,a[200000];
| ^~~~~
a.cc:9:10: error: 'n' was not declared in this scope; did you mean 'yn'?
... |
s902742129 | p03673 | C++ | #include"bits/stdc++.h"
using namespace std;
int n,a[200005];
vector<int> p;
main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
p.push_back(a[i]);
reverse(p.begin(),p.end());
}
for(int i=0;i<n;i++){
if(i==0){
cout<<a[i];
continue;
}
cout<<<<" "<<a[i];
}
cout<<endl;
} | a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:18:11: error: expected primary-expression before '<<' token
18 | cout<<<<" "<<a[i];
| ^~
|
s660229183 | p03673 | C++ | #include"bits/stdc++.h"
using namespace std;
int n,a[200005];
vector<int> p;
main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
p.push_back(a[i]);
reverse(p.begin(),p.end());
}
for(int i=0;i<n;i++){
if(i==0){
cout<<a[i];
continue;
}
cout<<<<" "<<a[i];
}
cout<<endl;
| a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:18:11: error: expected primary-expression before '<<' token
18 | cout<<<<" "<<a[i];
| ^~
a.cc:20:14: error: expected '}' at end of input
20 | ... |
s871380251 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n), b;
b.reverve(n);
for(int i=0; i<n; i++)
cin >> a.at(i);
b.push_back(a.at(0));
for(int i=1; i<n; i++){
b.push_back(a.at(i));
reverse(b.begin(), b.end());
}
for(int i=0; i<n; i++){
cout... | a.cc: In function 'int main()':
a.cc:8:5: error: 'class std::vector<int>' has no member named 'reverve'; did you mean 'reserve'?
8 | b.reverve(n);
| ^~~~~~~
| reserve
|
s710209839 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for(int i = 0; i < n; i++){
a[i] = sc.nextInt();
}
if(n%2 == 0){
for(int i =... | Main.java:26: error: reached end of file while parsing
}
^
1 error
|
s762656612 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<Integer> b = new ArrayList<Integer>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt... | Main.java:17: error: method reverse in class Collections cannot be applied to given types;
Collections.reverse();
^
required: List<?>
found: no arguments
reason: actual and formal argument lists differ in length
1 error
|
s193488275 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<int> b = new ArrayList<int>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt();
... | Main.java:9: error: unexpected type
List<int> b = new ArrayList<int>();
^
required: reference
found: int
Main.java:9: error: unexpected type
List<int> b = new ArrayList<int>();
^
required: reference
found: int
Main.java:17: error: method rev... |
s524671208 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<int> b = new ArrayList<int>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt();
... | Main.java:21: error: '[' expected
int s = new int(b.get(i));
^
Main.java:21: error: ']' expected
int s = new int(b.get(i));
^
2 errors
|
s436753292 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<int> b = new ArrayList<int>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt();
... | Main.java:21: error: '[' expected
inr s = new int(b.get(i));
^
Main.java:21: error: ']' expected
inr s = new int(b.get(i));
^
2 errors
|
s536209290 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<String> b = new ArrayList<String>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt()... | Main.java:16: error: incompatible types: int cannot be converted to String
b.add(a[i]);
^
Main.java:17: error: method reverse in class Collections cannot be applied to given types;
Collections.reverse();
^
required: List<?>
found: no arguments
r... |
s346870211 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<String> b = new ArrayList<String>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt()... | Main.java:21: error: '[' expected
int s = new int(b.get(i));
^
Main.java:21: error: ']' expected
int s = new int(b.get(i));
^
2 errors
|
s851024582 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<String> b = new ArrayList<String>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt();
... | Main.java:15: error: array required, but List<String> found
b[i] = a[i];
^
Main.java:16: error: method reverse in class Collections cannot be applied to given types;
Collections.reverse();
^
required: List<?>
found: no arguments
reason: actual and fo... |
s668434435 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<String> b = new ArrayList<String>();
for(int i=0; i<n; i++){
a[i] = sc.nextInt();
... | Main.java:15: error: array required, but List<String> found
b[0] = a[i];
^
Main.java:16: error: method reverse in class Collections cannot be applied to given types;
Collections.reverse();
^
required: List<?>
found: no arguments
reason: actual and fo... |
s824709148 | p03673 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
List<String> b = new ArrayList<String>();
for(int i=0; i<n; i++){
a[] = sc.nextInt();
... | Main.java:11: error: not a statement
a[] = sc.nextInt();
^
Main.java:11: error: ';' expected
a[] = sc.nextInt();
^
2 errors
|
s413528514 | p03673 | C++ | #include<utility>
#include<vector>
using namespace std;
int main(void){
int n;
scanf("%d",&n);
int a[n];
vector<int> b;
for(int i = 0;i < n;i++){
int p;
scanf("%d",&p);
a[i] = p;
}
for(int i = 0;i < n;i++){
int I = i;
b.push_back(a[i]);
for(int z = 0;z <= I;z++){
swap(b[z],b... | a.cc: In function 'int main()':
a.cc:7:3: error: 'scanf' was not declared in this scope
7 | scanf("%d",&n);
| ^~~~~
a.cc:25:5: error: 'printf' was not declared in this scope
25 | printf("%d ",p);
| ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable b... |
s317545579 | p03673 | C | #include <stdio.h>
#include <stdlib.h>
typedef struct
{
long weight;
long parent,rchild,lchild;
} HTNode, *HuffmanTree;
HTNode HT[100001];
typedef long **HuffmanCode;
typedef struct temp_result
{
long s1;
long s2;
} temp_re;
temp_re select(HuffmanTree HT,long n)
{
long i,s,flag=0;
HuffmanTree p;... | main.c:15:9: error: conflicting types for 'select'; have 'temp_re(struct <anonymous> *, long int)' {aka 'struct temp_result(struct <anonymous> *, long int)'}
15 | temp_re select(HuffmanTree HT,long n)
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /u... |
s670364623 | p03673 | C | #include <stdio.h>
#include <stdlib.h>
typedef struct
{
long weight;
long parent,rchild,lchild;
} HTNode, *HuffmanTree;
HTNode HT[100001];
typedef long **HuffmanCode;
typedef struct temp_result
{
long s1;
long s2;
} temp_re;
temp_re select(HuffmanTree HT,long n)
{
long i,s,flag=0;
HuffmanTree p;... | main.c:15:9: error: conflicting types for 'select'; have 'temp_re(struct <anonymous> *, long int)' {aka 'struct temp_result(struct <anonymous> *, long int)'}
15 | temp_re select(HuffmanTree HT,long n)
| ^~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:179,
from /u... |
s146902224 | p03673 | C | #include<stdio.h>
#include<stack>
#include<queue>
using namespace std;
int main()
{
int n,i,j;
long long x;
stack<long long>s;
queue<long long>q;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%lld",&x);
q.push(x);
for(j=0;j<=i;j++)
{
s.push(q.front());
q.pop();
}
for(j=0;j<=i;j++)
{
q.push(s.t... | main.c:2:9: fatal error: stack: No such file or directory
2 | #include<stack>
| ^~~~~~~
compilation terminated.
|
s086991512 | p03673 | C | #include<iostream>
#include<queue>
#include<cstdio>
using namespace std;
int main()
{
deque<int> ans;
int n;
scanf("%d",&n);
for(int i = 1; i<=n; i++)
{
int num;
scanf("%d",&num);
if(i&1)
ans.push_front(num);
else
ans.push_back(num);
}
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s378127159 | p03673 | C++ | #include<iostream>
using namespace std;
int main() {
int n; cin >> n;
string s;
for (int i = 0; i < n; ++i) {
char ch; cin >> ch;
s += ch;
reverse(s.begin(), s.end());
}
for (int i = 0; i < s.size(); ++i) {
cout << s[i] << " ";
}
cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:9: error: 'reverse' was not declared in this scope
9 | reverse(s.begin(), s.end());
| ^~~~~~~
|
s635053472 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pii;
typedef vector<ll> Vi;
typedef vector<Vi> VVi;
const double EPS = (1e-7);
const ll INF =(1e13);
const double PI = (acos(-1));
const ll MOD = ll(1e9) + 7;
#define REP(i, n) for(ll i = 0; i < (ll)(n... | a.cc: In function 'int main()':
a.cc:48:44: error: overloaded function with no contextual type information
48 | cout << a[i] << ((i == N - 2) ? endl : ' ') ;
| ^~~
|
s255470072 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n;
vector<int> a(n);
for(int i=0; i<n; i++) cin>>a.at(i);
vector<int> b(0);
for(int i=0; i<n; i++){
b.push_back(a.at(i));
reverse(b.begin(),b.end());
}
for(int i=0; i<n; i++){
if(i==n-1;) cout<<b.at(i)<<endl;
else cout<<... | a.cc: In function 'int main()':
a.cc:13:15: error: expected primary-expression before ')' token
13 | if(i==n-1;) cout<<b.at(i)<<endl;
| ^
|
s140095390 | p03673 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main() {
vector<int>b;
int n, a;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a;
b.push_back(a);
reverse(b.begin(), b.end());
}
for (int i = 0; i < n; i++) {
cout << b[i];
if (i != n - 1) {
cout << ' ';
}
}
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:17: error: 'reverse' was not declared in this scope
12 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s127439583 | p03673 | C++ | #include<iostream>
#include<vector>
using namespace std;
vector<int>b;
void swap() {
reverse(b.begin(), b.end());
}
int main() {
int n, a;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a;
b.push_back(a);
swap();
}
for (int i = 0; i < n; i++) {
cout << b[i];
if (not i != n - 1) {
cout << ' ';
... | a.cc: In function 'void swap()':
a.cc:8:9: error: 'reverse' was not declared in this scope
8 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s716433581 | p03673 | C++ | #include<iostream>
#include<vector>
using namespace std;
vector<int>b;
void swap() {
reverse(b.begin(), b.end());
}
int main() {
int n, a;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a;
b.push_back(a);
swap();
}
for (int i = 0; i < n; i++) {
cout << b[i] << ' ';
}
cout << endl;
return 0;
} | a.cc: In function 'void swap()':
a.cc:8:9: error: 'reverse' was not declared in this scope
8 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s763936355 | p03673 | C++ | #include<iostream>
#include<vector>
using namespace std;
vector<int> swap(vector<int>b) {
reverse(b.begin(), b.end());
return b;
}
int main() {
vector<int>b;
int n, a;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a;
b.push_back(a);
b = swap(b);
}
for (int i = 0; i < b.size(); i++) {
cout << b[i] << ... | a.cc: In function 'std::vector<int> swap(std::vector<int>)':
a.cc:6:9: error: 'reverse' was not declared in this scope
6 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s392756725 | p03673 | Java | import java.util.Scanner;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Collections;
public class Main {
public static void main(String args[]) throws InterruptedException {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
List<Integer> list =... | Main.java:12: error: incompatible types: int cannot be converted to Collection<? extends Integer>
List<Integer> list = new LinkedList<Integer>(n);
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
|
s692232016 | p03673 | Java | import java.util.*;public class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);int n=s.nextInt();int[]m=new int[n];for(int i=0;i<n;i++)m[i]=sc.nextInt();for(int i=n-1;i>=0;i-=2)System.out.print(m[i]+" ");for(int i=n%2;i<n;i+=2)System.out.print(m[i]+" ");}} | Main.java:1: error: cannot find symbol
import java.util.*;public class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);int n=s.nextInt();int[]m=new int[n];for(int i=0;i<n;i++)m[i]=sc.nextInt();for(int i=n-1;i>=0;i-=2)System.out.print(m[i]+" ");for(int i=n%2;i<n;i+=2)System.out.print(m[i]+" ");}... |
s072990018 | p03673 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include<iomanip>
using namespace std;
int main(){
int n; cin >> n;
vector<long long int> a, b(0);
long s;
for(int i = 0; i < n; i++){
cin >> a;
if((n + i) % 2 == 0){
b.push_back(a);
} else {
b.insert(b.begin(), a)... | a.cc: In function 'int main()':
a.cc:13:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<long long int>')
13 | cin >> a;
| ~~~ ^~ ~
| | |
| | std::vector<long long int>
| std::istream {aka std... |
s798737275 | p03673 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include<iomanip>
using namespace std;
int main(){
int n; cin >> n;
vector<long> a, b(0);
long s;
for(int i = 0; i < n; i++){
cin >> a;
if((n + i) % 2 == 0){
b.push_back(a);
} else {
b.insert(b.begin(), a);
}
... | a.cc: In function 'int main()':
a.cc:13:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<long int>')
13 | cin >> a;
| ~~~ ^~ ~
| | |
| | std::vector<long int>
| std::istream {aka std::basic_is... |
s673053238 | p03673 | C++ | #include<bits/stdc++.h>
#include<deque>
#include<iomanip>
using namespace std;
int main(){
int n; cin >> n;
vector<long> a(0), b(0);
long s;
for(int i = 0; i < n; i++){
cin >> a[i];
if((n + i) % 2 == 0){
b.push_back(a[i]);
} else {
b.insert(b.begin(), a);
}
}
for(int i = 0; i ... | a.cc: In function 'int main()':
a.cc:16:15: error: no matching function for call to 'std::vector<long int>::insert(std::vector<long int>::iterator, std::vector<long int>&)'
16 | b.insert(b.begin(), a);
| ~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
fr... |
s088457589 | p03673 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s058255504 | p03673 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
vector<int>a;
int n;
cin >> n;
for(int i=0;i<n;i++){
int k;
cin >> k;
if (i&1){
a.insert(a.begin(),k);
}
else{
a.puch_back(k);
}
if (a.size()&1){
re... | a.cc: In function 'int main()':
a.cc:16:15: error: 'class std::vector<int>' has no member named 'puch_back'; did you mean 'push_back'?
16 | a.puch_back(k);
| ^~~~~~~~~
| push_back
a.cc:19:39: error: expected ';' before '}' token
19 | reverse(a.begin(... |
s967455033 | p03673 | C++ | /**
* ABc 66 C
* author : kyomukyomupurin
* created : 2018-09-08 08:56:37
**/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n; cin >> n;
int a[n];
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
int start... | a.cc: In function 'int main()':
a.cc:28:42: error: expected ';' before '}' token
28 | b[i] = a[2 * (start - i) - 1]
| ^
| ;
29 | }
| ~
|
s365170578 | p03673 | C++ | #include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n, p;
vector<int> b;
b.clear();
cin >> n;
vector<int> a;
for(int i=0;i<n;i++){
cin >> p;
a.push_back(p);
}
for(int i=0;i<n;i++){
b.push_back(a[i]);
reverse(b.begin(), b.end());
}
for(int i=0;i<n;i++) co... | a.cc: In function 'int main()':
a.cc:22:17: error: 'reverse' was not declared in this scope
22 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s122615538 | p03673 | C++ | #include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n, p;
vector<int> b;
b.clear();
cin >> n;
vector<int> a;
for(int i=0;i<n;i++){
cin >> p;
a.push_back(p);
}
for(int i=0;i<n;i++){
b.push_back(a[i]);
reverse(b.begin(), b.end());
}
for(int i=0;i<n;i++) co... | a.cc: In function 'int main()':
a.cc:22:17: error: 'reverse' was not declared in this scope
22 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s241327683 | p03673 | C++ | #include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i=0;i<n-1;i++) cin >> a[i];
vector<int> b;
b.clear();
for(int i=0;i<n;i++){
b.push_back(a[i]);
reverse(b.begin(), b.end());
}
for(int i=0;i<n;i++) cout << b[i] << " ";
cout ... | a.cc: In function 'int main()':
a.cc:21:17: error: 'reverse' was not declared in this scope
21 | reverse(b.begin(), b.end());
| ^~~~~~~
|
s719437885 | p03673 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll,... | a.cc: In function 'int main()':
a.cc:35:4: error: expected primary-expression before 'auto'
35 | *auto itr = deq.begin();
| ^~~~
a.cc:36:9: error: 'itr' was not declared in this scope
36 | while(itr!=deq.end()){
| ^~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.