submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s236550833
|
p00001
|
C++
|
import scala.io.Source
object Main extends App {
val src = Source.io.stdin.getLines.map(_.toInt).toList
val top3: List[Int] = src.sortWith(_<_).take(3)
top3.map(println)
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import scala.io.Source
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s613382480
|
p00001
|
C++
|
#include<iostream>
#include <vector>
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define REPI(i,a,b) for(int i=(int)a;i<(int)b;++i)
using namespace std;
void solver() {
vector<int> m;
REP(i,10){
int n;
cin>>n;
m.push_back(n);
}
sort(m.begin(),m.end(),greater<int>());
REP(i,3){
cout<<m[i]<<endl;
}
}
int main() {
solver();
}
|
a.cc: In function 'void solver()':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(m.begin(),m.end(),greater<int>());
| ^~~~
| short
|
s823171719
|
p00001
|
C++
|
#include<iostream>
#include <vector>
#define REP(i,n) for(int i=0;i<(int)n;++i)
using namespace std;
void solver() {
vector<int> m;
REP(i,10){
int n;
cin>>n;
m.push_back(n);
}
sort(m.begin(),m.end(),greater<int>());
REP(i,3){
cout<<m[i]<<endl;
}
}
int main() {
solver();
return 0;
}
|
a.cc: In function 'void solver()':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(m.begin(),m.end(),greater<int>());
| ^~~~
| short
|
s564144293
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int first = 0;
int second = 0;
int third = 0;
for(int i = 0; i < 10; i++){
int num;
if(first <= num){
third = second;
second = first;
first = num;
}else if((second <= num) && (num < first) ){
thid = second;
second = num;
}else if((third <= num) && (num < second)){
third = num;
}else{
//???????????????
}
}
cout << first << endl;
cout << second << endl;
cout << third << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:25: error: 'thid' was not declared in this scope; did you mean 'third'?
17 | thid = second;
| ^~~~
| third
|
s162476237
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int first = 0;
int second = 0;
int third = 0;
for(int i = 0; i < 10; i++){
int num;
cin >> num;
if(first <= num){
third = second;
second = first;
first = num;
}else if((second <= num) && (num < first) ){
thid = second;
second = num;
}else if((third <= num) && (num < second)){
third = num;
}else{
//???????????????
}
}
cout << first << endl;
cout << second << endl;
cout << third << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:25: error: 'thid' was not declared in this scope; did you mean 'third'?
19 | thid = second;
| ^~~~
| third
|
s181943190
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int data[10]={0};
for (int A=0;A<10;A++){
cin>>data[A];
}
sort(A,A+10);
cout<<data[9]<<data[8]<<data[7];
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:14: error: 'A' was not declared in this scope
9 | sort(A,A+10);
| ^
|
s508317959
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
vector<int> yama(10);
for(int i=0;i<10;i++){
cin >> yama[i];
}
sort(yama.begin(),yama.end);
cout << yama[9] << "\n" << yama[8] << "\n" << yama[7] << "\n";
}
|
a.cc: In function 'int main()':
a.cc:12:9: error: no matching function for call to 'sort(std::vector<int>::iterator, <unresolved overloaded function type>)'
12 | sort(yama.begin(),yama.end);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
|
s557077612
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int a[15];
int main(){
for(int i=0;i<10;i++) cin >> a[i];
sort(a,a+n);
cout << a[9] << endl << a[8] << endl << a[7] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:14: error: 'n' was not declared in this scope
8 | sort(a,a+n);
| ^
|
s261342913
|
p00001
|
C++
|
#include<iostream>
#include<array>
int main(void){
std::array<int,10> h;
int tmp;
for(auto& e : h){
std::cin>>e;
}
std::sort(h.begin(),h.end());
for(int i=0;i<3;i++){
std::cout<<h[i]<<std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:6: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
9 | std::sort(h.begin(),h.end());
| ^~~~
| qsort
|
s373521207
|
p00001
|
C++
|
#include<iostream>
#include<array>
int main(void){
std::array<int,10> h;
int tmp;
for(auto& e : h){
std::cin>>e;
}
std::sort(h.begin(),h.end());
for(int i=0;i<3;i++){
std::cout<<h[i]<<std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:6: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
9 | std::sort(h.begin(),h.end());
| ^~~~
| qsort
|
s850927147
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
int main(void){
std::vector<int> h;
int tmp;
while(std::cin>>tmp){
h.push_back(tmp);
}
std::sort(h.begin(),h.end());
std::uniq(h.begin(),h.end());
for(int i=0;i<3;i++){
std::cout<<h[i]<<std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:6: error: 'uniq' is not a member of 'std'; did you mean 'unique'?
11 | std::uniq(h.begin(),h.end());
| ^~~~
| unique
|
s187025105
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
int main(void){
std::vector<int> h;
int tmp;
while(std::cin>>tmp){
h.push_back(tmp);
}
std::sort(h.begin(),h.end());
auto p=std::unique(h.begin(),h.end());
std::cout<<p++<<std::endl;
std::cout<<p++<<std::endl;std::cout<<p<<std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
12 | std::cout<<p++<<std::endl;
| ~~~~~~~~~^~~~~
| | |
| | __gnu_cxx::__normal_iterator<int*, std::vector<int> >
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::ba
|
s626114326
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int a, max1, max2, max3;
max1 = max2 = max3 = INT_MIN;
while(cin >> a)
{
if(a > max3)
{
max3 = a;
if(a > max1)
{
max3 = max2;
max2 = max1;
max1 = a;
}
else if( a > max2)
{
max3 = max2;
max2 = a;
}
}
} cout << max1 << endl << max2 << endl << max3 <<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:27: error: 'INT_MIN' was not declared in this scope
8 | max1 = max2 = max3 = INT_MIN;
| ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#include <climits>
2 |
|
s043748975
|
p00001
|
C++
|
fn main(){
let mut hs: Vec<i32> = vec![];
for _i in 0..10{
let n=readln();
hs.push(n);
}
hs.sort();
for i in (7..10).rev(){
println!("{}",hs[i]);
}
}
// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
pub trait FromLn {
fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
let mut buf = String::new();
let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
let mut vs = vec![];
for _ in 0..n {
vs.push(readln());
}
vs
}
macro_rules! fromln_primitives {
($($t:ty),*) => { $(
impl FromLn for $t {
fn fromln(s: &str) -> $t {
s.parse().unwrap()
}
}
)* }
}
fromln_primitives!(
String,
bool,
f32,
f64,
isize,
i8,
i16,
i32,
i64,
usize,
u8,
u16,
u32,
u64
);
impl<T> FromLn for Vec<T>
where
T: FromLn,
{
fn fromln(s: &str) -> Vec<T> {
s.split_whitespace().map(T::fromln).collect()
}
}
impl FromLn for Vec<char> {
fn fromln(s: &str) -> Vec<char> {
s.chars().collect()
}
}
macro_rules! fromln_tuple {
($($t:ident),*) => {
impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
fn fromln(s: &str) -> ($($t),*) {
let mut it = s.split_whitespace();
let t = ($($t::fromln(it.next().unwrap())),*);
assert_eq!(it.next(), None);
t
}
}
}
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);
|
a.cc:3:15: error: too many decimal points in number
3 | for _i in 0..10{
| ^~~~~
a.cc:8:15: error: too many decimal points in number
8 | for i in (7..10).rev(){
| ^~~~~
a.cc:15:2: error: invalid preprocessing directive #[
15 | #[allow(unused_imports)]
| ^
a.cc:17:2: error: invalid preprocessing directive #[
17 | #[allow(unused_imports)]
| ^
a.cc:29:14: error: too many decimal points in number
29 | for _ in 0..n {
| ^~~~
a.cc:1:1: error: 'fn' does not name a type
1 | fn main(){
| ^~
a.cc:16:1: error: 'use' does not name a type
16 | use std::cmp::{max, min};
| ^~~
a.cc:19:1: error: 'pub' does not name a type
19 | pub trait FromLn {
| ^~~
a.cc:22:1: error: 'pub' does not name a type
22 | pub fn readln<T: FromLn>() -> T {
| ^~~
a.cc:27:1: error: 'pub' does not name a type
27 | pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
| ^~~
a.cc:34:1: error: 'macro_rules' does not name a type
34 | macro_rules! fromln_primitives {
| ^~~~~~~~~~~
a.cc:43:1: error: 'fromln_primitives' does not name a type
43 | fromln_primitives!(
| ^~~~~~~~~~~~~~~~~
a.cc:59:1: error: 'impl' does not name a type
59 | impl<T> FromLn for Vec<T>
| ^~~~
a.cc:67:1: error: 'impl' does not name a type
67 | impl FromLn for Vec<char> {
| ^~~~
a.cc:72:1: error: 'macro_rules' does not name a type
72 | macro_rules! fromln_tuple {
| ^~~~~~~~~~~
a.cc:84:1: error: 'fromln_tuple' does not name a type
84 | fromln_tuple!(A, B);
| ^~~~~~~~~~~~
a.cc:85:1: error: 'fromln_tuple' does not name a type
85 | fromln_tuple!(A, B, C);
| ^~~~~~~~~~~~
a.cc:86:1: error: 'fromln_tuple' does not name a type
86 | fromln_tuple!(A, B, C, D);
| ^~~~~~~~~~~~
a.cc:87:1: error: 'fromln_tuple' does not name a type
87 | fromln_tuple!(A, B, C, D, E);
| ^~~~~~~~~~~~
a.cc:88:1: error: 'fromln_tuple' does not name a type
88 | fromln_tuple!(A, B, C, D, E, F);
| ^~~~~~~~~~~~
|
s662195752
|
p00001
|
C++
|
fn main(){
let mut hs: Vec<i32> = vec![];
for _i in 0..10{
let n=readln();
hs.push(n);
}
hs.sort();
for i in (7..10).rev(){
println!("{}",hs[i]);
}
}
// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
pub trait FromLn {
fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
let mut buf = String::new();
let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
let mut vs = vec![];
for _ in 0..n {
vs.push(readln());
}
vs
}
macro_rules! fromln_primitives {
($($t:ty),*) => { $(
impl FromLn for $t {
fn fromln(s: &str) -> $t {
s.parse().unwrap()
}
}
)* }
}
fromln_primitives!(
String,
bool,
f32,
f64,
isize,
i8,
i16,
i32,
i64,
usize,
u8,
u16,
u32,
u64
);
impl<T> FromLn for Vec<T>
where
T: FromLn,
{
fn fromln(s: &str) -> Vec<T> {
s.split_whitespace().map(T::fromln).collect()
}
}
impl FromLn for Vec<char> {
fn fromln(s: &str) -> Vec<char> {
s.chars().collect()
}
}
macro_rules! fromln_tuple {
($($t:ident),*) => {
impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
fn fromln(s: &str) -> ($($t),*) {
let mut it = s.split_whitespace();
let t = ($($t::fromln(it.next().unwrap())),*);
assert_eq!(it.next(), None);
t
}
}
}
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);
|
a.cc:3:15: error: too many decimal points in number
3 | for _i in 0..10{
| ^~~~~
a.cc:8:15: error: too many decimal points in number
8 | for i in (7..10).rev(){
| ^~~~~
a.cc:15:2: error: invalid preprocessing directive #[
15 | #[allow(unused_imports)]
| ^
a.cc:17:2: error: invalid preprocessing directive #[
17 | #[allow(unused_imports)]
| ^
a.cc:29:14: error: too many decimal points in number
29 | for _ in 0..n {
| ^~~~
a.cc:1:1: error: 'fn' does not name a type
1 | fn main(){
| ^~
a.cc:16:1: error: 'use' does not name a type
16 | use std::cmp::{max, min};
| ^~~
a.cc:19:1: error: 'pub' does not name a type
19 | pub trait FromLn {
| ^~~
a.cc:22:1: error: 'pub' does not name a type
22 | pub fn readln<T: FromLn>() -> T {
| ^~~
a.cc:27:1: error: 'pub' does not name a type
27 | pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
| ^~~
a.cc:34:1: error: 'macro_rules' does not name a type
34 | macro_rules! fromln_primitives {
| ^~~~~~~~~~~
a.cc:43:1: error: 'fromln_primitives' does not name a type
43 | fromln_primitives!(
| ^~~~~~~~~~~~~~~~~
a.cc:59:1: error: 'impl' does not name a type
59 | impl<T> FromLn for Vec<T>
| ^~~~
a.cc:67:1: error: 'impl' does not name a type
67 | impl FromLn for Vec<char> {
| ^~~~
a.cc:72:1: error: 'macro_rules' does not name a type
72 | macro_rules! fromln_tuple {
| ^~~~~~~~~~~
a.cc:84:1: error: 'fromln_tuple' does not name a type
84 | fromln_tuple!(A, B);
| ^~~~~~~~~~~~
a.cc:85:1: error: 'fromln_tuple' does not name a type
85 | fromln_tuple!(A, B, C);
| ^~~~~~~~~~~~
a.cc:86:1: error: 'fromln_tuple' does not name a type
86 | fromln_tuple!(A, B, C, D);
| ^~~~~~~~~~~~
a.cc:87:1: error: 'fromln_tuple' does not name a type
87 | fromln_tuple!(A, B, C, D, E);
| ^~~~~~~~~~~~
a.cc:88:1: error: 'fromln_tuple' does not name a type
88 | fromln_tuple!(A, B, C, D, E, F);
| ^~~~~~~~~~~~
|
s133794079
|
p00001
|
C++
|
#include<stdio.h>
#include<algorithm>
int main() {
int m[10];
for (int i = 0; i < 10; i++)scanf("%d",%m[i]);
stable_sort(m, m + 10);
for (int i = 9; i > 6; i--)printf("%d\n",&m[i]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:44: error: expected primary-expression before '%' token
7 | for (int i = 0; i < 10; i++)scanf("%d",%m[i]);
| ^
a.cc:9:5: error: 'stable_sort' was not declared in this scope; did you mean 'std::stable_sort'?
9 | stable_sort(m, m + 10);
| ^~~~~~~~~~~
| std::stable_sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:306:1: note: 'std::stable_sort' declared here
306 | stable_sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~~~~~~~~
|
s651699984
|
p00001
|
C++
|
N = 10
a = []
for i in range(N):
a.append(input()) # 3度の入力に対して、1, 2, 3 と入力。
print(a) # ['1', '2', '3']
|
a.cc:4:23: error: stray '#' in program
4 | a.append(input()) # 3度の入力に対して、1, 2, 3 と入力。
| ^
a.cc:4:25: error: extended character 、 is not valid in an identifier
4 | a.append(input()) # 3度の入力に対して、1, 2, 3 と入力。
| ^
a.cc:4:53: error: extended character 。 is not valid in an identifier
4 | a.append(input()) # 3度の入力に対して、1, 2, 3 と入力。
| ^
a.cc:5:10: error: stray '#' in program
5 | print(a) # ['1', '2', '3']
| ^
a.cc:1:1: error: 'N' does not name a type
1 | N = 10
| ^
|
s244548962
|
p00001
|
C++
|
#include <stdio.h>
#include <functional>
int main(){
int mt[10], i;
std::sort(mt, mt + 10, std::greater<int>);
for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:8: error: 'sort' is not a member of 'std'
5 | std::sort(mt, mt + 10, std::greater<int>);
| ^~~~
a.cc:5:43: error: expected primary-expression before ')' token
5 | std::sort(mt, mt + 10, std::greater<int>);
| ^
|
s104736035
|
p00001
|
C++
|
#include <stdio.h> #include <functional> #include <algorithm<int main(){ int mt[10], i; std::sort(mt, mt + 10, std::greater<int>); for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0; }
|
a.cc:3:20: warning: extra tokens at end of #include directive
3 | #include <stdio.h> #include <functional> #include <algorithm<int main(){ int mt[10], i; std::sort(mt, mt + 10, std::greater<int>); for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s976900121
|
p00001
|
C++
|
#include <stdio.h> #include <functional> #include <algorithm>int main(){ int mt[10], i; std::sort(mt, mt + 10, std::greater<int>); for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0; }
|
a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> #include <functional> #include <algorithm>int main(){ int mt[10], i; std::sort(mt, mt + 10, std::greater<int>); for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s894300038
|
p00001
|
C++
|
#include <stdio.h> #include <functional> #include <algorithm> int main(){ int mt[10], i; std::sort(mt, mt + 10, std::greater<int>); for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0; }
|
a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> #include <functional> #include <algorithm> int main(){ int mt[10], i; std::sort(mt, mt + 10, std::greater<int>); for (i = 0; i < 3; i++) printf("%d", mt[i]);return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s409668558
|
p00001
|
C++
|
#include <stdio.h>
#include <functional>
#include <algorithm>
int main(){ int mt[10], i;
std::sort(mt, mt + 10
for (i = 9; i > 6; i--)
printf("%d\n", mt[i]);
return 0; }
|
a.cc: In function 'int main()':
a.cc:5:22: error: expected ')' before 'for'
5 | std::sort(mt, mt + 10
| ~ ^
| )
6 | for (i = 9; i > 6; i--)
| ~~~
a.cc:6:23: error: expected ';' before ')' token
6 | for (i = 9; i > 6; i--)
| ^
| ;
|
s732701117
|
p00001
|
C++
|
def main():
a=[]
for i in range(10):
a.append(int(input()))
a.sort()
for j in range(-1, -4, -1):
print(a[j])
|
a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s408690731
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int height[10];
for (int i = 0; i < 10; ++i) cin >> height[i];
sort(height, height + 10, greater<int>);
cout << height[0] << height[1] << height[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:43: error: expected primary-expression before ')' token
8 | sort(height, height + 10, greater<int>);
| ^
|
s390535229
|
p00001
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> v;
for(int i=0;i<10;i++){
int m;
cin >> m;
v.push_back(m);
}
sort(v.begin(), v.end(), greater<int>());
cout << v.at(0) << endl;
cout << v.at(1) << endl;
cout << v.at(2) << endl;
return 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(v.begin(), v.end(), greater<int>());
| ^~~~
| short
|
s785766708
|
p00001
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> v;
for(int i=0;i<10;i++){
int m;
cin >> m;
v.push_back(m);
}
sort(v.begin(), v.end(), greater<int>());
cout << v.at(0) << endl;
cout << v.at(1) << endl;
cout << v.at(2) << endl;
return 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(v.begin(), v.end(), greater<int>());
| ^~~~
| short
|
s053545783
|
p00001
|
C++
|
#include <stdio.h> using namespace std; int main(){ int count[10001],tmp,num=3; for(int i=0;i<10001;i++)count[i]=0; for(int i=0;i<10;i++){ scanf("%d",&tmp); count[tmp]++; } for(int i=10000;i>=0&&num>0;i--){ if(count[i]>0){ for(int k=0;k<count[i]&&num>0;k++){ printf("%d\n",i); num--; } } } return 0; }
|
a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> using namespace std; int main(){ int count[10001],tmp,num=3; for(int i=0;i<10001;i++)count[i]=0; for(int i=0;i<10;i++){ scanf("%d",&tmp); count[tmp]++; } for(int i=10000;i>=0&&num>0;i--){ if(count[i]>0){ for(int k=0;k<count[i]&&num>0;k++){ printf("%d\n",i); num--; } } } return 0; }
| ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s321659406
|
p00001
|
C++
|
#include <stdio.h>
using namespace std;
int main(){
int count[10001],
tmp,num=3;
for(int i=0;i<10001;i++){
count[i]=0;
for(int i=0;i<10;i++){
scanf("%d",&tmp);
count[tmp]++;
}
for(int i=10000;i>=0&&num>0;i--){
if(count[i]>0){
for(int k=0;k<count[i]&&num>0;k++){
printf("%d\n",i);
num--;
}
}
}
return 0; }
|
a.cc: In function 'int main()':
a.cc:28:12: error: expected '}' at end of input
28 | return 0; }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s650441881
|
p00001
|
C++
|
#include <iostream>
#include <map>
using namespace std;
int main() {
multimap<int, greater<int>> mp; int temp; int c = 0;
while (cin >> temp) { mp[c] = temp; c++; }
for (int i = 0; i < 3; i++) cout << mp[i] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:33: error: no match for 'operator[]' (operand types are 'std::multimap<int, std::greater<int> >' and 'int')
7 | while (cin >> temp) { mp[c] = temp; c++; }
| ^
a.cc:8:47: error: no match for 'operator[]' (operand types are 'std::multimap<int, std::greater<int> >' and 'int')
8 | for (int i = 0; i < 3; i++) cout << mp[i] << endl;
| ^
|
s605296076
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int mt[10];
for(int i=0;i<10;i++)
cin >> mt[i];
sort(mt,mt+10,greater<int>());
for(int i=0;i<3;i++)
cout << mt[i] << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(mt,mt+10,greater<int>());
| ^~~~
| short
|
s175714243
|
p00001
|
C++
|
#include <iostream>
using namespace std;
main() {
int a[10];
for(int i=0;i<10;i++) scanf("%d",&a[i]);
sort(a,a+10,greater<int>());
printf("%d\n%d\n%d\n",a[0],a[1],a[2]);
}
|
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:6:3: error: 'sort' was not declared in this scope; did you mean 'short'?
6 | sort(a,a+10,greater<int>());
| ^~~~
| short
|
s964713549
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
#include<function>
using namespace std;
int main()
{
int i;
int a;
vector<int> num;
for(i=0;i<10;i++)
{
cin >> a ;
num.push_back(a);
}
sort(num.begin(),num.end(),greater<int>());
for(i=0;i<3;i++)
cout << num[i] << endl;
}
|
a.cc:4:9: fatal error: function: No such file or directory
4 | #include<function>
| ^~~~~~~~~~
compilation terminated.
|
s419566415
|
p00001
|
C++
|
#include<stdio.h>
#include<algorithm>
main(){int a[10],i;for(i=0;i<10;i++)cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
|
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){int a[10],i;for(i=0;i<10;i++)cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:37: error: 'cin' was not declared in this scope
3 | main(){int a[10],i;for(i=0;i<10;i++)cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^~~
|
s391489068
|
p00001
|
C++
|
#include<stdio.h>
#include<algorithm>
main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
|
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:42: error: 'cin' is not a member of 'std'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<algorithm>
+++ |+#include <iostream>
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
|
s831714423
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
|
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:45: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ~~~~~~~~^~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:3:45: note: candidate: 'operator<<(int, int)' (built-in)
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ~~~~~~~~^~~~~~
a.cc:3:45: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:3:42: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ~~~~~^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:3:50: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
3 | main(){int a[10],i;for(i=0;i<10;i++)std::cin<<a[i];std::sort(a,a+10);printf("%d%d%d\n",a[0],a[1],a[2]);}
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/s
|
s083307368
|
p00001
|
C++
|
#include<iostream>#include<algorithm>#include<vector>using namespace std;
int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
|
a.cc:1:19: warning: extra tokens at end of #include directive
1 | #include<iostream>#include<algorithm>#include<vector>using namespace std;
| ^
a.cc: In function 'int main()':
a.cc:2:12: error: 'vector' was not declared in this scope
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^~~~~~
a.cc:2:19: error: expected primary-expression before 'int'
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^~~
a.cc:2:51: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:2:56: error: 'a' was not declared in this scope
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^
a.cc:2:66: error: 'a' was not declared in this scope
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^
a.cc:2:61: error: 'sort' was not declared in this scope; did you mean 'short'?
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^~~~
| short
a.cc:2:85: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:2:121: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
2 | int main(){vector<int> a(10);int i=0;for(;i++<10;)cin>>a[i];sort(a.begin(),a.end());cout<<a[9]<<"\n"<<a[8]<<"\n"<<a[7]<<endl;}
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s870387937
|
p00001
|
C++
|
main(int a,int*b){
for(a=0;a<3;++a)b[a]=0;
for(;~scanf("%d",&b[3]);)
for(a=4;--a;b[a]<b[a-1]?:(b[a-1]^=b[a]^=b[a-1]^=b[a]));
for(a=0;a<3;++a)printf("%d\n",b[a]);
}
|
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(int a,int*b){
| ^~~~
a.cc:1:1: warning: second argument of 'int main(int, int*)' should be 'char **' [-Wmain]
a.cc: In function 'int main(int, int*)':
a.cc:3:15: error: 'scanf' was not declared in this scope
3 | for(;~scanf("%d",&b[3]);)
| ^~~~~
a.cc:5:25: error: 'printf' was not declared in this scope
5 | for(a=0;a<3;++a)printf("%d\n",b[a]);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | main(int a,int*b){
|
s789170678
|
p00001
|
C++
|
#import<algo.h>
main(){int i=0,h[10];for(;i<10;)cin>>h[i++];sort(h,h+10);for(i=9;i>6;)cout<<h[i--]<<endl;exit(0);}
|
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<algo.h>
| ^~~~~~
a.cc:1:8: fatal error: algo.h: No such file or directory
1 | #import<algo.h>
| ^~~~~~~~
compilation terminated.
|
s016462785
|
p00001
|
C++
|
#include<stdio.h>
int main(){
int yama[10];
int temp;
int i,j;
for(i=0;i<10;i++){
scanf("%d",&yama[i];
}
for(i=0;i<10;i++){
for("j=0;j<10;j++){
if(yama[i]>yama[j]){
temp=yama[j];
yama[j]=yama[i];
yama[i]=yama[j];
}
}
}
for(i=0;i<3;i++){
printf("%d\n",yama[i]);
}
return 0;
}
|
a.cc:11:5: warning: missing terminating " character
11 | for("j=0;j<10;j++){
| ^
a.cc:11:5: error: missing terminating " character
11 | for("j=0;j<10;j++){
| ^~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:20: error: expected ')' before ';' token
8 | scanf("%d",&yama[i];
| ~ ^
| )
a.cc:12:1: error: expected primary-expression before 'if'
12 | if(yama[i]>yama[j]){
| ^~
a.cc:17:1: error: expected primary-expression before '}' token
17 | }
| ^
a.cc:16:2: error: expected ';' before '}' token
16 | }
| ^
| ;
17 | }
| ~
a.cc:17:1: error: expected primary-expression before '}' token
17 | }
| ^
a.cc:16:2: error: expected ')' before '}' token
16 | }
| ^
| )
17 | }
| ~
a.cc:11:4: note: to match this '('
11 | for("j=0;j<10;j++){
| ^
a.cc:17:1: error: expected primary-expression before '}' token
17 | }
| ^
a.cc: At global scope:
a.cc:19:1: error: expected unqualified-id before 'for'
19 | for(i=0;i<3;i++){
| ^~~
a.cc:19:9: error: 'i' does not name a type
19 | for(i=0;i<3;i++){
| ^
a.cc:19:13: error: 'i' does not name a type
19 | for(i=0;i<3;i++){
| ^
a.cc:22:1: error: expected unqualified-id before 'return'
22 | return 0;
| ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
23 | }
| ^
|
s938809989
|
p00001
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
vector<int> high;
for(int i=0 ; i<10 ; i++){
cin >> n;
high.push_back( n );
}
sort( high.begin() , high.end() );
for(int i=9 ; i>=7 ; i--){
cout << high.at( i ) << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort( high.begin() , high.end() );
| ^~~~
| short
|
s352709919
|
p00001
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> arr(10);
for(int i = 0; i < 10; i++){
cin >> arr[i];
}
sort(arr.begin(),arr.end());
printf("%d\n%d\n%d\n",a[10],a[9],a[8]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(arr.begin(),arr.end());
| ^~~~
| short
a.cc:16:31: error: 'a' was not declared in this scope
16 | printf("%d\n%d\n%d\n",a[10],a[9],a[8]);
| ^
|
s891698859
|
p00001
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> arr(10);
for(int i = 0; i < 10; i++){
cin >> arr[i];
}
sort(arr.begin(),arr.end());
printf("%d\n%d\n%d\n",arr[10],arr[9],arr[8]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
14 | sort(arr.begin(),arr.end());
| ^~~~
| short
|
s801356060
|
p00001
|
C++
|
#include <stdio.h>
int main(){
int talls[10], max, banme;
for(int i = 0; i < 10; i++) scanf("%d", &talls[i]);
for(int i = 0; i < 10; i++){
max = 0;
for(int j = 0; j < 10; j++){
if(max < talls[j]){
max = talls[j];
banme = j;
}
}
printf("%d\n", max);
talls[j] = 0;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:23: error: 'j' was not declared in this scope
15 | talls[j] = 0;
| ^
|
s836819450
|
p00001
|
C++
|
s[];main(i){for(;~scanf("%d",s);)qsort(s,i++,4,"YXZQQQ\x8b\0+\x02\xc3");printf("%d\n%d\n%d\n",s[9],s[8],s[7]);}
|
a.cc:1:1: error: 's' does not name a type
1 | s[];main(i){for(;~scanf("%d",s);)qsort(s,i++,4,"YXZQQQ\x8b\0+\x02\xc3");printf("%d\n%d\n%d\n",s[9],s[8],s[7]);}
| ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
1 | s[];main(i){for(;~scanf("%d",s);)qsort(s,i++,4,"YXZQQQ\x8b\0+\x02\xc3");printf("%d\n%d\n%d\n",s[9],s[8],s[7]);}
| ^
|
s518438269
|
p00001
|
C++
|
# include <iostream>
using namespace std;
void main(){
for(int i =1;i<=9;i++){
for(int j=1;j<=9;j++){
cout <<i<<"x"<<j<<"="<<i*j<<"\n";
}
}
}
|
a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
|
s095354053
|
p00001
|
C++
|
#include<iostream.h>
#include<vector.h>
#include<algorithm.h>
int main(){int n,i;vector<int> h;for(i=0;i<10;++i)cin>>n,h.push_back(n);sort(h.begin(),h.end());for(i=9;i>6;i--)cout<<h[i]<<endl;}
|
a.cc:1:9: fatal error: iostream.h: No such file or directory
1 | #include<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s291880846
|
p00001
|
C++
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int[] dat = new int[10];
for(int tc = 0; tc < 10; ++tc) {
dat[tc] = s.nextInt();
}
Arrays.sort(dat);
for(int i = 0; i < 3; ++i) {
System.out.println(dat[9-i]);
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s267500080
|
p00001
|
C++
|
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
class Main {
private void topThreeHills() {
Scanner sc = new Scanner(System.in);
ArrayList<Integer> hlist = new ArrayList<Integer>(10);
while (sc.hasNext()) {
hlist.add(sc.nextInt());
}
Collections.sort(hlist, Collections.reverseOrder());
for (int i = 0; i < 3; i++) {
System.out.println(hlist.get(i));
}
}
public static void main(String[] args) {
(new Main()).topThreeHills();
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.ArrayList;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Collections;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.Scanner;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:12: error: expected ':' before 'void'
6 | private void topThreeHills() {
| ^~~~~
| :
a.cc:18:11: error: expected ':' before 'static'
18 | public static void main(String[] args) {
| ^~~~~~~
| :
a.cc:18:29: error: 'String' has not been declared
18 | public static void main(String[] args) {
| ^~~~~~
a.cc:18:38: error: expected ',' or '...' before 'args'
18 | public static void main(String[] args) {
| ^~~~
a.cc:21:2: error: expected ';' after class definition
21 | }
| ^
| ;
a.cc: In member function 'void Main::topThreeHills()':
a.cc:7:9: error: 'Scanner' was not declared in this scope
7 | Scanner sc = new Scanner(System.in);
| ^~~~~~~
a.cc:8:9: error: 'ArrayList' was not declared in this scope
8 | ArrayList<Integer> hlist = new ArrayList<Integer>(10);
| ^~~~~~~~~
a.cc:8:19: error: 'Integer' was not declared in this scope
8 | ArrayList<Integer> hlist = new ArrayList<Integer>(10);
| ^~~~~~~
a.cc:8:28: error: 'hlist' was not declared in this scope
8 | ArrayList<Integer> hlist = new ArrayList<Integer>(10);
| ^~~~~
a.cc:8:40: error: 'ArrayList' does not name a type
8 | ArrayList<Integer> hlist = new ArrayList<Integer>(10);
| ^~~~~~~~~
a.cc:9:16: error: 'sc' was not declared in this scope
9 | while (sc.hasNext()) {
| ^~
a.cc:12:9: error: 'Collections' was not declared in this scope
12 | Collections.sort(hlist, Collections.reverseOrder());
| ^~~~~~~~~~~
a.cc:14:13: error: 'System' was not declared in this scope
14 | System.out.println(hlist.get(i));
| ^~~~~~
a.cc: In static member function 'static void Main::main(int*)':
a.cc:19:22: error: request for member 'topThreeHills' in '(operator new(1), ((true, (((*(Main*)<anonymous>) = Main()), (<anonymous> = false))), ((Main*)<anonymous>)))', which is of pointer type 'Main*' (maybe you meant to use '->' ?)
19 | (new Main()).topThreeHills();
| ^~~~~~~~~~~~~
|
s395937374
|
p00001
|
C++
|
#include <stdio.h>
int main(){
int a,b,c,d,a_max,N[10];
for(a=0;a<10;a++){
scanf("%d",&N[a]);
}
for(b=0;b<10;b++){
b=a_max;
for(c=b;c<10;c++){
if(a_max<c){c=a_max;
}
d=c; c=a_max; a_max=d;
}
printf("%d\n%d\n%d\n",N[0],N[1],N[2]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
s335690311
|
p00001
|
C++
|
#include <stdio.h>
int main(){
int a,b,c,d,a_max,N[10];
for(a=0;a<10;a++){
scanf("%d",&N[a]);
}
for(b=0;b<10;b++){
b=a_max;
for(c=b;c<10;c++){
if(N[a_max]<N[c]){
c=a_max;
}
d=c;
c=a_max;
a_max=d; }
printf("%d\n%d\n%d\n",N[0],N[1],N[2]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
s864547656
|
p00001
|
C++
|
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int a[10],i=0;
for(;i<10;i++)scanf("%d",&a[i]);
sort(a,a+10);
for(i=0;i<3;i++)pritnf("%d\n",a[i]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:25: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
10 | for(i=0;i<3;i++)pritnf("%d\n",a[i]);
| ^~~~~~
| printf
|
s372851203
|
p00001
|
C++
|
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
List<Integer> l = new ArrayList<Integer>();
for (int i = 0; i < 10; i++) {
int t = sc.nextInt();
l.add(t);
}
Collections.sort(l);
Collections.reverse(l);
for (int i = 0; i < 3; i++) {
System.out.println(l.get(i));
}
}
};
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s477970883
|
p00001
|
C++
|
#include <vector>
#include <iostream>
using namespace std;
int main(){
int height;
vector<int> heights;
while (cin >> height)
heights.push_back(height);
sort(heights.begin(), heights.end(), greater<int>());
for (int i = 0; i < 3; i++)
cout << heights[i] << endl;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(heights.begin(), heights.end(), greater<int>());
| ^~~~
| short
|
s733924733
|
p00001
|
C++
|
main(a){for(printf("3776\n2848\n2840\n");~scanf("%d",&a););}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(a){for(printf("3776\n2848\n2840\n");~scanf("%d",&a););}
| ^
|
s215255486
|
p00001
|
C++
|
a[],i;
c(int*a){a=*a-*1[&a];}
main(){~scanf("%d",a+i++)&&main()||(c=!printf("%d\n%d\n%d\n",*a,a[1],a[2]));}
|
a.cc:1:1: error: 'a' does not name a type
1 | a[],i;
| ^
a.cc:2:1: error: ISO C++ forbids declaration of 'c' with no type [-fpermissive]
2 | c(int*a){a=*a-*1[&a];}
| ^
a.cc: In function 'int c(int*)':
a.cc:2:14: error: invalid conversion from 'int' to 'int*' [-fpermissive]
2 | c(int*a){a=*a-*1[&a];}
| ~~^~~~~~~
| |
| int
a.cc:2:22: warning: no return statement in function returning non-void [-Wreturn-type]
2 | c(int*a){a=*a-*1[&a];}
| ^
a.cc: At global scope:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){~scanf("%d",a+i++)&&main()||(c=!printf("%d\n%d\n%d\n",*a,a[1],a[2]));}
| ^~~~
a.cc: In function 'int main()':
a.cc:3:20: error: 'a' was not declared in this scope
3 | main(){~scanf("%d",a+i++)&&main()||(c=!printf("%d\n%d\n%d\n",*a,a[1],a[2]));}
| ^
a.cc:3:22: error: 'i' was not declared in this scope
3 | main(){~scanf("%d",a+i++)&&main()||(c=!printf("%d\n%d\n%d\n",*a,a[1],a[2]));}
| ^
a.cc:3:9: error: 'scanf' was not declared in this scope
3 | main(){~scanf("%d",a+i++)&&main()||(c=!printf("%d\n%d\n%d\n",*a,a[1],a[2]));}
| ^~~~~
a.cc:3:40: error: 'printf' was not declared in this scope
3 | main(){~scanf("%d",a+i++)&&main()||(c=!printf("%d\n%d\n%d\n",*a,a[1],a[2]));}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | a[],i;
|
s520975756
|
p00001
|
C++
|
#include<stdio.h>
#include<algorithm>
int main()
{
int i,j,a[10];
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
sort(a,a+10);
printf("%d\n%d\n%d\n",a[9],a[8],a[7]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
10 | sort(a,a+10);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
|
s654839020
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main(){
bool completed,flag;
int result[3],buf,temp[10];
for(int i = 0; i < 10; i++){
cin >> temp[i];
}
for(int l = 0; l < 3; l++{
while(1){
for(int j = l; j < 9; j++){
if(temp[j] < temp[j+1]){
buf = temp[j+1];
temp[j+1] = temp[j];
temp[j] = buf;
}
}
flag = false
for(int k = 0; k < 9; k++){
if(temp[0] < temp[k]) flag = true;
}
if(flag != true) result[l] = temp[l];
break;
}
}
cout << result[0] << endl;
cout << result[1] << endl;
cout << result[2] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:34: error: expected ')' before '{' token
10 | for(int l = 0; l < 3; l++{
| ~ ^
| )
a.cc:19:37: error: expected ';' before 'for'
19 | flag = false
| ^
| ;
20 | for(int k = 0; k < 9; k++){
| ~~~
a.cc:20:40: error: 'k' was not declared in this scope
20 | for(int k = 0; k < 9; k++){
| ^
|
s313845217
|
p00001
|
C++
|
#include<iostream>
using namespace std;
main()
{ int s=0;
int x[10]={0,0,0,0,0,0,0,0,0,0,0};
int t[3]={0,0,0};
for(int i=0;i<0;i++){
cin>>x[i];
}
for(int k=0;k<3;k++){
for(int j=0;j<10;j++){
if(t[k]<x[j]){
s=t[k];
t[k]=x[j];
x[j]=s;
}
}
}
for(int e=0;e<3;e++){
cout<<t[e]<<endl;
}
return 0;
}
|
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:5:35: error: too many initializers for 'int [10]'
5 | int x[10]={0,0,0,0,0,0,0,0,0,0,0};
| ^
|
s739596178
|
p00001
|
C++
|
a;main(){a=!puts("10000\n9999\n9998");}
|
a.cc:1:1: error: 'a' does not name a type
1 | a;main(){a=!puts("10000\n9999\n9998");}
| ^
a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a;main(){a=!puts("10000\n9999\n9998");}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:10: error: 'a' was not declared in this scope
1 | a;main(){a=!puts("10000\n9999\n9998");}
| ^
a.cc:1:13: error: 'puts' was not declared in this scope
1 | a;main(){a=!puts("10000\n9999\n9998");}
| ^~~~
|
s591340747
|
p00001
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> m(10);
for(int i=0; i<10; i++){
cin >> m[i];
}
sort(m.begin(), m.end());
cout << m[9] << endl;
cout << m[8] << endl;
cout << m[7] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(m.begin(), m.end());
| ^~~~
| short
|
s122632167
|
p00001
|
C++
|
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
int i, arr[100];
for (i=0;i<10;i++)
scanf ("%d", &arr[i]);
sort (arr, arr+10);
printf ("%d\n", a[9]);
printf ("%d\n", a[8]);
printf ("%d\n", a[7]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:17: error: 'a' was not declared in this scope
10 | printf ("%d\n", a[9]);
| ^
|
s594516611
|
p00001
|
C++
|
a,b,c;main(t){for(;~scanf("%d",&t);)t>a&&(a=t),a>b&&(t=a,a=b,b=t),b>c&&(t=c,c=b,b=t);printf("%d\n%d\n%d\n",c,b,a);}
|
a.cc:1:1: error: 'a' does not name a type
1 | a,b,c;main(t){for(;~scanf("%d",&t);)t>a&&(a=t),a>b&&(t=a,a=b,b=t),b>c&&(t=c,c=b,b=t);printf("%d\n%d\n%d\n",c,b,a);}
| ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
1 | a,b,c;main(t){for(;~scanf("%d",&t);)t>a&&(a=t),a>b&&(t=a,a=b,b=t),b>c&&(t=c,c=b,b=t);printf("%d\n%d\n%d\n",c,b,a);}
| ^
|
s740784514
|
p00001
|
C++
|
#include <iostream>
#include <queue>
using namespace std;
void AOJ0001::st(){
int c;
priority_queue<int> pq;
for (int i=0;i<10;i++){
cin >> c;
pq.push(c);
}
for (int i=0;i<3;i++){
cout << pq.top() << endl;
pq.pop();
}
}
|
a.cc:4:6: error: 'AOJ0001' has not been declared
4 | void AOJ0001::st(){
| ^~~~~~~
|
s985781184
|
p00001
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> input;
for (int i = 0; i < 10; i++) {
int tmp;
cin >> tmp;
input.push_back(tmp);
}
sort(input.rbegin(), input.rend());
for (int i = 0; i < 3; i++) {
cout << input[i] << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(input.rbegin(), input.rend());
| ^~~~
| short
|
s594150192
|
p00001
|
C++
|
/* test */
|
/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
|
s704006319
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main()
{
int a[10];
for(int i=0;i<10;i++)
cin>>a[i];
for(int i=0;i<9;i++)
for(int j=i+1;i<10;j++)
if a[i]<a[j]
{
int tmp=a[i];
a[i]=a[j]
a[j]=tmp;
}
cout<<a[1];
cout<<a[2];
cout<<a[3];
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:6: error: expected '(' before 'a'
10 | if a[i]<a[j]
| ^
| (
|
s717379712
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main() {
int hill[10];
for(int i=0;i < 10;i++) {
cin >> hill[i];
}
sort(hill,hill + 10);
cout << hill[9] << endl
<< hill[8] << endl
<< hill[7] << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(hill,hill + 10);
| ^~~~
| short
|
s029730695
|
p00001
|
C++
|
#include <iostream>
using name space std
int main(){
int hight[10];
int Num;
int naka;
int flag;
for(Num=0;Num!=10;Num++)
{
cin>>hight[Num];
};
for(Num=0;flag!=0;flag=0,Num=0)
{
if(hight[Num]<hight[(Num+1)])
{naka=hight[Num];
hight[Num]=hight[(Num+1)];
hight[(Num+1)]=naka;
flag++; };
};
cin<<hight[0]<<endl;
cin<<hight[1]<<endl;
cin<<hight[2]<<endl;
return 0;
}
|
a.cc:21:9: error: stray '#' in program
21 | flag++; };
| ^
a.cc:2:7: error: expected nested-name-specifier before 'name'
2 | using name space std
| ^~~~
|
s965415885
|
p00001
|
C++
|
Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.
|
a.cc:1:1: error: 'Unacceptable' does not name a type
1 | Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.Unacceptable submission.
| ^~~~~~~~~~~~
|
s173389664
|
p00001
|
C++
|
#include <iostream>
void swap(int *a, int *b);
int main(void)
{
int b[3]={0,0,0};
int i=0;
for(; i < 10; i++){
int s;
scanf("%d",&s);
if(b[2] < s){b[2]=s);}
if(b[1] < b[2]){swap(&b[1],&b[2]);}
if(b[0] < b[1]){swap(&b[0],&b[1]);}
}
std::cout << b[0] << std::endl << b[1] << std::endl << b[2] << std::endl;
return 0;
}
void swap(int *a, int *b){
int c=*a;
*a=*b;*b=c;
return;
}
|
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before ')' token
12 | if(b[2] < s){b[2]=s);}
| ^
| ;
|
s171638403
|
p00001
|
C++
|
#include<iostream>
#include<vector>
#include<functional>
using namespace std;
int main(){
vector<int> height(10);
for(int i=0; i<10; i++){
cin >>height[i];
}
sort(height.begin(),height.end(),greater<int>());
cout <<height[0]<<endl<<height[1]<<endl<<height[2]<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(height.begin(),height.end(),greater<int>());
| ^~~~
| short
|
s365373365
|
p00001
|
C++
|
#include <iostream>
#include <functional>
#include <list>
using namespace std;
int main(){
list<int> height_list(10);
for(int i=0; i<10; ++i){
int height;
cin >> height;
height_list.push_back(height);
}
height_list.sort(greater<int>());
list<int>::iterator ite = height_list.begin();
for(int i=0; i<3; ++i){
cout << *ite++ << endl;
}
return 0;
|
a.cc: In function 'int main()':
a.cc:20:18: error: expected '}' at end of input
20 | return 0;
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s085913978
|
p00001
|
C++
|
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <list>
#include <cmath>
#include <fstream>
#include <queue>
#include <sstream>
#include <algorithm>
#include <cstring>
using namespace std;
emplate <class T> void change(T &a, T &b)// 交换
{
T temp;
temp = a;
a = b;
b = temp;
}
template <class T> void quicksort(vector<T> &S,int a,int b) // 快速排序
{
int x = a;
int y = b;
T mid = S[(a+b)>>1];
while (x <= y)
{
while (S[x] < mid) x++;
while (S[y] > mid) y--;
if (x <= y)
{
change(S[x], S[y]);
x++;
y--;
}
}
if (x < b) quicksort(S, x, b);
if (y > a) quicksort(S, a, y);
}
vector<int> vi;
int main()
{
vi.resize(10);
for(int i = 0; i < 10; i++)
cin >> vi[i];
quicksort(vi,0,9);
cout << vi[9] << endl;
cout << vi[8] << endl;
cout << vi[7] << endl;
return 0;
}
|
a.cc:13:1: error: 'emplate' does not name a type
13 | emplate <class T> void change(T &a, T &b)// 交换
| ^~~~~~~
a.cc: In instantiation of 'void quicksort(std::vector<_Tp>&, int, int) [with T = int]':
a.cc:45:11: required from here
45 | quicksort(vi,0,9);
| ~~~~~~~~~^~~~~~~~
a.cc:31:21: error: 'change' was not declared in this scope
31 | change(S[x], S[y]);
| ~~~~~~^~~~~~~~~~~~
|
s089730042
|
p00001
|
C++
|
#include <stdio.h>
void main(void)
{
int a[3] = {0,0,0};
int b,c;
for(int i = 0; i < 10; i++){
scanf("%d", &b);
for(int j = 2; j >= 0; j--){
if(a[j] < b){
c = a[j];
a[j] = b;
b = c;
}
}
}
for(int i = 2; i >= 0; i--)
printf("%d\n", a[i]);
}
|
a.cc:3:1: error: '::main' must return 'int'
3 | void main(void)
| ^~~~
|
s730998746
|
p00001
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> heights(10);;
for(int i = 0; i < 10; ++i){
cin >> heights[i];
}
sort(heights.begin(), heights.end(), greater<int>());
for(int i = 0; i < 3; ++i){
cout << heights[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(heights.begin(), heights.end(), greater<int>());
| ^~~~
| short
|
s637320724
|
p00001
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> heights(10);;
for(int i = 0; i < 10; ++i){
cin >> heights[i];
}
sort(heights.begin(), heights.end(), greater<int>());
for(int i = 0; i < 3; ++i){
cout << heights[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort(heights.begin(), heights.end(), greater<int>());
| ^~~~
| short
|
s005071287
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
#include <functional
using namespace std;
int main()
{
int h[10];
for (int i = 0; i < 10; ++i) cin >> h[i];
sort(h, h+10, greater<int>());
cout << h[0] << endl << h[1] << endl << h[2] << endl;
return 0;
}
|
a.cc:3:21: error: missing terminating > character
3 | #include <functional
| ^
|
s567899725
|
p00001
|
C++
|
#include<stdio.h>
int main()
{
int high[10] = {1819,2003,876,2876,1723,1673,3776,2848,1592,922};
for(int i=0;i<9;i++)
{
for( int cases; int j=i+1; j<10; j++)
{
if(high[i] < high[j])
{
cases = high[i];
high[i] = high[j];
high[j] = cases;
}
}
}
printf("%d",high[0]);
printf("%d",high[1]);
printf("%d",high[2]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:48: error: expected ')' before ';' token
9 | for( int cases; int j=i+1; j<10; j++)
| ~ ^
| )
a.cc:9:50: error: 'j' was not declared in this scope
9 | for( int cases; int j=i+1; j<10; j++)
| ^
|
s373692282
|
p00001
|
C++
|
#include<stdio.h>
int main()
{
int high[10] = {1819,2003,876,2876,1723,1673,3776,2848,1592,922};
int cases
for(int i=0;i<9;i++)
{
for(int j=i+1; j<10; j++)
{
if(high[i] < high[j])
{
cases = high[i];
high[i] = high[j];
high[j] = cases;
}
}
}
printf("%d",high[0]);
printf("%d",high[1]);
printf("%d",high[2]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:9: error: expected initializer before 'for'
8 | for(int i=0;i<9;i++)
| ^~~
a.cc:8:21: error: 'i' was not declared in this scope
8 | for(int i=0;i<9;i++)
| ^
|
s637200877
|
p00001
|
C++
|
#include<stdio.h>
int main()
{
int high[10];
int cases;
for(int i=0;i<9;i++)
{
printf("height of mountain %d",i);
scanf("%d",&high[i]);
pirntf("\n");
}
for(int i=0;i<9;i++)
{
for(int j=i+1; j<10; j++)
{
if(high[i] < high[j])
{
cases = high[i];
high[i] = high[j];
high[j] = cases;
}
}
}
printf("%d\n",high[0]);
printf("%d\n",high[1]);
printf("%d\n",high[2]);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:17: error: 'pirntf' was not declared in this scope; did you mean 'printf'?
12 | pirntf("\n");
| ^~~~~~
| printf
|
s666249546
|
p00001
|
C++
|
#include <stdio.h>
#include <math.h>
#include <iostream>
using namespace std;
int main(void){
int x[10],top[3];
int i;
for(i=0;i<3;i++){
top[i] = 0;
}
for(i=0;i<10;i++){
std::cin >> x[i];
if(top[0] < x[i]){
top[2] = top[1];
top[1] = top[0];
top[0] = x[i];
}
if(top[1] < x[i]){
top[2] = top[1];
top[1] = x[i];
}
if(top[2] < x[i]){
top[2] = x[i];
}
}
std::cout << top[0] << "\n" << top[1] << "\n" <<top[2] << "\n";
return 0;
|
a.cc: In function 'int main()':
a.cc:30:18: error: expected '}' at end of input
30 | return 0;
| ^
a.cc:6:15: note: to match this '{'
6 | int main(void){
| ^
|
s794160159
|
p00001
|
C++
|
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int i,j,arr[11];
for(i=1;i<=10;i++)
{
for(j=1;j<=3;j++)
scanf("%d",&arr[j]);
sort(arr,10);
printf("%d\n",arr[j]);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:13: error: no matching function for call to 'sort(int [11], int)'
11 | sort(arr,10);
| ~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed:
a.cc:11:13: note: deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
11 | sort(arr,10);
| ~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
|
s209242570
|
p00001
|
C++
|
#include <stdio.h>
void sortarry(int* Array,int n )
{
int Tmp=0;
int i=0;
int j=0;
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(Array[i]<Array[j] )
{
Tmp=Array[i];
Array[i]= Array[j];
Array[j]= Tmp;
}
}
}
return ;
}
|
/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
|
s089342511
|
p00001
|
C++
|
#include <iostream>
int main()
{
int i,high[10];
for(i = 0;i < 10;++i){
cin >> high[i];
}
sort(high[0]);
cout << high[0];
cout << high[1];
cout << high[2];
}
void sort(int *a)
{
int i,first = 0,secand = 0,third = 0;
for(i = 0;i < 10;++i){
if(first < *(a + i)){
first = *(a + i);
}else if(secand < *(a + i)){
secand = *(a + i);
}else if(third < *(a + i)){
third = *(a + i);
}
}
*a = first;
*(a + 1) = secand;
*(a + 2) = third;
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> high[i];
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(high[0]);
| ^~~~
| short
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout << high[0];
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s654902426
|
p00001
|
C++
|
#include <iostream>
int main()
{
int i,high[10];
for(i = 0;i < 10;++i){
std::cin >> high[i];
}
sort(high[0]);
std::cout << high[0];
std::cout << high[1];
std::cout << high[2];
}
void sort(int *a)
{
int i,first = 0,secand = 0,third = 0;
for(i = 0;i < 10;++i){
if(first < *(a + i)){
first = *(a + i);
}else if(secand < *(a + i)){
secand = *(a + i);
}else if(third < *(a + i)){
third = *(a + i);
}
}
*a = first;
*(a + 1) = secand;
*(a + 2) = third;
}
|
a.cc: In function 'int main()':
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(high[0]);
| ^~~~
| short
|
s108531956
|
p00001
|
C++
|
#include <iostream>
int main()
{
int i,high[10];
for(i = 0;i < 10;++i){
std::cin >> high[i];
}
manko::sort(high[0]);
std::cout << high[0];
std::cout << high[1];
std::cout << high[2];
}
namespace manko{
void sort(int *a)
{
int i,first = 0,secand = 0,third = 0;
for(i = 0;i < 10;++i){
if(first < *(a + i)){
first = *(a + i);
}else if(secand < *(a + i)){
secand = *(a + i);
}else if(third < *(a + i)){
third = *(a + i);
}
}
*a = first;
*(a + 1) = secand;
*(a + 2) = third;
}
}
|
a.cc: In function 'int main()':
a.cc:9:5: error: 'manko' has not been declared
9 | manko::sort(high[0]);
| ^~~~~
|
s033983996
|
p00001
|
C++
|
#include <iostream>
void sort(int *a);
int main()
{
int i,high[10];
for(i = 0;i < 10;++i){
std::cin >> high[i];
}
sort(high[0]);
std::cout << high[0];
std::cout << high[1];
std::cout << high[2];
}
void sort(int *a)
{
int i,first = 0,secand = 0,third = 0;
for(i = 0;i < 10;++i){
if(first < *(a + i)){
first = *(a + i);
}else if(secand < *(a + i)){
secand = *(a + i);
}else if(third < *(a + i)){
third = *(a + i);
}
}
*a = first;
*(a + 1) = secand;
*(a + 2) = third;
}
|
a.cc: In function 'int main()':
a.cc:11:16: error: invalid conversion from 'int' to 'int*' [-fpermissive]
11 | sort(high[0]);
| ~~~~~~^
| |
| int
a.cc:3:16: note: initializing argument 1 of 'void sort(int*)'
3 | void sort(int *a);
| ~~~~~^
|
s267673093
|
p00001
|
C++
|
#include <iostream>
void sort(int* a);
int main()
{
int i,high[10];
for(i = 0;i < 10;++i){
std::cin >> high[i];
}
sort(high[0]);
std::cout << high[0];
std::cout << high[1];
std::cout << high[2];
}
void sort(int* a)
{
int i,first = 0,secand = 0,third = 0;
for(i = 0;i < 10;++i){
if(first < *(a + i)){
first = *(a + i);
}else if(secand < *(a + i)){
secand = *(a + i);
}else if(third < *(a + i)){
third = *(a + i);
}
}
*a = first;
*(a + 1) = secand;
*(a + 2) = third;
}
|
a.cc: In function 'int main()':
a.cc:11:16: error: invalid conversion from 'int' to 'int*' [-fpermissive]
11 | sort(high[0]);
| ~~~~~~^
| |
| int
a.cc:3:16: note: initializing argument 1 of 'void sort(int*)'
3 | void sort(int* a);
| ~~~~~^
|
s909123654
|
p00001
|
C++
|
v=[];v<<$_.to_i while gets
3.times{|i|p v.sort.reverse[i]}
|
a.cc:1:1: error: 'v' does not name a type
1 | v=[];v<<$_.to_i while gets
| ^
a.cc:1:6: error: 'v' does not name a type
1 | v=[];v<<$_.to_i while gets
| ^
|
s734598391
|
p00001
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a[10];fefepjp
while(cin>>a[0]){
for(int i=1;i<10;i++)cin>>a[i];
sort(a,a+10,greater<int>());
for(int i=0;i<4;i++)
cout<<a[i]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:13: error: 'fefepjp' was not declared in this scope
8 | int a[10];fefepjp
| ^~~~~~~
|
s522441117
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
int main()
{
int height(10);
for(int i=0;i<10;++i)
{
std::cin >> height[i];
}
std::sort(height.begin(),height.end());
std::cout << height[9] << '\n';
std::cout << height[8] << '\n';
std::cout << height[7] << '\n';
}
|
a.cc: In function 'int main()':
a.cc:11:27: error: invalid types 'int[int]' for array subscript
11 | std::cin >> height[i];
| ^
a.cc:14:22: error: request for member 'begin' in 'height', which is of non-class type 'int'
14 | std::sort(height.begin(),height.end());
| ^~~~~
a.cc:14:37: error: request for member 'end' in 'height', which is of non-class type 'int'
14 | std::sort(height.begin(),height.end());
| ^~~
a.cc:16:24: error: invalid types 'int[int]' for array subscript
16 | std::cout << height[9] << '\n';
| ^
a.cc:18:24: error: invalid types 'int[int]' for array subscript
18 | std::cout << height[8] << '\n';
| ^
a.cc:20:24: error: invalid types 'int[int]' for array subscript
20 | std::cout << height[7] << '\n';
| ^
|
s226703268
|
p00001
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int x[10];
for(int i = 0; i < 10; i++){
cin >> x[i];
}
sort(x,x + 10);
cout << x[9] << endl; << x[8] << endl; << x[7] << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:31: error: expected primary-expression before '<<' token
11 | cout << x[9] << endl; << x[8] << endl; << x[7] << endl;
| ^~
a.cc:11:48: error: expected primary-expression before '<<' token
11 | cout << x[9] << endl; << x[8] << endl; << x[7] << endl;
| ^~
|
s069778454
|
p00001
|
C++
|
#include<iostream>
int main(){
int high[10];
int highest[3];
for(int i=0;i<10;i++){
cin>>high[i];}
highest[0]=high[0];
for(int i=1;i<10;i++){
if(high[i]>highest[0]){
highest[2]=highest[1];
highest[1]=highest[0];
highest[0]=high[i];}
if(highest[0]>=high[i]&&high[i]>highest[1]){
highest[2]=highest[1];
highest[1]=high[i];}
if(highest[1]>=high[i]&&high[i]>highest[2]){
highest[2]=high[i];}}
for(int i=0;i<3;i++){
cout<<highest[i]<<endl;}}
|
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>high[i];}
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:20:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
20 | cout<<highest[i]<<endl;}}
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:20:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
20 | cout<<highest[i]<<endl;}}
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s656585311
|
p00001
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int array[10];
for(int i=0; i<10; i++)
cin>>array[i];
for(i=0; i<9; i++){
for(int j=i+1; j<10; j++){
if(array[i]<array[j]){
int tmp=array[i];
array[i]=array[j];
array[j]=tmp;
}
}
}
for(i=0; i<3; i++)
cout<<array[i]<<"\n";
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:9: error: 'i' was not declared in this scope
11 | for(i=0; i<9; i++){
| ^
a.cc:21:9: error: 'i' was not declared in this scope
21 | for(i=0; i<3; i++)
| ^
|
s295503224
|
p00001
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a[10];
for(int i=0;i<10;i++){
cin>>a[i];
}
sort(a,a+10);
cout<<a[9]<<endl<<a[8]<<endl<<a[7];
}
|
a.cc: In function 'int main()':
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(a,a+10);
| ^~~~
| short
|
s582147492
|
p00001
|
C++
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
#define CY 505
#define NODE 1005
int ar[CY][CY], f[CY], r[CY];
int N, idx;
void input(int n) {
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
scanf("%d", &ar[i][j]);
}
}
}
void init_set(int n) {
for (int i = 0; i < n; ++i) {
f[i] = i;
r[i] = 0;
}
}
int find_set(int u) {
if (u != f[u])
f[u] = find_set(f[u]);
return f[u];
}
void union_set(int u, int v) {
if (r[u] >= r[v]) {
if (r[u] == r[v])
r[u]++;
f[v] = u;
} else {
f[u] = v;
}
}
void solve(int n) {
idx = 0;
for (int k = 0; k < 31; ++k) {
int p = 1 << k;
init_set(2 * n);
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
if (i == j)
continue;
int num = p & ar[i][j];
if ((i & 1) && (j & 1)) {
if (num) {
int u = find_set(f[i]);
int v = find_set(f[j * 2]);
if (u != v) {
union_set(u, v);
}
int u = find_set(f[i * 2]);
int v = find_set(f[j]);
if (u != v) {
union_set(u, v);
}
} else {
int u = find_set(f[i]);
int v = find_set(f[j]);
if (u != v) {
union_set(u, v);
}
}
} else if ((i & 1) == 0 && (j & 1) == 0) {
if (num) {
int u = find_set(f[i * 2]);
int v = find_set(f[j * 2]);
if (u != v) {
union_set(u, v);
}
} else {
int u = find_set(f[i * 2]);
int v = find_set(f[j]);
if (u != v) {
union_set(u, v);
}
int u = find_set(f[i]);
int v = find_set(f[j * 2]);
if (u != v) {
union_set(u, v);
}
}
} else {
if (num) {
int u = find_set(f[i * 2]);
int v = find_set(f[j]);
if (u != v) {
union_set(u, v);
}
int u = find_set(f[i]);
int v = find_set(f[j * 2]);
if (u != v) {
union_set(u, v);
}
} else {
int u = find_set(f[i]);
int v = find_set(f[j]);
if (u != v) {
union_set(u, v);
}
int u = find_set(f[i * 2]);
int v = find_set(f[j * 2]);
if (u != v) {
union_set(u, v);
}
}
}
}
}
sort(e, e + idx, cmp);
}
}
int main(void) {
while (~scanf("%d", &N)) {
input(N);
solve(N);
}
return 0;
}
|
a.cc: In function 'void solve(int)':
a.cc:70:53: error: redeclaration of 'int u'
70 | int u = find_set(f[i * 2]);
| ^
a.cc:65:53: note: 'int u' previously declared here
65 | int u = find_set(f[i]);
| ^
a.cc:71:53: error: redeclaration of 'int v'
71 | int v = find_set(f[j]);
| ^
a.cc:66:53: note: 'int v' previously declared here
66 | int v = find_set(f[j * 2]);
| ^
a.cc:95:53: error: redeclaration of 'int u'
95 | int u = find_set(f[i]);
| ^
a.cc:90:53: note: 'int u' previously declared here
90 | int u = find_set(f[i * 2]);
| ^
a.cc:96:53: error: redeclaration of 'int v'
96 | int v = find_set(f[j * 2]);
| ^
a.cc:91:53: note: 'int v' previously declared here
91 | int v = find_set(f[j]);
| ^
a.cc:108:53: error: redeclaration of 'int u'
108 | int u = find_set(f[i]);
| ^
a.cc:103:53: note: 'int u' previously declared here
103 | int u = find_set(f[i * 2]);
| ^
a.cc:109:53: error: redeclaration of 'int v'
109 | int v = find_set(f[j * 2]);
| ^
a.cc:104:53: note: 'int v' previously declared here
104 | int v = find_set(f[j]);
| ^
a.cc:119:53: error: redeclaration of 'int u'
119 | int u = find_set(f[i * 2]);
| ^
a.cc:114:53: note: 'int u' previously declared here
114 | int u = find_set(f[i]);
| ^
a.cc:120:53: error: redeclaration of 'int v'
120 | int v = find_set(f[j * 2]);
| ^
a.cc:115:53: note: 'int v' previously declared here
115 | int v = find_set(f[j]);
| ^
a.cc:128:22: error: 'e' was not declared in this scope
128 | sort(e, e + idx, cmp);
| ^
a.cc:128:34: error: 'cmp' was not declared in this scope; did you mean 'bcmp'?
128 | sort(e, e + idx, cmp);
| ^~~
| bcmp
|
s857500478
|
p00001
|
C++
|
num = []
i=0
while i < 10
num[i] = gets.to_i
i+=1
end
num.sort!{|a, b| (-1) * (a <=> b)}
puts "result"
for n in 0..2
puts "#{num[n]}"
end
|
a.cc:11:10: error: too many decimal points in number
11 | for n in 0..2
| ^~~~
a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'?
1 | num = []
| ^~~
| enum
a.cc:10:1: error: 'puts' does not name a type
10 | puts "result"
| ^~~~
|
s666412027
|
p00001
|
C++
|
num = []
i=0
while i < 10
num[i] = gets.to_i
i+=1
end
num.sort!{|a, b| (-1) * (a <=> b)}
for n in 0..2
puts "#{num[n]}"
end
|
a.cc:10:10: error: too many decimal points in number
10 | for n in 0..2
| ^~~~
a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'?
1 | num = []
| ^~~
| enum
a.cc:10:1: error: expected unqualified-id before 'for'
10 | for n in 0..2
| ^~~
|
s872320926
|
p00001
|
C++
|
#include <iostream>
int main(int argc, const char * argv[])
{
using namespace std;
int max = 0;
int second = 0;
int third = 0;
int n[10];
for(int i = 0; i < 10; i++) cin >> n[i];
sort(n,n+10,greater<int>());
max = n[0];
second = n[1];
third = n[2];
cout << max << "\n" << second << "\n" << third << "\n";
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(n,n+10,greater<int>());
| ^~~~
| short
|
s260752560
|
p00001
|
C++
|
#include <iostream>
int main(int argc, const char * argv[])
{
using namespace std;
int max = 0;
int second = 0;
int third = 0;
int n[10];
for(int i = 0; i < 10; i++) cin >> n[i];
sort(n,n+10,greater<int>());
max = n[0];
second = n[1];
third = n[2];
cout << max << "\n" << second << "\n" << third << "\n";
return 0;
}
|
a.cc: In function 'int main(int, const char**)':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(n,n+10,greater<int>());
| ^~~~
| short
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.