submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s896751994 | p03711 | Java | import java.util.Scanner;
import java.util.Arrays;
import java.util.List;
public class Grouping {
static List<Integer> A;
static List<Integer> B;
static List<Integer> C;
public static void main(String args[]) {
A = Arrays.asList(1, 3, 5, 7, 8, 10, 12);
B = Arrays.asList(4, 6, 9, 11);
C = Arrays.asList(2);
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
String answer = isSameGroup(x, y) ? "Yes" : "No";
System.out.println(answer);
}
private static boolean isSameGroup(int x, int y) {
if ((A.contains(x) && A.contains(y))
|| (B.contains(x) && B.contains(y))
|| (C.contains(x) && C.contains(y))) {
return true;
} else {
return false;
}
}
} | Main.java:5: error: class Grouping is public, should be declared in a file named Grouping.java
public class Grouping {
^
1 error
|
s025993388 | p03711 | Java | import java.util.Scanner;
import java.util.Arrays;
public class Class2 {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
String x = sc.next();
String y = sc.next();
String x = "1";
String y = "2";
String[] a = {"1","3","5","7","8","10","12"};
String[] b = {"4","6","9","11"};
if(x==y){
System.out.print("Yes");
}else if(x=="2" && y=="2"){
System.out.print("Yes");
}else if(Arrays.asList(a).contains(x)){
if(Arrays.asList(a).contains(y)){
System.out.print("Yes");
}else{
System.out.print("No");
}
}else if(Arrays.asList(b).contains(x)){
if(Arrays.asList(b).contains(y)){
System.out.print("Yes");
}else{
System.out.print("No");
}
}else {
System.out.print("No");
}
}
} | Main.java:4: error: class Class2 is public, should be declared in a file named Class2.java
public class Class2 {
^
Main.java:9: error: variable x is already defined in method main(String[])
String x = "1";
^
Main.java:10: error: variable y is already defined in method main(String[])
String y = "2";
^
3 errors
|
s349971218 | p03711 | Java | import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
String[] a = {"1","3","5","7","8","10","12"};
String[] b = {"4","6","9","11"};
if(x==y){
System.out.print("Yes");
}else if(x=="2" && y=="2"){
System.out.print("Yes");
}else if(Arrays.asList(a).contains(x)){
if(Arrays.asList(a).contains(y)){
System.out.print("Yes");
}else{
System.out.print("No");
}
}else if(Arrays.asList(b).contains(x)){
if(Arrays.asList(b).contains(y)){
System.out.print("Yes");
}else{
System.out.print("No");
}
}else {
System.out.print("No");
}
}
} | Main.java:13: error: bad operand types for binary operator '=='
}else if(x=="2" && y=="2"){
^
first type: int
second type: String
Main.java:13: error: bad operand types for binary operator '=='
}else if(x=="2" && y=="2"){
^
first type: int
second type: String
2 errors
|
s065933565 | p03711 | Java | package practice;
import java.util.Arrays;
public class Class2 {
public static void main (String[] args) {
// Scanner sc = new Scanner(System.in);
// int x = sc.nextInt();
// int y = sc.nextInt();
String x = "1";
String y = "2";
String[] a = {"1","3","5","7","8","10","12"};
String[] b = {"4","6","9","11"};
if(x==y){
System.out.print("Yes");
}else if(x=="2" && y=="2"){
System.out.print("Yes");
}else if(Arrays.asList(a).contains(x)){
if(Arrays.asList(a).contains(y)){
System.out.print("Yes");
}else{
System.out.print("No");
}
}else if(Arrays.asList(b).contains(x)){
if(Arrays.asList(b).contains(y)){
System.out.print("Yes");
}else{
System.out.print("No");
}
}else {
System.out.print("No");
}
}
} | Main.java:4: error: class Class2 is public, should be declared in a file named Class2.java
public class Class2 {
^
1 error
|
s149450471 | p03711 | Java | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int[] a = {1,3,5,7,8,10,12};
int[] b = {4,6,9,11};
if(x==y){
System.out.print("Yes");
}else if(x==2 && y==2){
System.out.print("Yes");
}else if(a.contains(x)){
if(a.contains(y)){
System.out.print("Yes");
}
}else if(b.contains(x)){
if(b.contains(y)){
System.out.print("Yes");
}
}else {
System.out.print("No");
}
}
} | Main.java:14: error: cannot find symbol
}else if(a.contains(x)){
^
symbol: method contains(int)
location: variable a of type int[]
Main.java:15: error: cannot find symbol
if(a.contains(y)){
^
symbol: method contains(int)
location: variable a of type int[]
Main.java:18: error: cannot find symbol
}else if(b.contains(x)){
^
symbol: method contains(int)
location: variable b of type int[]
Main.java:19: error: cannot find symbol
if(b.contains(y)){
^
symbol: method contains(int)
location: variable b of type int[]
4 errors
|
s052633323 | p03711 | Java | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
String[] a = {1,3,5,7,8,10,12};
String[] b = {4,6,9,11};
if(x==y){
System.out.print("Yes");
}else if(x==2 && y==2){
System.out.print("Yes");
}else if(a.contains(x)){
if(a.contains(y)){
System.out.print("Yes");
}
}else if(b.contains(x)){
if(b.contains(y)){
System.out.print("Yes");
}
}else {
System.out.print("No");
}
}
} | Main.java:8: error: incompatible types: int cannot be converted to String
String[] a = {1,3,5,7,8,10,12};
^
Main.java:8: error: incompatible types: int cannot be converted to String
String[] a = {1,3,5,7,8,10,12};
^
Main.java:8: error: incompatible types: int cannot be converted to String
String[] a = {1,3,5,7,8,10,12};
^
Main.java:8: error: incompatible types: int cannot be converted to String
String[] a = {1,3,5,7,8,10,12};
^
Main.java:8: error: incompatible types: int cannot be converted to String
String[] a = {1,3,5,7,8,10,12};
^
Main.java:8: error: incompatible types: int cannot be converted to String
String[] a = {1,3,5,7,8,10,12};
^
Main.java:8: error: incompatible types: int cannot be converted to String
String[] a = {1,3,5,7,8,10,12};
^
Main.java:9: error: incompatible types: int cannot be converted to String
String[] b = {4,6,9,11};
^
Main.java:9: error: incompatible types: int cannot be converted to String
String[] b = {4,6,9,11};
^
Main.java:9: error: incompatible types: int cannot be converted to String
String[] b = {4,6,9,11};
^
Main.java:9: error: incompatible types: int cannot be converted to String
String[] b = {4,6,9,11};
^
Main.java:14: error: cannot find symbol
}else if(a.contains(x)){
^
symbol: method contains(int)
location: variable a of type String[]
Main.java:15: error: cannot find symbol
if(a.contains(y)){
^
symbol: method contains(int)
location: variable a of type String[]
Main.java:18: error: cannot find symbol
}else if(b.contains(x)){
^
symbol: method contains(int)
location: variable b of type String[]
Main.java:19: error: cannot find symbol
if(b.contains(y)){
^
symbol: method contains(int)
location: variable b of type String[]
15 errors
|
s227955377 | p03711 | Java | import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
String[] a = {1,3,5,7,8,10,12};
String[] b = {4,6,9,11};
if(x==y){
System.out.print("Yes");
}else if(x==2 && y==2){
System.out.print("Yes");
}else if(a.contains(x)){
if(a.contains(y)){
System.out.print("Yes");
}
}else if(b.contains(x)){
if(b.contains(y)){
System.out.print("Yes");
}
}else {
System.out.print("No");
}
} | Main.java:25: error: reached end of file while parsing
}
^
1 error
|
s325701980 | p03711 | C++ | #include <iostream>
using namespace std;
int judge(int x, int y, int[] a){
int p;
p = 0;
for (size_t i = 0; i < sizeof(a); i++) {
if (a[i] == x || a[i] == y) {
p++;
}
}
if (p == 2) {
std::cout << "YES" << '\n';
return 0;
}
return 1;
}
int main(int argc, char const *argv[]) {
int x,y,p;
int a[] = {1,3,5,7,8,10,12};
int b[] = {4,6,9,11};
std::cin >> x >> y;
p = 0;
p += judge(x, y, a);
p += judge(x, y, b);
if (p == 2) {
std::cout << "NO" << '\n';
}
return 0;
}
| a.cc:5:31: error: expected ',' or '...' before 'a'
5 | int judge(int x, int y, int[] a){
| ^
a.cc: In function 'int judge(int, int, int*)':
a.cc:8:39: error: 'a' was not declared in this scope
8 | for (size_t i = 0; i < sizeof(a); i++) {
| ^
|
s310451280 | p03711 | C++ | #include "vector"
#include "iostream"
using namespace std;
int main()
{
int x, y;
cin >> x >> y;
vector<int> a = { 1, 3, 5, 7, 8, 10, 12 };
vector<int> b = {4, 6, 9, 11};
vector<int> c = {2};
auto rax = find(a.begin(), a.end(), x);
auto ray = find(a.begin(), a.end(), y);
auto rbx = find(b.begin(), b.end(), x);
auto rby = find(b.begin(), b.end(), y);
auto rcx = find(c.begin(), c.end(), x);
auto rcy = find(c.begin(), c.end(), y);
if (rax != a.end() && ray != a.end())
{
cout << "Yes" << endl;
return 0;
}
else if(rbx != b.end() && rby != b.end())
{
cout << "Yes" << endl;
return 0;
}
else if (rcx != c.end() && rcy != c.end())
{
cout << "Yes" << endl;
return 0;
}
cout << "No" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
13 | auto rax = find(a.begin(), a.end(), x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:13:24: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
13 | auto rax = find(a.begin(), a.end(), x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:14:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
14 | auto ray = find(a.begin(), a.end(), y);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:14:24: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
14 | auto ray = find(a.begin(), a.end(), y);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
15 | auto rbx = find(b.begin(), b.end(), x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:15:24: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
15 | auto rbx = find(b.begin(), b.end(), x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:16:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
16 | auto rby = find(b.begin(), b.end(), y);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:16:24: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
16 | auto rby = find(b.begin(), b.end(), y);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:17:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
17 | auto rcx = find(c.begin(), c.end(), x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:17:24: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
17 | auto rcx = find(c.begin(), c.end(), x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:18:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
18 | auto rcy = find(c.begin(), c.end(), y);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:18:24: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
18 | auto rcy = find(c.begin(), c.end(), y);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~
|
s163355170 | p03711 | C++ | #include<bits/stdc++.h>
#define rep(i,start,lim) for(lld i=start;i<lim;i++)
#define repd(i,start,lim) for(lld i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define br printf("\n")
#define YES printf("YES\n")
#define NO printf("NO\n")
#define all(c) (c).begin(),(c).end()
using namespace std;
#define INF 1011111111
#define LLINF 1000111000111000111LL
#define EPS (double)1e-10
#define MOD 1000000007
#define PI 3.14159265358979323
using namespace std;
typedef long double ldb;
typedef long long lld;
lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
typedef vector<lld> vlld;
typedef pair<lld,lld> plld;
typedef map<lld,lld> mlld;
typedef set<lld> slld;
#define N 1005
lld grp[]={0,1,3,1,2,1,2,1,1,2,1,2,1}
int main()
{
lld n,m;
cin>>n>>m;
cout<<((grp[n]==grp[m])?"Yes":"No");
return 0;
} | a.cc:30:1: error: expected ',' or ';' before 'int'
30 | int main()
| ^~~
|
s594728833 | p03711 | C++ | import Data.List
a1 = [4,6,9,11]
main = do
[x,y] <- map read . words <$> getLine
putStrLn $ solve x y
solve :: Int -> Int -> String
solve x y
| tt x == tt y = "Yes"
| otherwise = "No"
tt :: Int -> Int
tt 2 = 0
tt x
| t == Nothing = 2
| otherwise = 1
where t = find (x==) a1
| a.cc:1:1: error: 'import' does not name a type
1 | import Data.List
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s172734718 | p03711 | Java | import java.util.Scanner;
class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
String x = scanner.next();
String y = scanner.next();
if(x == 2 ) {
x = a;
} else if(x == 4 || x == 6 || x == 9 || x == 11) {
x = b;
} else {
x = c;
}
if(y == 2 ) {
y = a;
} else if(y == 4 || y == 6 || y == 9 || y == 11) {
y = b;
} else {
y = c;
}
if(x ==y) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}
| Main.java:10: error: bad operand types for binary operator '=='
if(x == 2 ) {
^
first type: String
second type: int
Main.java:11: error: cannot find symbol
x = a;
^
symbol: variable a
location: class Main
Main.java:12: error: bad operand types for binary operator '=='
} else if(x == 4 || x == 6 || x == 9 || x == 11) {
^
first type: String
second type: int
Main.java:12: error: bad operand types for binary operator '=='
} else if(x == 4 || x == 6 || x == 9 || x == 11) {
^
first type: String
second type: int
Main.java:12: error: bad operand types for binary operator '=='
} else if(x == 4 || x == 6 || x == 9 || x == 11) {
^
first type: String
second type: int
Main.java:12: error: bad operand types for binary operator '=='
} else if(x == 4 || x == 6 || x == 9 || x == 11) {
^
first type: String
second type: int
Main.java:13: error: cannot find symbol
x = b;
^
symbol: variable b
location: class Main
Main.java:15: error: cannot find symbol
x = c;
^
symbol: variable c
location: class Main
Main.java:18: error: bad operand types for binary operator '=='
if(y == 2 ) {
^
first type: String
second type: int
Main.java:19: error: cannot find symbol
y = a;
^
symbol: variable a
location: class Main
Main.java:20: error: bad operand types for binary operator '=='
} else if(y == 4 || y == 6 || y == 9 || y == 11) {
^
first type: String
second type: int
Main.java:20: error: bad operand types for binary operator '=='
} else if(y == 4 || y == 6 || y == 9 || y == 11) {
^
first type: String
second type: int
Main.java:20: error: bad operand types for binary operator '=='
} else if(y == 4 || y == 6 || y == 9 || y == 11) {
^
first type: String
second type: int
Main.java:20: error: bad operand types for binary operator '=='
} else if(y == 4 || y == 6 || y == 9 || y == 11) {
^
first type: String
second type: int
Main.java:21: error: cannot find symbol
y = b;
^
symbol: variable b
location: class Main
Main.java:23: error: cannot find symbol
y = c;
^
symbol: variable c
location: class Main
16 errors
|
s521802187 | p03711 | Java | import java.util.Scanner;
class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
String x = scanner.next();
String y = scanner.next();
if(x == 2 ) {
x = a;
} else if(x == 4 || x == 6 || x == 9 || x == 11) {
x ==b;
} else {
x == c;
}
if(y == 2 ) {
y = a;
} else if(y == 4 || y == 6 || y == 9 || y == 11) {
y ==b;
} else {
y == c;
}
if(x ==y) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}
| Main.java:13: error: not a statement
x ==b;
^
Main.java:15: error: not a statement
x == c;
^
Main.java:21: error: not a statement
y ==b;
^
Main.java:23: error: not a statement
y == c;
^
4 errors
|
s985659968 | p03711 | C++ | // ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <vector>
using namespace std;
// void debug(vector<int> *v)
// {
// cout << "debug :";
// for (int i = 0; i<v->size(); i++)
// cout << " " << v->at(i);
// cout << endl;
// }
int vector_finder(vector<int> vec, int number) {
auto itr = find(vec.begin(), vec.end(), number);
size_t index = distance(vec.begin(), itr);
if (index != vec.size()) {
return 1;
}
else {
return 0;
}
}
int main() {
vector<int> group1{ 1,3,5,7,8,10,12 };
vector<int> group2{ 4,6,9,11 };
vector<int> group3{ 2 };
int x, y;
cin >> x >> y;
if (vector_finder(group1, x) == 1 && vector_finder(group1, y) == 1) {
cout << "Yes" << endl;
}
else if (vector_finder(group2, x) == 1 && vector_finder(group2, y) == 1) {
cout << "Yes" << endl;
}
else if (vector_finder(group3, x) == 1 && vector_finder(group3, y) == 1) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
//debug(&group1);
//debug(&group2);
//debug(&group3);
return 0;
}
| a.cc: In function 'int vector_finder(std::vector<int>, int)':
a.cc:17:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
17 | auto itr = find(vec.begin(), vec.end(), number);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:4:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:17:24: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
17 | auto itr = find(vec.begin(), vec.end(), number);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s308933860 | p03711 | C++ | #include <iostream>
using namespace std;
int main(){
int x,y;
int a[13] = {0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
cin >> x >> y;
if (a[x] == a[y]){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return0;
} | a.cc: In function 'int main()':
a.cc:14:3: error: 'return0' was not declared in this scope
14 | return0;
| ^~~~~~~
|
s352401373 | p03711 | C++ | #include <iostream>
using namespace std;
int main(){
int x,y;
int a[13] = {0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
cin >> x >> y;
if(a[x] == a[y]){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return0;
} | a.cc: In function 'int main()':
a.cc:14:3: error: 'return0' was not declared in this scope
14 | return0;
| ^~~~~~~
|
s574707887 | p03711 | C++ | #include <iostream>
using namespace std;
int main(){
int x,y;
int a[13] = {-1,0,2,0,1,0,10,0,1,0,1,0};
cin >> x >> y;
if(a[x] == a[y]){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return0;
} | a.cc: In function 'int main()':
a.cc:14:3: error: 'return0' was not declared in this scope
14 | return0;
| ^~~~~~~
|
s099465960 | p03711 | C++ | #include <iostream>
using namespace std;
int main(){
int x,y;
int a[] = {-1,0,2,0,1,0,10,0,1,0,1,0};
cin >> x >> y;
if(a[x] == a[y]){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return0;
} | a.cc: In function 'int main()':
a.cc:14:3: error: 'return0' was not declared in this scope
14 | return0;
| ^~~~~~~
|
s814958428 | p03711 | C++ | #include <iostream>
using namespace std;
int a[] = {-1,0,2,0,1,0,10,0,1,0,1,0};
int main(){
int x,y;
cin >> x >> y;
if(a[x] == a[y]){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
return0;
} | a.cc: In function 'int main()':
a.cc:14:3: error: 'return0' was not declared in this scope
14 | return0;
| ^~~~~~~
|
s614818690 | p03711 | C++ | #include<iostream>
#include<vector>
using namespace std;
void debug(vector<int> *v)
{
cout << "debug :";
for (int i = 0; i<v->size(); i++)
cout << " " << v->at(i);
cout << endl;
}
int vector_finder(std::vector<int> vec, int number) {
auto itr = std::find(vec.begin(), vec.end(), number);
size_t index = std::distance(vec.begin(), itr);
if (index != vec.size()) {
return 1;
}
else {
return 0;
}
}
int main(int argc, char const *argv[]) {
vector<int> group1{ 1,3,5,7,8,10,12 };
vector<int> group2{ 4,6,9,11 };
vector<int> group3{ 2 };
int x, y;
cin >> x >> y;
if (vector_finder(group1, x) == 1 && vector_finder(group1, y) == 1) {
cout << "Yes" << endl;
}
else if (vector_finder(group2, x) == 1 && vector_finder(group2, y) == 1) {
cout << "Yes" << endl;
}
else if (vector_finder(group3, x) == 1 && vector_finder(group3, y) == 1) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
//debug(&group1);
//debug(&group2);
//debug(&group3);
return 0;
}
| a.cc: In function 'int vector_finder(std::vector<int>, int)':
a.cc:14:29: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
14 | auto itr = std::find(vec.begin(), vec.end(), number);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
435 | find(istreambuf_iterator<_CharT> __first,
| ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed:
a.cc:14:29: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
14 | auto itr = std::find(vec.begin(), vec.end(), number);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
s598250237 | p03711 | C++ | #include<iostream>
using namespace std;
char a[100][101], b[102][102];
int main() {
int h, w;
cin >> h >> w;
for(int i = 0; i < h; i++) {
scanf("%s", a[i]);
}
for(int i = 0; i < h+2; i++){
for(int j = 0; j < w+2; j++){
b[i][j] = '#';
}
}
for(int i = 0; i < h; i++){
for(int j = 0; j < w; j++){
b[i+1][j+1] = a[i][j];
}
}
for(int i = 0; i < h+2; i++){
for(int j = 0; j < w+2; j++){
cout << b[i][j] << cout;
}
}
}
| a.cc: In function 'int main()':
a.cc:28:29: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::ostream' {aka 'std::basic_ostream<char>'})
28 | cout << b[i][j] << cout;
| ~~~~~~~~~~~~~~~ ^~ ~~~~
| | |
| | basic_ostream<[...]>
| basic_ostream<[...]>
a.cc:28:29: note: candidate: 'operator<<(int, int)' (built-in)
28 | cout << b[i][j] << cout;
| ~~~~~~~~~~~~~~~~^~~~~~~
a.cc:28:29: note: no known conversion for argument 2 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} 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 'std::ostream' {aka 'std::basic_ostream<char>'} to 'const void*'
301 | operator<<(const void* __p)
| |
s600449938 | p03711 | C++ | int a[] = {-1, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0};
int main(void) {
int x, y;
cin >> x >> y;
if(a[x] == a[y]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> x >> y;
| ^~~
a.cc:7:17: error: 'cout' was not declared in this scope
7 | cout << "Yes" << endl;
| ^~~~
a.cc:7:34: error: 'endl' was not declared in this scope
7 | cout << "Yes" << endl;
| ^~~~
a.cc:9:17: error: 'cout' was not declared in this scope
9 | cout << "No" << endl;
| ^~~~
a.cc:9:33: error: 'endl' was not declared in this scope
9 | cout << "No" << endl;
| ^~~~
|
s421180740 | p03711 | C++ | int a[] = {-1, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0}
int main(void) {
int x, y;
cin >> x >> y;
if(a[x] == a[y]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | a.cc:2:1: error: expected ',' or ';' before 'int'
2 | int main(void) {
| ^~~
|
s271530605 | p03711 | C++ | int a[] = {-1, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0}
int main(void) {
int x, y;
cin >> x >> y;
if(a[x] == a[y]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | a.cc:2:1: error: expected ',' or ';' before 'int'
2 | int main(void) {
| ^~~
|
s453118721 | p03711 | C++ | #include <iostream>
#include <algorithm>
#include <numeric>
using namespace std;
int main() {
long long n;
cin >> n;
vector<long long> a;
for(long long i=0; i<3*n; i++) {
long long j;
cin >> j;
a.push_back(j);
}
for(long long i=0; i<n; i++) {
auto left_min = min_element(a.begin(), a.begin()+n+1);
auto right_max = max_element(a.end()-n-1, a.end());
long long left_diff = a.at(n) - *left_min;
long long right_diff = *right_max - a.at(2*n-i-1);
if(left_diff > right_diff) {
a.erase(left_min);
} else {
a.erase(right_max);
}
}
long long left_sum = accumulate(a.begin(), a.begin()+n, 0LL);
long long right_sum = accumulate(a.begin()+n, a.end(), 0LL);
long long score = left_sum - right_sum;
cout << score << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
10 | vector<long long> a;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <numeric>
+++ |+#include <vector>
4 |
a.cc:10:10: error: expected primary-expression before 'long'
10 | vector<long long> a;
| ^~~~
a.cc:14:5: error: 'a' was not declared in this scope
14 | a.push_back(j);
| ^
a.cc:17:33: error: 'a' was not declared in this scope
17 | auto left_min = min_element(a.begin(), a.begin()+n+1);
| ^
a.cc:27:35: error: 'a' was not declared in this scope
27 | long long left_sum = accumulate(a.begin(), a.begin()+n, 0LL);
| ^
|
s935405072 | p03711 | C++ | #include<cstdio>
#include<cstring>
#include<iostream>
#include<set>
using namespace std;
int main(){
int x, y;
cin >> x >> y;
set<int>s1, s2, s3;
int a[] = {1, 3, 4, 7, 8, 10, 12}, b[] = {4, 6, 9, 11}, c[] = {2};
for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
cout << "Yes"<< endl;
else cout << "No" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:28: error: cannot convert 'int*' to 'const char*'
11 | for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
| ^
| |
| int*
In file included from /usr/include/c++/14/cstring:43,
from a.cc:2:
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
a.cc:12:28: error: cannot convert 'int*' to 'const char*'
12 | for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
| ^
| |
| int*
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
a.cc:13:28: error: cannot convert 'int*' to 'const char*'
13 | for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
| ^
| |
| int*
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
|
s923530353 | p03711 | C++ | #include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main(){
int x, y;
cin >> x >> y;
set<int>s1, s2, s3;
int a[] = {1, 3, 4, 7, 8, 10, 12}, b[] = {4, 6, 9, 11}, c[] = {2};
for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
cout << "Yes"<< endl;
else cout << "No" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:4: error: 'set' was not declared in this scope
8 | set<int>s1, s2, s3;
| ^~~
a.cc:4:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
3 | #include<iostream>
+++ |+#include <set>
4 | using namespace std;
a.cc:8:8: error: expected primary-expression before 'int'
8 | set<int>s1, s2, s3;
| ^~~
a.cc:10:28: error: cannot convert 'int*' to 'const char*'
10 | for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
| ^
| |
| int*
In file included from /usr/include/c++/14/cstring:43,
from a.cc:2:
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
a.cc:10:36: error: 's1' was not declared in this scope
10 | for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
| ^~
a.cc:11:28: error: cannot convert 'int*' to 'const char*'
11 | for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
| ^
| |
| int*
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
a.cc:11:36: error: 's1' was not declared in this scope
11 | for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
| ^~
a.cc:12:28: error: cannot convert 'int*' to 'const char*'
12 | for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
| ^
| |
| int*
/usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
a.cc:12:36: error: 's1' was not declared in this scope
12 | for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
| ^~
a.cc:13:7: error: 's1' was not declared in this scope
13 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:13:37: error: 's2' was not declared in this scope
13 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:13:67: error: 's3' was not declared in this scope
13 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
|
s965802856 | p03711 | C++ | #include<cstdio>
using namespace std;
int main(){
int x, y;
cin >> x >> y;
set<int>s1, s2, s3;
int a[] = {1, 3, 4, 7, 8, 10, 12}, b[] = {4, 6, 9, 11}, c[] = {2};
for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
cout << "Yes"<< endl;
else cout << "No" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:4: error: 'cin' was not declared in this scope
5 | cin >> x >> y;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<cstdio>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:6:4: error: 'set' was not declared in this scope
6 | set<int>s1, s2, s3;
| ^~~
a.cc:2:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
1 | #include<cstdio>
+++ |+#include <set>
2 | using namespace std;
a.cc:6:8: error: expected primary-expression before 'int'
6 | set<int>s1, s2, s3;
| ^~~
a.cc:8:21: error: 'strlen' was not declared in this scope
8 | for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 | using namespace std;
a.cc:8:36: error: 's1' was not declared in this scope
8 | for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
| ^~
a.cc:9:21: error: 'strlen' was not declared in this scope
9 | for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
| ^~~~~~
a.cc:9:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:9:36: error: 's1' was not declared in this scope
9 | for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
| ^~
a.cc:10:21: error: 'strlen' was not declared in this scope
10 | for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
| ^~~~~~
a.cc:10:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:10:36: error: 's1' was not declared in this scope
10 | for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
| ^~
a.cc:11:7: error: 's1' was not declared in this scope
11 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:11:37: error: 's2' was not declared in this scope
11 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:11:67: error: 's3' was not declared in this scope
11 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:12:8: error: 'cout' was not declared in this scope
12 | cout << "Yes"<< endl;
| ^~~~
a.cc:12:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:24: error: 'endl' was not declared in this scope
12 | cout << "Yes"<< endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<cstdio>
+++ |+#include <ostream>
2 | using namespace std;
a.cc:13:9: error: 'cout' was not declared in this scope
13 | else cout << "No" << endl;
| ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:25: error: 'endl' was not declared in this scope
13 | else cout << "No" << endl;
| ^~~~
a.cc:13:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s690423508 | p03711 | C++ | #include<cstdio>
#include<>
using namespace std;
int main(){
int x, y;
cin >> x >> y;
set<int>s1, s2, s3;
int a[] = {1, 3, 4, 7, 8, 10, 12}, b[] = {4, 6, 9, 11}, c[] = {2};
for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
cout << "Yes"<< endl;
else cout << "No" << endl;
return 0;
} | a.cc:2:9: error: empty filename in #include
2 | #include<>
| ^~
a.cc: In function 'int main()':
a.cc:6:4: error: 'cin' was not declared in this scope
6 | cin >> x >> y;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<cstdio>
+++ |+#include <iostream>
2 | #include<>
a.cc:7:4: error: 'set' was not declared in this scope
7 | set<int>s1, s2, s3;
| ^~~
a.cc:2:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
1 | #include<cstdio>
+++ |+#include <set>
2 | #include<>
a.cc:7:8: error: expected primary-expression before 'int'
7 | set<int>s1, s2, s3;
| ^~~
a.cc:9:21: error: 'strlen' was not declared in this scope
9 | for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<cstdio>
+++ |+#include <cstring>
2 | #include<>
a.cc:9:36: error: 's1' was not declared in this scope
9 | for(int i = 0; i<strlen(a); ++i)s1.insert(a[i]);
| ^~
a.cc:10:21: error: 'strlen' was not declared in this scope
10 | for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
| ^~~~~~
a.cc:10:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:10:36: error: 's1' was not declared in this scope
10 | for(int i = 0; i<strlen(b); ++i)s1.insert(b[i]);
| ^~
a.cc:11:21: error: 'strlen' was not declared in this scope
11 | for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
| ^~~~~~
a.cc:11:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:11:36: error: 's1' was not declared in this scope
11 | for(int i = 0; i<strlen(c); ++i)s1.insert(c[i]);
| ^~
a.cc:12:7: error: 's1' was not declared in this scope
12 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:12:37: error: 's2' was not declared in this scope
12 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:12:67: error: 's3' was not declared in this scope
12 | if(s1.count(x) && s1.count(y) || s2.count(x) && s2.count(y) || s3.count(x) && s3.count(y))
| ^~
a.cc:13:8: error: 'cout' was not declared in this scope
13 | cout << "Yes"<< endl;
| ^~~~
a.cc:13:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:24: error: 'endl' was not declared in this scope
13 | cout << "Yes"<< endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<cstdio>
+++ |+#include <ostream>
2 | #include<>
a.cc:14:9: error: 'cout' was not declared in this scope
14 | else cout << "No" << endl;
| ^~~~
a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:25: error: 'endl' was not declared in this scope
14 | else cout << "No" << endl;
| ^~~~
a.cc:14:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s294092124 | p03711 | Java | import java.util.*;
public class Main {
public static void main(String []args) {
Scanner sc = new Scanner(System.in);
int m = sc.nextInt();
int n = sc.nextInt();
Main soln = new Main();
System.out.println((soln.jd(m,n))? 'Yes':'No');
}
private boolean jd(int m, int n) {
if(m==2 || n==2) return false;
return (grp(m)*grp(n)>0)? true:false;
}
private int grp(int k) {
if(k==4 || k==6 || k==9 || k==11) return 1;
else return -1;
}
} | Main.java:9: error: unclosed character literal
System.out.println((soln.jd(m,n))? 'Yes':'No');
^
Main.java:9: error: not a statement
System.out.println((soln.jd(m,n))? 'Yes':'No');
^
Main.java:9: error: ';' expected
System.out.println((soln.jd(m,n))? 'Yes':'No');
^
Main.java:9: error: unclosed character literal
System.out.println((soln.jd(m,n))? 'Yes':'No');
^
Main.java:9: error: not a statement
System.out.println((soln.jd(m,n))? 'Yes':'No');
^
5 errors
|
s076352098 | p03711 | Java | public class Hoge{
public static void main(String[] args){
int x = Integer.parseInt(args[0]);
int y = Integer.parseInt(args[1]);
int group1[] = new int[10];
int group2[] = new int[10];
int x_group = 0;
int y_group = 0;
for(int i=0;i < 7;i++){
if(x == group1[i]){
x_group = 1;
}else if(x == group2[i]){
x_group = 2;
}else{
x_group = 3;
}
}
for(int i=0;i < 7;i++){
if(y == group1[i]){
y_group = 1;
}else if(y == group2[i]){
y_group = 2;
}else{
y_group = 3;
}
}
if(x_group == y_group){
System.out.println("yes");
}else{
System.out.println("no");
}
}
} | Main.java:1: error: class Hoge is public, should be declared in a file named Hoge.java
public class Hoge{
^
1 error
|
s148159014 | p03711 | Java | public class Hoge{
public static void main(String[] args){
int x = Integer.parseInt(args[0]);
int x = Integer.parseInt(args[0]);
int group1[10] = {1,3,5,7,8,10,12};
int group2[10] = {4,6,9,11};
int x_group;
int y_group;
for(int i=0;i=7;i++){
if(x == group1[i]){
x_group = 1;
}else if(x == group2[i]){
x_group = 2;
}else{
x_group = 3;
}
}
for(int i=0;i=7;i++){
if(y == group1[i]){
y_group = 1;
}else if(y == group2[i]){
y_group = 2;
}else{
y_group = 3;
}
}
if(x_group == y_group){
System.out.println("yes");
}else{
System.out.println("no");
}
}
} | Main.java:6: error: ']' expected
int group1[10] = {1,3,5,7,8,10,12};
^
Main.java:6: error: not a statement
int group1[10] = {1,3,5,7,8,10,12};
^
Main.java:6: error: ';' expected
int group1[10] = {1,3,5,7,8,10,12};
^
Main.java:7: error: ']' expected
int group2[10] = {4,6,9,11};
^
Main.java:7: error: not a statement
int group2[10] = {4,6,9,11};
^
Main.java:7: error: ';' expected
int group2[10] = {4,6,9,11};
^
6 errors
|
s435477023 | p03711 | Java | public class Hoge{
public static void main(String[] args){
int x = Integer.parseInt(args[0]);
int x = Integer.parseInt(args[0]);
int group1[7] = {1,3,5,7,8,10,12};
int group2[4] = {4,6,9,11};
int x_group;
int y_group;
for(int i=0;i=7;i++){
if(x == group1[i]){
x_group = 1;
}else if(x == group2[i]){
x_group = 2;
}else{
x_group = 3;
}
}
for(int i=0;i=7;i++){
if(y == group1[i]){
y_group = 1;
}else if(y == group2[i]){
y_group = 2;
}else{
y_group = 3;
}
}
if(x_group == y_group){
System.out.println("yes");
}else{
System.out.println("no");
}
}
} | Main.java:6: error: ']' expected
int group1[7] = {1,3,5,7,8,10,12};
^
Main.java:6: error: not a statement
int group1[7] = {1,3,5,7,8,10,12};
^
Main.java:6: error: ';' expected
int group1[7] = {1,3,5,7,8,10,12};
^
Main.java:7: error: ']' expected
int group2[4] = {4,6,9,11};
^
Main.java:7: error: not a statement
int group2[4] = {4,6,9,11};
^
Main.java:7: error: ';' expected
int group2[4] = {4,6,9,11};
^
6 errors
|
s479267291 | p03711 | C |
#include "stdafx.h"
#include <stdio.h>
int main(void)
{
int x = 0;
int y = 0;
int i = 0;
int group_1[] = { 1,3,5,7,8,10,12 };
int group_2[] = { 4,6,9,11 };
printf("x,yの値を入力\n");
scanf("%d%d", &x, &y);
switch (x)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
for (i = 0; i < 7; i++)
{
if (y == group_1[i])
{
printf("yes\n");
return 0;
}
else if (i == 6)
{
printf("no\n");
return 0;
}
}
case 4:
case 6:
case 9:
case 11:
for (i = 0; i < 4; i++)
{
if (y == group_2[i])
{
printf("yes\n");
return 0;
}
else if (i == 6)
{
printf("no\n");
return 0;
}
}
default:
printf("no\n");
return 0;
// break;
}
} | main.c:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s053793799 | p03711 | C |
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int x = 0;
int y = 0;
int i = 0;
int group_1[] = { 1,3,5,7,8,10,12 };
int group_2[] = { 4,6,9,11 };
printf("x,yの値を入力\n");
scanf("%d%d", &x, &y);
switch (x)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
for (i = 0; i < 7; i++)
{
if (y == group_1[i])
{
printf("yes\n");
system("pause");
return 0;
}
else if (i == 6)
{
printf("no\n");
system("pause");
return 0;
}
}
case 4:
case 6:
case 9:
case 11:
for (i = 0; i < 4; i++)
{
if (y == group_2[i])
{
printf("yes\n");
system("pause");
return 0;
}
else if (i == 6)
{
printf("no\n");
system("pause");
return 0;
}
}
default:
printf("no\n");
system("pause");
return 0;
// break;
}
} | main.c:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s374645684 | p03711 | C++ | import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
sc.close();
HashSet<Integer> group1 = new HashSet<Integer>();
HashSet<Integer> group2 = new HashSet<Integer>();
HashSet<Integer> group3 = new HashSet<Integer>();
group1.add(1);
group1.add(3);
group1.add(5);
group1.add(7);
group1.add(8);
group1.add(10);
group1.add(12);
group2.add(4);
group2.add(6);
group2.add(9);
group2.add(11);
group3.add(2);
HashSet<Integer> agroup = null;
if(group1.contains(a)){
agroup = group1;
}else if(group2.contains(a)){
agroup = group2;
}else if(group3.contains(a)){
agroup = group3;
}
String yorn = "NO";
if(agroup.contains(b)){
yorn = "YES";
}
System.out.println(yorn);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.HashSet;
| ^~~~~~
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.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s781078083 | p03711 | C++ | import java.util.HashSet;
import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
sc.close();
HashSet<Integer> group1 = new HashSet<Integer>();
HashSet<Integer> group2 = new HashSet<Integer>();
HashSet<Integer> group3 = new HashSet<Integer>();
group1.add(1);
group1.add(3);
group1.add(5);
group1.add(7);
group1.add(8);
group1.add(10);
group1.add(12);
group2.add(4);
group2.add(6);
group2.add(9);
group2.add(11);
group3.add(2);
HashSet<Integer> agroup = null;
if(group1.contains(a)){
agroup = group1;
}else if(group2.contains(a)){
agroup = group2;
}else if(group3.contains(a)){
agroup = group3;
}
String yorn = "NO";
if(agroup.contains(b)){
yorn = "YES";
}
System.out.println();
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.HashSet;
| ^~~~~~
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.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s086894656 | p03711 | C | #include "stdafx.h"
#include <stdio.h>
int main()
{
int a[] = { 0,1,3,1,2,1,2,1,1,2,1,2,1 };
int x, y;
scanf("%d", &x);
scanf("%d", &y);
if (a[x] == a[y]) {
printf("Yes\n");
}
else { printf("No\n"); }
return 0;
} | main.c:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s322402828 | p03711 | C++ | #include "stdafx.h"
#include <stdio.h>
int main()
{
int a[] = { 0,1,3,1,2,1,2,1,1,2,1,2,1 };
int x, y;
scanf("%d", &x);
scanf("%d", &y);
if (a[x] == a[y]) {
printf("YES\n");
}
else { printf("NO\n"); }
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s973122969 | p03711 | Java | import java.util.Scanner;
public class Todo {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
if (x == 2 && y == 2) {
System.out.println("Yes");
} else if ((x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12) &&( y == 1 || y == 3 || y == 5
|| y == 7 || y == 8 || y == 10 || y == 12)) {
System.out.println("Yes");
} else if ((x == 4 || x == 6 || x == 9 || x == 11) && (y == 4 || y == 6 || y == 9 || y == 11)) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
} | Main.java:3: error: class Todo is public, should be declared in a file named Todo.java
public class Todo {
^
1 error
|
s247175619 | p03711 | C++ | #include <functional>
#include <iostream>
#include <queue>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <valarray>
#include <vector>
std::vector<std::string> GetInputValues();
std::valarray<int> DeriveSumArr1();
std::valarray<int> DeriveSumArr2();
std::string InputPattern = "InputX";
std::vector<std::string> GetInputValues()
{
std::vector<std::string> InputValuesVect;
if (InputPattern == "Input1") {
InputValuesVect.push_back("2");
InputValuesVect.push_back("3 1 4 1 5 9");
//1
}
else if (InputPattern == "Input2") {
InputValuesVect.push_back("1");
InputValuesVect.push_back("1 2 3");
//-1
}
else if (InputPattern == "Input3") {
InputValuesVect.push_back("3");
InputValuesVect.push_back("8 2 2 7 4 6 5 3 8");
//5
}
else { //実際の入力
while (true) {
std::string wkStr;
std::getline(std::cin,wkStr);
if(std::cin.eof()) break;
InputValuesVect.push_back(wkStr.c_str());
}
}
return InputValuesVect;
}
int N;
int UB;
std::valarray<int> AArr;
int main()
{
std::vector<std::string> InputVect = GetInputValues();
N=atoi(InputVect.at(0).c_str());
UB=3*N-1;
AArr = std::valarray<int> (UB+1);
int CurrInd=0;
std::istringstream iss1(InputVect.at(1));
while(iss1.eof() == false){
int wkInt;
iss1 >> wkInt;
AArr[CurrInd++]=wkInt;
}
std::valarray<int> SumArr1=DeriveSumArr1();
//for(int I=0;I<=(int)SumArr1.size()-1;I++){
// printf("%d,",SumArr1[I]);
//}
//puts("");
std::valarray<int> SumArr2=DeriveSumArr2();
//for(int I=0;I<=(int)SumArr2.size()-1;I++){
// printf("%d,",SumArr2[I]);
//}
//puts("");
int Answer=INT_MIN;
for(int I=N;I<=2*N;I++){
int AnswerKouho=SumArr1[I-1]-SumArr2[I];
if(Answer<AnswerKouho){
Answer=AnswerKouho;
}
}
printf("%d\n",Answer);
}
//添字ごとのTopNの合計の配列を返す(前半部分)
std::valarray<int> DeriveSumArr1()
{
std::valarray<int> SumArr1(UB+1);
std::priority_queue<int,std::vector<int>, std::greater<int> > Que;
int SumVal=0;
for(int I=0;I<=UB;I++){
Que.push(AArr[I]);
SumVal+=AArr[I];
if((int)Que.size()>N){
SumVal-=Que.top();
Que.pop();
}
SumArr1[I]=SumVal;
}
return SumArr1;
}
//添字ごとのTopNの合計の配列を返す(後半部分)
std::valarray<int> DeriveSumArr2()
{
std::valarray<int> SumArr2(UB+1);
std::priority_queue<int> Que;
int SumVal=0;
for(int I=UB;0<=I;I--){
Que.push(AArr[I]);
SumVal+=AArr[I];
if((int)Que.size()>N){
SumVal-=Que.top();
Que.pop();
}
SumArr2[I]=SumVal;
}
return SumArr2;
}
| a.cc: In function 'int main()':
a.cc:79:16: error: 'INT_MIN' was not declared in this scope
79 | int Answer=INT_MIN;
| ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
8 | #include <valarray>
+++ |+#include <climits>
9 | #include <vector>
|
s193692888 | p03711 | C | #include<stdio.h>
int main(){
int num[12]={0,2,0,1,,1,0,0,1,0,1,0};
int x,y;
scanf("%d%d",&x,&y);
if(num[x]==num[y]) printf("Yes\n");
else printf("No\n");
return 0;
} | main.c: In function 'main':
main.c:4:30: error: expected expression before ',' token
4 | int num[12]={0,2,0,1,,1,0,0,1,0,1,0};
| ^
|
s103618565 | p03711 | C++ | #include <stdio.h>
int main(){
int H,W;
int square;
scanf("%d %d",&H,&W);
/*
<=W=>
^
|
H
|
v
*/
if(H%3==0 || W%3==0){
printf("0\n");
return 0;
}
//縦で分ける
/*
A B
A C
*/
square=(W/2)*H;//big
square=square-(H*W-(W-(W/2))*H/2-square);//big - small
//横
/*
A A
B C
*/
if((H/2)*W-(H*W-(H-(H/2))*W/2-((H/2)*W))<square)
square=(H/2)*W-(H*W-(H-(H/2))*W/2-((H/2)*W);
/*
A
B
C
*/
if(W<square)
square=W;
if(H<square)
square=H;
printf("%d",square);
return 0;
} | a.cc: In function 'int main()':
a.cc:32:48: error: expected ')' before ';' token
32 | square=(H/2)*W-(H*W-(H-(H/2))*W/2-((H/2)*W);
| ~ ^
| )
|
s216184728 | p03711 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
using namespace std;
int main(){
std::vector<std::vector<int>> G{{1, 3, 5, 7 ,8 ,10 ,12}, {4, 6, 9, 11},{2}};
bool frag = true
int x,y;
cin >> x >> y;
for(int i=0;i<3;i++){
auto f1 = find(G[i].begin(),G[i].end(),x);
auto f2 = find(G[i].begin(),G[i].end(),y);
if (f1 != G[i].end() && f2 != G[i].end()) {
cout << "Yes" << endl;
frag = false;
}
}
if(frag)
cout << "No" << endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'int'
8 | int x,y;
| ^~~
a.cc:9:10: error: 'x' was not declared in this scope
9 | cin >> x >> y;
| ^
a.cc:9:15: error: 'y' was not declared in this scope
9 | cin >> x >> y;
| ^
|
s402792873 | p03711 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
using namespace std;
int main(){
std::vector<std::vector<int>> G{{1, 3, 5, 7 ,8 ,10 ,12}, {4, 6, 9, 11},{2}};
bool frag = true
int x,y;
cin >> x >> y;
for(int i=0;i<3;i++){
auto f1 = find(G[i].begin(),G[i].end(),x);
auto f2 = find(G[i].begin(),G[i].end(),y);
if (f1 != G[i].end() && f2 != G[i].end()) {
cout << "Yes" << endl;
frag = false
}
}
if(frag)
cout << "No" << endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'int'
8 | int x,y;
| ^~~
a.cc:9:10: error: 'x' was not declared in this scope
9 | cin >> x >> y;
| ^
a.cc:9:15: error: 'y' was not declared in this scope
9 | cin >> x >> y;
| ^
a.cc:15:19: error: expected ';' before '}' token
15 | frag = false
| ^
| ;
16 | }
| ~
|
s223296503 | p03711 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
using namespace std;
int main(){
std::vector<std::vector<int>> G{{1, 3, 5, 7 ,8 ,10 ,12}, {4, 6, 9, 11},{2}};
bool frag = true
int x,y;
cin >> x >> y;
for(int i=0;i<3;i++){
auto f1 = find(G[i].begin(),G[i].end(),x);
auto f2 = find(G[i].begin(),G[i].end(),y);
if (f1 != G[i].end() && f2 != G[i].end()) {
cout << "Yes" << endl;
flag = false
}
}
if(frag)
cout << "No" << endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'int'
8 | int x,y;
| ^~~
a.cc:9:10: error: 'x' was not declared in this scope
9 | cin >> x >> y;
| ^
a.cc:9:15: error: 'y' was not declared in this scope
9 | cin >> x >> y;
| ^
a.cc:15:7: error: 'flag' was not declared in this scope; did you mean 'frag'?
15 | flag = false
| ^~~~
| frag
|
s385920332 | p03711 | C | #include <stdio.h>
long int returnGAP(long int w,long int h){
long int ww, hh,s1,nowmin;
if(w%3==0)return 0;
ww =w/3;//以下Bなら
hh = h/2;
nowmin = (h-hh)*(w-ww) -(h*ww);
s2 =(w-ww);
if(s2>nowmin)nowmin=s2;
ww++;
s1 = (h*ww) -(hh*(w-ww));
if(s1<nowmin)nowmin=s1;
s2 =(w-ww);
if(s2>s1 && s1==nowmin)nowmin=s2;
return nowmin;
}
int main(void){
long int k,l,x,y;
scanf("%d %d",&k,&l);
x =returnGAP(k,l);
y =returnGAP(l,k);
printf("%d",x>y? y:x);
return 0;
} | main.c: In function 'returnGAP':
main.c:8:9: error: 's2' undeclared (first use in this function); did you mean 's1'?
8 | s2 =(w-ww);
| ^~
| s1
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
|
s310714204 | p03711 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
using namespace std;
int main(){
std::vector<std::vector<int>> G{{1, 3, 5, 7 ,8 ,10 ,12}, {4, 6, 9, 11},{2}};
int x,y;
cin >> x >> y;
for(int i=0;i<2;i++){
auto f1 = find(G[i].begin(),G[i].end(),x);
auto f2 = find(G[i].begin(),G[i].end(),y);
cout << f1 << f2 << endl;
if (f1 != G[i].end() && f2 != G[i].end()) cout << "Yes" << endl;
}
cout << "No" << endl;
}
| a.cc: In function 'int main()':
a.cc:13: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> >')
13 | cout << f1 << f2 << 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:: |
s768267046 | p03711 | C++ | # include <iostream>
# include <algorithm>
# include <vector>
using namespace std;
int main(){
std::vector<std::vector<int>> G{{1, 3, 5, 7 ,8 ,10 ,12}, {4, 6, 9,11},{2}};
int x,y;
cin >> x >> y;
for(int i=0;i<2;i++){
bool frag1 = find(G.begin(),G.end(),x);
bool frag2 = find(G.begin(),G.end(),y);
if (frag1 == true && frag2 == true) cout << "Yes" << endl;
}
cout << "No" << endl;
}
| a.cc: In function 'int main()':
a.cc:11:22: error: cannot convert '__gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >' to 'bool' in initialization
11 | bool frag1 = find(G.begin(),G.end(),x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~
| |
| __gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >
a.cc:12:22: error: cannot convert '__gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >' to 'bool' in initialization
12 | bool frag2 = find(G.begin(),G.end(),y);
| ~~~~^~~~~~~~~~~~~~~~~~~~~
| |
| __gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
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/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_equals_val<_Value>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >; _Value = const int]':
/usr/include/c++/14/bits/stl_algobase.h:2107:14: required from '_RandomAccessIterator std::__find_if(_RandomAccessIterator, _RandomAccessIterator, _Predicate, random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<vector<int>*, vector<vector<int> > >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const int>]'
2107 | if (__pred(__first))
| ~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:2152:23: required from '_Iterator std::__find_if(_Iterator, _Iterator, _Predicate) [with _Iterator = __gnu_cxx::__normal_iterator<vector<int>*, vector<vector<int> > >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const int>]'
2152 | return __find_if(__first, __last, __pred,
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
2153 | std::__iterator_category(__first));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:3850:28: required from '_IIter std::find(_IIter, _IIter, const _Tp&) [with _IIter = __gnu_cxx::__normal_iterator<vector<int>*, vector<vector<int> > >; _Tp = int]'
3850 | return std::__find_if(__first, __last,
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
3851 | __gnu_cxx::__ops::__iter_equals_val(__val));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:22: required from here
11 | bool frag1 = find(G.begin(),G.end(),x);
| ~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:270:24: error: no match for 'operator==' (operand types are 'std::vector<int>' and 'const int')
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:1208:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator==(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)'
1208 | operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1208:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1216:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator==(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)'
1216 | operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1216:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46,
from /usr/include/c++/14/string:43:
/usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<int>&, const __new_allocator<_Tp>&)'
215 | operator==(const __new_allocator&, const __new_allocator<_Up>&)
| ^~~~~~~~
/usr/include/c++/14/bits/new_allocator.h:215:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: mismatched types 'const std::__new_allocator<_Tp>' and 'const int'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const std::fpos<_StateT>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const std::allocator<_CharT>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const std::move_iterator<_IteratorL>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const std::move_iterator<_IteratorL>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:270:24: note: 'std::vector<int>' is not derived from 'const std::pair<_T1, _T2>'
270 | { return *__it == _M_value; }
| ~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_strin |
s297591871 | p03711 | C++ | #include <iostream>
int main(void){
int y,x;
cin >> y >> x;
int arr[13] = {0,1,2,1,3,1,3,1,1,3,1,3,1};
if(arr[y] == arr[x])
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | 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 >> y >> x;
| ^~~
| 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:12:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << "Yes" << 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:12:34: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout << "Yes" << 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)
| ^~~~
a.cc:14:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
14 | cout << "No" << 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:14:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
14 | cout << "No" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s710536325 | p03711 | C++ | #include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <complex>
#include <vector>
#include <cstdio>
#include <cmath>
#include <time.h>
#define all(c) ((c).begin(),(c).end())
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n)
#define vsort(v) sort(v.begin(),v.end())
#define vvsort(v) sort(v.begin(),v.end(),greater<int>())
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
//---------------------------------------------------------------------------------------------//
int x, y;
int main() {
cin >> x >> y;
if (x == 2 || y == 2) { cout << "No" << endl; return 0 }
int a[4] = { 4,6,9,11 };
bool flag = 0;
for (int i = 0; i < 4; i++) {
if (x == a[i])flag = 1;
}
bool flagb = 0;
for (int i = 0; i < 4; i++) {
if (y == a[i])flagb = 1;
}
if ((flag == 1 && flagb == 1) || (flag == 0 && flagb == 0)) {
cout << "Yes" << endl;
return 0;
}
else {
cout << "No" << endl;
}
} | a.cc: In function 'int main()':
a.cc:35:63: error: expected ';' before '}' token
35 | if (x == 2 || y == 2) { cout << "No" << endl; return 0 }
| ^~
| ;
|
s503869522 | p03711 | C++ | #include <iostream>
using namespace std;
int main(){
int x,y;
cin >> x >> y;
if(x==1 || x==3 || x==5 || x==7 || x==8 || x==10 || x==12){
if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)printf("Yes"\n);
}else if(x==4 || x==6 || x==9 || x==11){
if(y==4 || y==6 || y==9 || y==11)printf("Yes\n");
}else if(x==2 && y==2){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
}
| a.cc:7:77: error: stray '\' in program
7 | if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)printf("Yes"\n);
| ^
a.cc: In function 'int main()':
a.cc:7:77: error: expected ')' before 'n'
7 | if(y==1 || y==3 || y==5 || y==7 || y==8 || y==10 || y==12)printf("Yes"\n);
| ~ ^~
| )
|
s607485334 | p03711 | C++ | #include <iostream>
#include<algorithm>
#include <vector>
#include <complex>
#include <map>
using namespace std;
int main() {
int s1[7]={1,3,5,7,8,10,12};
int s2[4]={4,6,9,11,13,13,13};
int s3[2]={2,0,0,0,0,0,0};
int x,y;
cin>>x>>y;
for(int i=0;i<7;++i){
if(x==s1[i]&&y==s1[i]){cout<<"Yes"<<endl;}
else if(x==s2[i]&&y==s2[i]){cout<<"Yes"<<endl;}
else if(x==s3[i]&&y==s3[i]){cout<<"Yes"<<endl;}
else{cout<<"No"<<endl;}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:37: error: too many initializers for 'int [4]'
10 | int s2[4]={4,6,9,11,13,13,13};
| ^
a.cc:11:33: error: too many initializers for 'int [2]'
11 | int s3[2]={2,0,0,0,0,0,0};
| ^
|
s561507288 | p03711 | C++ | //
// main.cpp
// B_PictureFrame
//
// Created by user1 on 2017/05/20.
// Copyright © 2017年 user1. All rights reserved.
//
#include <iostream>
int H, W;
char a[100+ 2][100 + 2];
void init(){
for(int h = 0; h<100+2; h++){
for(int w=0; w<100+2; w++){
a[h][w] = '0'; }
}
}
void input(){
std::cin >> H;
std::cin >> W;
//入力
std::string buff;
int ind = 0;
//読み捨て
std::getline(std::cin, buff);
while(std::cin){
std::getline(std::cin, buff);
//Char array's index is offset +1 for head "#".
std::strcpy(&(a[ind+1][1]), buff.c_str());
if(ind >= H) break;
ind ++;
}
}
void solve(){
//add "#" head and tail.
for(int i=0; i<W+2; i++){
a[0][i] = '#';
a[H+1][i] = '#';
}
for(int i=0; i<H+2; i++){
a[i][0] = '#';
a[i][W+1] = '#';
}
}
void show(){
for(int h = 0; h<H+2; h++){
for(int w=0; w<W+2; w++){
printf("%c ", a[h][w]);
}printf("\n");
}
}
int main(int argc, const char * argv[]) {
// insert code here...
init();
input();
//show();
solve();
show();
return 0;
}
| a.cc: In function 'void input()':
a.cc:32:14: error: 'strcpy' is not a member of 'std'
32 | std::strcpy(&(a[ind+1][1]), buff.c_str());
| ^~~~~~
|
s918833904 | p03711 | C++ | import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] s = br.readLine().split(" ");
int a = Integer.parseInt(s[0]);
int b = Integer.parseInt(s[1]);
if((isGPA(a) && isGPA(b)) || (isGPB(a) && isGPB(b)) || (a == 2 && b == 2)){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
public static boolean isGPA(int num){
int[] CNT = {1,3,5,7,8,10,12};
for(int n : CNT){
if(n == num){
return true;
}
}
return false;
}
public static boolean isGPB(int num){
int[] CNT = {4,6,9,11};
for(int n : CNT){
if(n == num){
return true;
}
}
return false;
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.*;
| ^~~~~~
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.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public class Main{
| ^~~~~~
|
s744779020 | p03711 | C++ | int main(){
int x,y;
scanf("%d %d",&x,&y);
switch(x){
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
if (y==1||y==3||y==5||y==7||y==8||y==10||y==12) printf("Yes\n");
else printf("No\n");
break;
case 4:
case 6:
case 9:
case 11:
if(y==4||y==6||y==9||y==11) printf("Yes\n");
else printf("No\n");
break;
case 2:
if(y==2) printf("Yes\n");
else printf("No\n");
break;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:3:5: error: 'scanf' was not declared in this scope
3 | scanf("%d %d",&x,&y);
| ^~~~~
a.cc:12:57: error: 'printf' was not declared in this scope
12 | if (y==1||y==3||y==5||y==7||y==8||y==10||y==12) printf("Yes\n");
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main(){
a.cc:13:14: error: 'printf' was not declared in this scope
13 | else printf("No\n");
| ^~~~~~
a.cc:13:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:19:37: error: 'printf' was not declared in this scope
19 | if(y==4||y==6||y==9||y==11) printf("Yes\n");
| ^~~~~~
a.cc:19:37: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:20:14: error: 'printf' was not declared in this scope
20 | else printf("No\n");
| ^~~~~~
a.cc:20:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:23:18: error: 'printf' was not declared in this scope
23 | if(y==2) printf("Yes\n");
| ^~~~~~
a.cc:23:18: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:24:14: error: 'printf' was not declared in this scope
24 | else printf("No\n");
| ^~~~~~
a.cc:24:14: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s322550623 | p03711 | C++ | #include<iostream>
using namespace std;
int main(){
int x,y,p,q;
int a[] = {1,3,5,7,8,10,12},b[]={4,6,9,11};
cin>>x>>y;
if(x==y) break;
for(int i=0; i<7; i++){
if(x==a[i]){
p=0;
break;
}
}
for(int j=0; j<7; j++){
if(y==a[j]) {
q=0;
break;
}
}
for(int c=0; c<4; c++){
if(x==b[c]) {
p=1;
break;
}
}
for(int d=0; d<4; d++){
if(y==b[d]) {
q=1;
break;
}
}
if(p==q)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
} | a.cc: In function 'int main()':
a.cc:9:12: error: break statement not within loop or switch
9 | if(x==y) break;
| ^~~~~
|
s175717296 | p03711 | C | #include <stdio.h>
int main(void)
{
int x, y;
int a[]={1,3,5,7,8,10,12};
int b[]={4,6,7,9,10};
scanf("%d", &x);
scanf("%d", &y);
for(int i = 0;;i++)
{
if(a[i]==x&&a[i==y]){
pritf("Yes");
break;
}else if(b[i]==x&&b[i]==y){
printf("Yes");
break;
}else if(x==2&&y==2){
printf("Yes");
break;
}else{
printf("No");
break;
}
}
return 0;
} | main.c: In function 'main':
main.c:14:25: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
14 | pritf("Yes");
| ^~~~~
| printf
|
s244043199 | p03711 | Java | import java.util.*;
public class Grouping {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int a = 1, b = 2, c = 3;
if(x == 2) {
x = a;
} else if(x == 4 || x == 6 || x == 9 || x == 11) {
x = b;
} else {
x = c;
}
if(y == 2) {
y = a;
} else if(y == 4 || y == 6 || y == 9 || y == 11) {
y = b;
} else {
y = c;
}
if(x == y) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}
| Main.java:3: error: class Grouping is public, should be declared in a file named Grouping.java
public class Grouping {
^
1 error
|
s586636331 | p03711 | C++ | #include <vector>
#include <algorithm>
class Grouping {
public:
Grouping() {};
int serch(int x) {
std::vector<int>::iterator itr;
itr = find(groupe1.begin(), groupe1.end(), x);
if (itr != groupe1.end()) {
return 1;
}
itr = find(groupe2.begin(), groupe2.end(), x);
if (itr != groupe2.end()) {
return 2;
}
return 3;
}
private:
std::vector<int> groupe1 = {1, 3, 5, 7, 8, 10, 12};
std::vector<int> groupe2 = { 4, 6, 9, 11 };
};
int main() {
Grouping g;
int x, y;
std::cin >> x >> y;
if (g.serch(x) == g.serch(y)) {
std::cout << "Yes" << std::endl;
}
else { std::cout << "No" << std::endl; }
} | a.cc: In function 'int main()':
a.cc:32:14: error: 'cin' is not a member of 'std'
32 | std::cin >> x >> y;
| ^~~
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 |
a.cc:35:22: error: 'cout' is not a member of 'std'
35 | std::cout << "Yes" << std::endl;
| ^~~~
a.cc:35:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:44: error: 'endl' is not a member of 'std'
35 | std::cout << "Yes" << std::endl;
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include <algorithm>
+++ |+#include <ostream>
3 |
a.cc:37:21: error: 'cout' is not a member of 'std'
37 | else { std::cout << "No" << std::endl; }
| ^~~~
a.cc:37:21: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:42: error: 'endl' is not a member of 'std'
37 | else { std::cout << "No" << std::endl; }
| ^~~~
a.cc:37:42: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s923085946 | p03711 | C | #include <stdio.h>
int main(void)
{
int x, y;
int a[]={1,3,5,7,8,10,12};
int b[]={4,6,7,9,10};
scanf("%d %d",&x, &y);
for(int i = 0;;i++)
{
if(a[i]==x&&a[i==y]){
pritf("Yes");
}else if(b[i]==x&&b[i]==y){
printf("Yes");
}else if(x==2&&y==2){
printf("Yes");
}else{
printf("No");
}
}
return 0;
} | main.c: In function 'main':
main.c:13:25: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
13 | pritf("Yes");
| ^~~~~
| printf
|
s420837331 | p03711 | C++ | #include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int n,m,g1,g2;
cin >> n;
if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)
{
g1 = 1;
}
else if (n == 4 || n == 6 || n == 9 || n == 11)
{
g1 = 2;
}
else
{
g1 == 3;
}
cin >> n;
if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)
{
g2 = 1;
}
else if (n == 4 || n == 6 || n == 9 || n == 11)
{
g2 = 2;
}
else
{
g2 == 3;
}
if (g1 == g2)
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
}
return 0;
}
| a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s458414540 | p03711 | C++ | // Grouping.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int n,m,g1,g2;
cin >> n;
if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)
{
g1 = 1;
}
else if (n == 4 || n == 6 || n == 9 || n == 11)
{
g1 = 2;
}
else
{
g1 == 3;
}
cin >> n;
if (n == 1 || n == 3 || n == 5 || n == 7 || n == 8 || n == 10 || n == 12)
{
g2 = 1;
}
else if (n == 4 || n == 6 || n == 9 || n == 11)
{
g2 = 2;
}
else
{
g2 == 3;
}
if (g1 == g2)
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
}
return 0;
}
| a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s763802507 | p03711 | C++ | // clang-format off
#include <bits/stdc++.h>
#include<string>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
// clang-format on
int main() {
int x, y;
cin >> x >> y;
if (x == 2 || y == 2) {
cout << "No" << endl;
} else if (x == 4) {
if (y == 6) {
cout << "Yes" << endl;
} else if (y == 9) {
cout << "Yes" << endl;
} else if (y == 11) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (x == 6) {
if (y == 9) {
cout << "Yes" << endl;
} else if (y == 11) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} else if (x == 9) {
if (y == 11) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
else if (x == 11) {
cout << "No" << endl;
}
} else {
cout << "Yes" << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:38:5: error: expected '}' before 'else'
38 | else if (x == 11) {
| ^~~~
a.cc:32:22: note: to match this '{'
32 | } else if (x == 9) {
| ^
a.cc: At global scope:
a.cc:41:5: error: expected unqualified-id before 'else'
41 | } else {
| ^~~~
a.cc:44:3: error: expected unqualified-id before 'return'
44 | return 0;
| ^~~~~~
a.cc:45:1: error: expected declaration before '}' token
45 | }
| ^
|
s978168783 | p03711 | C++ |
#include<iostream>
#include<string>
using namespace std;
int A() {
int a;
int b;
cin >> a >> b;
int ga=0;
switch (a) {
case 1:
case 3:
case 5:
case 7:
case 8:case 10:case 12:
ga = 1;
break;
case 4:case 6:case 9:case 11:
ga = 2;
break;
case 2:
ga = 3;
break;
}
int gb = 0;
switch (b) {
case 1:
case 3:
case 5:
case 7:
case 8:case 10:case 12:
gb = 1;
break;
case 4:case 6:case 9:case 11:
gb = 2;
break;
case 2:
gb = 3;
break;
}
if (ga == gb) cout << "Yes";
else cout << "No";
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
|
s956304633 | p03711 | C++ | #include <stdio.h>
int main()
{
int x, y;
int a[]={1,3,5,7,8,10,12};
int b[]={4,6,7,9,10};
scanf("%d %d",x, y);
for(int i = 0;;i++)
{
if(a[i]==x&&a[i==y]){
pritf("Yes");
}else if(b[i]==x&&b[i]==y){
printf("Yes");
}else if(x==2&&y==2){
printf("Yes");
}else{
printf("No");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:25: error: 'pritf' was not declared in this scope; did you mean 'printf'?
13 | pritf("Yes");
| ^~~~~
| printf
a.cc:23:2: error: expected '}' at end of input
23 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s612972799 | p03711 | C++ | #include<iostream>
using namespace std;
int set[100];
int findSet(int x){
if (x == set[x])
return x;
else
return set[x] = findSet(set[x]);
}
void unionSet(int x,int y)
{
int fx = findSet(x);
int fy = findSet(y);
set[fy] = fx;
}
int main(){
int m,n;
cin>>m>n;
for (int i = 1; i <= 100; i++)
set[i]=i;
set[3]=1;
set[5]=1;
set[7]=1;
set[8]=1;
set[10]=1;
set[12]=1;
set[6]=4;
set[9]=5;
set[11]=4;
if (findSet(m)==findSet(n)) cout<<"Yes"; else cout<<"No"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:11: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
18 | cin>>m>n;
| ~~~~~~^~
| | |
| | int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:18:11: note: candidate: 'operator>(int, int)' (built-in)
18 | cin>>m>n;
| ~~~~~~^~
a.cc:18:11: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/string:48,
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/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cin>>m>n;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
18 | cin>>m>n;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | cin>>m>n;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
18 | cin>>m>n;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
18 | cin>>m>n;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cin>>m>n;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | cin>>m>n;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
18 | cin>>m>n;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
18 | cin>>m>n;
| ^
/usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
18 | cin>>m>n;
| ^
/usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3942 | operator>(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
18 | cin>>m>n;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2619 | operator>(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed:
a.cc:18:12: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
18 | cin>>m>n;
| ^
|
s538708485 | p03711 | C++ | #include <iostream>
using namespace std;
int main() {
cin >> x >> y;
if(x==2){
if(y==2){
cout << "Yes";
}else{
cout << "No";
}
}else{
if((x==4)||(x==6)||(x==9)||(x==11)){
if((y==4)||(y==6)||(y==9)||(y==11)){
cout << "Yes";
}else{
cout << "No";
}
}else{
if((y==3)||(y==1)||(y==5)||(y==7)||(y==8)||(y==10)||(y==12)){
cout << "Yes";
}else{
cout << "No";
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:16: error: 'x' was not declared in this scope
5 | cin >> x >> y;
| ^
a.cc:5:21: error: 'y' was not declared in this scope
5 | cin >> x >> y;
| ^
|
s921220594 | p03711 | C++ | (defun solver ()
(let* ((x (read)) (y (read))
(a 1) (b 2) (c 3)
(array (vector 0 a c a b a b a a b a b a)))
(if (= (svref array x) (svref array y))
(format t "YES~%")
(format t "NO~%"))))
(solver) | a.cc:1:7: error: expected ')' before 'solver'
1 | (defun solver ()
| ~ ^~~~~~~
| )
|
s706168807 | p03711 | Java |
for (int i : a) {
if (i == x) {
tmpX = 1;
}
if (i == y) {
tmpY = 1;
}
} | Main.java:2: error: class, interface, enum, or record expected
for (int i : a) {
^
Main.java:5: error: class, interface, enum, or record expected
}
^
Main.java:8: error: class, interface, enum, or record expected
}
^
3 errors
|
s172543189 | p03711 | C++ | #include <cstdio>
#include <iostream>
#include <string>
int main() {
int x, y;
scanf("%d%d", &x, &y);
int group[] = { 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0 };
if (gropu[x - 1] == gropu[y - 1]) {
puts("Yes");
}
else {
puts("No");
}
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gropu' was not declared in this scope; did you mean 'group'?
9 | if (gropu[x - 1] == gropu[y - 1]) {
| ^~~~~
| group
|
s307373811 | p03711 | C++ | #include<bits/stdc++.h>
using namespace std;
int a[12] = {1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
int main() {
int x, y;
cin >> x >> y;
cout << (a[x-1] == a[y-1] ? "Yes" : "No") << endl;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int a[12] = {1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
int main() {
int x, y;
cin >> x >> y;
cout << (a[x-1] == a[y-1] ? "Yes" : "No") << endl;
return 0;
}
| a.cc:15:5: error: redefinition of 'int a [12]'
15 | int a[12] = {1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
| ^
a.cc:4:5: note: 'int a [12]' previously defined here
4 | int a[12] = {1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
| ^
a.cc:16:5: error: redefinition of 'int main()'
16 | int main() {
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main() {
| ^~~~
|
s795851931 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
vector <vector<int>> data(A, vector<int>(B))
for (int i=0; i<A; i++) {
for (int j=0; j<B; j++) {
cin >> data.at(i).at(j);
}
}
int i=0;
while (i<B+2) {
cout << "#";
i++;
}
cout << endl;
for (int j=0; j<A; j++) {
cout << "#";
for (int k=0; k<B; k++) {
cout << data.at(j).at(k);
}
cout << "#" << endl;
}
int j=0;
while (j<B+2) {
cout << "#";
j++;
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
9 | for (int i=0; i<A; i++) {
| ^~~
a.cc:9:17: error: 'i' was not declared in this scope
9 | for (int i=0; i<A; i++) {
| ^
|
s845851914 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
vector <vector<int>> data(A, vector<int>(B))
for (int i=0; i<A; i++) {
for (int j=0; j<B; j++) {
cin >> data.at(i).at(j);
}
}
int i=0;
while (i<B+2) {
cout << #;
i++;
}
cout << endl;
for (int j=0; j<A; j++) {
cout << #;
for (int k=0; k<B; k++) {
cout << data.at(j).at(k);
}
cout << # << endl;
}
int j=0;
while (j<B+2) {
cout << #;
j++;
}
cout << endl;
}
| a.cc:17:13: error: stray '#' in program
17 | cout << #;
| ^
a.cc:24:13: error: stray '#' in program
24 | cout << #;
| ^
a.cc:28:13: error: stray '#' in program
28 | cout << # << endl;
| ^
a.cc:33:13: error: stray '#' in program
33 | cout << #;
| ^
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
9 | for (int i=0; i<A; i++) {
| ^~~
a.cc:9:17: error: 'i' was not declared in this scope
9 | for (int i=0; i<A; i++) {
| ^
a.cc:17:14: error: expected primary-expression before ';' token
17 | cout << #;
| ^
a.cc:24:14: error: expected primary-expression before ';' token
24 | cout << #;
| ^
a.cc:28:15: error: expected primary-expression before '<<' token
28 | cout << # << endl;
| ^~
a.cc:33:14: error: expected primary-expression before ';' token
33 | cout << #;
| ^
|
s191189587 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w = 0;
cin >> h >> w;
vector<string> str(h);
for(int i=0;i<h;i++){
cin >> str.at(i);
}
for(int i=0;i<w+2;i++){
cout << "#";
}
cout << endl;
for(int i=0;i<h;i++){
cout << "#" + str.at(j) + "#";
}
cout << endl;
for(int i=0;i<w+2;i++){
cout << "#";
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:18:26: error: 'j' was not declared in this scope
18 | cout << "#" + str.at(j) + "#";
| ^
|
s446169705 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> w;
vector<string> a(H);
for (int i = 0; i < W; i++) {
cin >> a.at(i);
}
for (int i = 0; i < W + 2; i++) {
cout << "#" << endl;
}
for (int i = 0; i < H; i++) {
cout << "#" << a.at(i) << "#" << endl;
}
for (int i = 0; i < W + 2; i++) {
cout << "#" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:15: error: 'w' was not declared in this scope
6 | cin >> H >> w;
| ^
|
s756444396 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
for(int i = 0; i<w; i++){
cout<<"#";
}
for(int i = 0; i < h; i++){
cout<<endl<<"#";
for(int j = 0; j < w; j++){
vector<int> vec(w);
cin >> vec.at(j);
cout<< vec.at(j);
}
cout<<"#"<<endl;
}
for(int i = 0; i<W; i++){
cout<<"#";
}
}
| a.cc: In function 'int main()':
a.cc:21:24: error: 'W' was not declared in this scope
21 | for(int i = 0; i<W; i++){
| ^
|
s914518601 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
for(int i = 0; i<w; i++{
cout<<"#";
}
for(int i = 0; i < h; i++){
cout<<endl<<"#";
for(int j = 0; j < w; j++){
vector<int> vec(w);
cin >> vec.at(j);
cout<< vec.at(j);
}
cout<<"#"<<endl;
}
for(int i = 0; i<W; i++{
cout<<"#";
}
}
| a.cc: In function 'int main()':
a.cc:8:26: error: expected ')' before '{' token
8 | for(int i = 0; i<w; i++{
| ~ ^
| )
a.cc:21:24: error: 'W' was not declared in this scope
21 | for(int i = 0; i<W; i++{
| ^
a.cc:21:30: error: expected ')' before '{' token
21 | for(int i = 0; i<W; i++{
| ~ ^
| )
|
s199117993 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
for(int i = 0; i<W; i++{
cout<<"#";
}
for(int i = 0; i < h; i++){
cout<<endl<<"#";
for(int j = 0; j < w; j++){
vector<int> vec(w);
cin >> vec.at(j);
cout<< vec.at(j);
}
cout<<"#"<<endl;
}
for(int i = 0; i<W; i++{
cout<<"#";
}
}
| a.cc: In function 'int main()':
a.cc:8:20: error: 'W' was not declared in this scope
8 | for(int i = 0; i<W; i++{
| ^
a.cc:8:26: error: expected ')' before '{' token
8 | for(int i = 0; i<W; i++{
| ~ ^
| )
a.cc:21:24: error: 'W' was not declared in this scope
21 | for(int i = 0; i<W; i++{
| ^
a.cc:21:30: error: expected ')' before '{' token
21 | for(int i = 0; i<W; i++{
| ~ ^
| )
|
s425734030 | p03712 | C++ | char a [100][101] , b [102][102];
int main () {
int H , W ; cin >> H >> W ;
for ( int i = 0; i < H ; i ++)
scanf ("% s " , a [ i ]);
1
for ( int i = 0; i < H + 2; i ++)
for ( int j = 0; j < W + 2; j ++)
b [ i ][ j ] = ’# ’;
for ( int i = 0; i < H ; i ++)
for ( int j = 0; j < W ; j ++)
b [ i + 1][ j + 1] = a [ i ][ j ];
for ( int i = 0; i < H + 2; i ++) {
for ( int j = 0; j < W + 2; j ++)
cout << b [ i ][ j ];
cout << endl ;
}
}
| a.cc:9:16: error: extended character ’ is not valid in an identifier
9 | b [ i ][ j ] = ’# ’;
| ^
a.cc:9:17: error: stray '#' in program
9 | b [ i ][ j ] = ’# ’;
| ^
a.cc:9:19: error: extended character ’ is not valid in an identifier
9 | b [ i ][ j ] = ’# ’;
| ^
a.cc: In function 'int main()':
a.cc:3:13: error: 'cin' was not declared in this scope
3 | int H , W ; cin >> H >> W ;
| ^~~
a.cc:5:1: error: 'scanf' was not declared in this scope
5 | scanf ("% s " , a [ i ]);
| ^~~~~
a.cc:6:2: error: expected ';' before 'for'
6 | 1
| ^
| ;
7 | for ( int i = 0; i < H + 2; i ++)
| ~~~
a.cc:7:18: error: 'i' was not declared in this scope
7 | for ( int i = 0; i < H + 2; i ++)
| ^
a.cc:8:18: error: 'j' was not declared in this scope
8 | for ( int j = 0; j < W + 2; j ++)
| ^
a.cc:15:1: error: 'cout' was not declared in this scope
15 | cout << b [ i ][ j ];
| ^~~~
a.cc:16:1: error: 'cout' was not declared in this scope
16 | cout << endl ;
| ^~~~
a.cc:16:9: error: 'endl' was not declared in this scope
16 | cout << endl ;
| ^~~~
|
s458466160 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H, W,i;
cin >> H >>W;
vector <string>vec(H);
for(i=0;i<H;i++){
cin >>vec.at(i);
}
string s = "#";
cout << s*(W+2)<<endl;
for(i=0;i<H;i++){
cout << s << vec.at(i)<<s<<endl;
}
cout << s*(W+2)<<endl;
} | a.cc: In function 'int main()':
a.cc:11:10: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
11 | cout << s*(W+2)<<endl;
| ~^~~~~~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)'
400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)'
409 | operator*(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)'
418 | operator*(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: mismatched types 'const std::complex<_Tp>' and 'int'
11 | cout << s*(W+2)<<endl;
| ^
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: note: template argument deduction/substitution failed:
a.cc:11:15: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)'
1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed:
a.cc:11:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed:
a.cc:11:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
11 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1198:1: note: template argument deduction/substitution failed:
a.cc:11:15: note: mismatched types 'const std::valarray<_Tp>' and 'int'
11 | cout << s*(W+2)<<endl;
| ^
a.cc:15:10: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
15 | cout << s*(W+2)<<endl;
| ~^~~~~~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
/usr/include/c++/14/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)'
400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:400:5: note: template argument deduction/substitution failed:
a.cc:15:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
15 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)'
409 | operator*(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:409:5: note: template argument deduction/substitution failed:
a.cc:15:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
15 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)'
418 | operator*(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:418:5: note: template argument deduction/substitution failed:
a.cc:15:15: note: mismatched types 'const std::complex<_Tp>' and 'int'
15 | cout << s*(W+2)<<endl;
| ^
/usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:407:5: n |
s325016602 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int H , W ;
cin >> H >> W ;
string a;
int i,all = H*W;
for (i=1;i<=all;i++){
cin >> a[i] ;
}
for (i=1;i<=W+2;i++){
cout << "#" ;
}cout << endl;
cout << "#";
for (i=1;i<=W;i++){
cout << a[i];
}cout << "#" << endl;
for (int h=2;h<=H;h++){
cout << "#";
int P = W*h-(W-1);
for (i=P;i<W+P;i++){
cout << a[i];
}
}
cout << "#" << endl;
for (i=1;i<=W+2;i++){
cout << "#" ;
}cout << endl;
}
} | a.cc:35:1: error: expected declaration before '}' token
35 | }
| ^
|
s425472261 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> vec(W);
for (int i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
for (int i = 0; i < H; i++){
cout << "#";
for (int j = 0; j < W; j++){
cin >> vec.at(j);
cout << vec.at(j);
}
cout << "#" << endl;
}
for (i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
} | a.cc: In function 'int main()':
a.cc:19:8: error: 'i' was not declared in this scope
19 | for (i = 0; i < W + 2; i++)
| ^
|
s390514480 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> vec(W);
for (int i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++)
cin >> vec.at(j);
cout << "#" << vec << "#" << endl;
}
for (i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
} | a.cc: In function 'int main()':
a.cc:14:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::vector<std::__cxx11::basic_string<char> >')
14 | cout << "#" << vec << "#" << endl;
| ~~~~~~~~~~~ ^~ ~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::basic_ostream<char>
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/ |
s044486256 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> vec(W);
for (i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
for (i = 0; i < H; i++){
for (j = 0; j < W; j++)
cin >> vec.at(j);
cout << "#" << vec << "#" << endl;
}
for (i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
} | a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
8 | for (i = 0; i < W + 2; i++)
| ^
a.cc:11:8: error: 'i' was not declared in this scope
11 | for (i = 0; i < H; i++){
| ^
a.cc:12:10: error: 'j' was not declared in this scope
12 | for (j = 0; j < W; j++)
| ^
a.cc:14:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::vector<std::__cxx11::basic_string<char> >')
14 | cout << "#" << vec << "#" << endl;
| ~~~~~~~~~~~ ^~ ~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::basic_ostream<char>
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' 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:: |
s924101889 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin >> a>>b;
vector<char>vec(a*b);
for (int i=0;i<(a*b);i++){
cin >> vec[i];
}
for (int j=0;j<(b+2);j++){
cout<< '#';
}
cout << endl;
for(int m=0;m<a;m++){
for(int n=0;n<b;n++){
cout << '#'<<vec.at(n+m*b) <<'#'<<
}
cout << endl;
}
for(int i=0;i<b+2;i++){
cout <<'#';
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:18:5: error: expected primary-expression before '}' token
18 | }
| ^
|
s906624387 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin >> a>>b;
vector<char>vec(a*b);
for (int i=0;i<vec.size();i++){
cin >> vec[i];
}
for (int j=0;j<b+2;j++){
cout<< '#';
}
cout << endl;
for(int m=0;m<a;m++){
for(int n=0;n<b;n++){
cout << '#'<<vec.at(n+m*b) <<'#'<<
}
cout << endl;
}
for(int i=0;i<b+2;i++){
cout <<'#';
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:18:5: error: expected primary-expression before '}' token
18 | }
| ^
|
s432645231 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin >> a>>b;
vector<char>vec(a*b);
for (int i=0;i<vec.size();i++){
cin >> vec[i];
}
for (int j=0;j<b+2;j++){
cout<< '#';
}
cout << endl;
for(m=0;m<a;m++){
for(n=0;n<b;n++){
cout << '#'<<vec.at(n+m*b) <<'#'<<
}
cout << endl;
}
for(int i=0;i<b+2;i++){
cout <<'#';
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:15:7: error: 'm' was not declared in this scope
15 | for(m=0;m<a;m++){
| ^
a.cc:16:9: error: 'n' was not declared in this scope
16 | for(n=0;n<b;n++){
| ^
a.cc:18:5: error: expected primary-expression before '}' token
18 | }
| ^
|
s558842511 | p03712 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
int main() {
int H, W; std::cin >> H >> W;
std::vector<std::vector<char>> A(H, std::vector<char>(W));
for (int i = 0; i < H; ++i) {
for (int j = 0; i < W; ++j)
std::cin >> A[i][j];
for (int i = 0; i < W + 2; ++i)
std::cout << '#';
std::cout << std::endl;
for (int i = 0; i < H; ++i) {
std::cout << '#';
for (int j = 0; i < W; ++j) {
std::cin >> A[i][j];
std::cout << A[i][j];
}
std::cout << '#' << std::endl;
}
for (int i = 0; i < W + 2; ++i)
std::cout << '#';
std::cout << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:9:12: note: to match this '{'
9 | int main() {
| ^
|
s679783755 | p03712 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
int main() {
int H, W; std::cin >> H >> W;
std::vector<std::vector<char>> A(H, std::vector<char>(W));
for (int i = 0; i < H; ++i) {
for (int j = 0; i < W; ++j)
std::cin >> A[i][j];
for (int i = 0; i < W + 2; ++i)
std::cout << '#';
std::cout << std::endl;
for (int i = 0; i < H; ++i) {
std::cout << '#';
for (int j = 0; i < W; ++j) {
std::cin >> A[i][j];
std::cout << A[i][j];
}
std::cout << '#' << std::endl;
}
for (int i = 0; i < W + 2; ++i)
std::cout << '#';
std::cout << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:9:12: note: to match this '{'
9 | int main() {
| ^
|
s531716018 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main (){
int H,W;
vector<string> line(H);
cin>>H>>W;
for(int i=0;i<W+2<i++){
cout<<"#";
}
cout<<endl;
for(int i=0;i<H;i++){
cin>>line.at(i);
cout<<"#"+line.at(i)<<"#"<<endl;
}
for(int i=0;i<W+2;i++){
cout<<"#";
}
}
| a.cc: In function 'int main()':
a.cc:7:24: error: expected ';' before ')' token
7 | for(int i=0;i<W+2<i++){
| ^
| ;
|
s044014921 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main (){
int H,W;
vector<string> line(H);
cin>>H>>W;
for(int i=0;i<W+2<i++){
cout<<"#";
}
cout<<endl;
for(int i=0;i<H;i++){
cin>>line.at(i);
cout<<"#"+line.at(i)<<"#"<<endl;
}
for(int i=0;i<W+2<i++){
cout<<"#";
}
}
| a.cc: In function 'int main()':
a.cc:7:24: error: expected ';' before ')' token
7 | for(int i=0;i<W+2<i++){
| ^
| ;
a.cc:15:24: error: expected ';' before ')' token
15 | for(int i=0;i<W+2<i++){
| ^
| ;
|
s056770412 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main (){
int H,W;
vector<string> line(H);
cin>>H>>W;
for(i=0;i<W+2<i++){
cout<<"#";
}
cout<<endl;
for(i=0;i<H;i++){
cin>>line.at(i);
cout<<"#"+line.at(i)<<"#"<<endl;
}
for(i=0;i<W+2<i++){
cout<<"#";
}
}
| a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
7 | for(i=0;i<W+2<i++){
| ^
a.cc:7:20: error: expected ';' before ')' token
7 | for(i=0;i<W+2<i++){
| ^
| ;
a.cc:11:7: error: 'i' was not declared in this scope
11 | for(i=0;i<H;i++){
| ^
a.cc:15:7: error: 'i' was not declared in this scope
15 | for(i=0;i<W+2<i++){
| ^
a.cc:15:20: error: expected ';' before ')' token
15 | for(i=0;i<W+2<i++){
| ^
| ;
|
s204324817 | p03712 | Java | package car;
import java.util.Scanner;
public class main{
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int h = s.nextInt();
int w = s.nextInt();
String n = "", nn = "";
for(int i = 0; i < w + 2; i++) n += "#";
System.out.println(n);
for(int i = 0; i < h; i++) {
nn = s.next();
System.out.println("#" + nn + "#");
}
System.out.println(n);
}
}
| Main.java:5: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s260590916 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
vector<string> s(a);
int i;
for(i = 0;i < a;i++){
cin >> s.at(i);
}
for(i = 0;i<=(b+1);i++){
cout << '#';
}
cin >> endl;
for(i = 0;i<a;i++){
cout << '#' << s.at(i) << '#' << endl;
}
for(i = 0;i<=(b+1);i++){
cout << '#';
}
} | a.cc: In function 'int main()':
a.cc:15:7: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>')
15 | cin >> endl;
| ~~~~^~~~~~~
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ |
s181048822 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W ;
vector<vector<int>> data(H, vector<int>(W));
for (int j = 0; j < H; j++){
for (int i = 0; i < W; i++) {
cin >> data.at(i).at(j);
}
}
vector<vector<int>> ans(H+2, vector<int>(W+2));
for (int j = 0; j < H; j++){
for (int i = 0; i < W; i++) {
data.at(i).at(j) = "#";
}
}
for (int j=1; j < H-1;j++){
for (int i = 1; i < W-1; i++) {
ans.at(i).at(j) = data.at(i-1).at(j-1);
}
cout << data<< endl;
}
| a.cc: In function 'int main()':
a.cc:16:28: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} [-fpermissive]
16 | data.at(i).at(j) = "#";
| ^~~
| |
| const char*
a.cc:23:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::vector<int> >')
23 | cout << data<< endl;
| ~~~~ ^~ ~~~~
| | |
| | std::vector<std::vector<int> >
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<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 'std::vector<std::vector<int> >' to 'const void*'
301 | operator<<(const void* __p)
| |
s320671333 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W ;
vector<vector<int>> data(H, vector<int>(W));
for (int j = 0; j < H; j++){
for (int i = 0; i < W; i++) {
cin >> data.at(i).at(j);
}
}
vector<vector<int>> ans(H+2, vector<int>(W+2));
for (int j = 0; j < H; j++){
for (int i = 0; i < W; i++) {
data.at(i).at(j) = "#"
}
}
for (int j=1; j < H-1:j++){
for (int i = 1; i < W-1; i++) {
ans.at(i).at(j) = data.at(i-1).at(j-1)
}
for (int j = 0; j < H; j++){
for (int i = 0; i < W; i++) {
cout << data<< endl;
}
} | a.cc: In function 'int main()':
a.cc:16:28: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} [-fpermissive]
16 | data.at(i).at(j) = "#"
| ^~~
| |
| const char*
a.cc:16:31: error: expected ';' before '}' token
16 | data.at(i).at(j) = "#"
| ^
| ;
17 | }
| ~
a.cc:19:17: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
19 | for (int j=1; j < H-1:j++){
| ^
a.cc:19:24: error: expected ';' before ':' token
19 | for (int j=1; j < H-1:j++){
| ^
| ;
a.cc:27:4: error: expected primary-expression at end of input
27 | }
| ^
a.cc:27:4: error: expected ';' at end of input
27 | }
| ^
| ;
a.cc:27:4: error: expected primary-expression at end of input
a.cc:27:4: error: expected ')' at end of input
27 | }
| ^
| )
a.cc:19:7: note: to match this '('
19 | for (int j=1; j < H-1:j++){
| ^
a.cc:27:4: error: expected statement at end of input
27 | }
| ^
a.cc:27:4: error: expected '}' at end of input
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s568032823 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<char> picture(H*W);
for (int i=0; i<H; i++) {
for (int j=0; j<W; j++) {
cin >> picture(i+j);
}
}
for (int j=0; j<W; j++) {
cout << "#";
}
cout << endl;
for (int i=0; i<H; i++) {
cout << "#";
for (int j=0; j<W; j++) {
cout << picture.at(i+j);
}
cout << "#" << endl;
}
for (int j=0; j<W; j++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:10:21: error: no match for call to '(std::vector<char>) (int)'
10 | cin >> picture(i+j);
| ~~~~~~~^~~~~
|
s337058677 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,d,e;
string c;
cin >> a >> b;
vector<string> vec(a);
/for (int i = 0; i < a; i++) {
for (int j = 0; j < b; j++) {
cin >> c;
vec.push_back(c);
}
}
for(int i = 0 ; i < b-1 ; i++){
cout << "#";
}
cout << "#" << endl;
for(int i = 0 ; i < a ; i++){
cout << "#";
cout << c.at(i);
cout << "#" << endl;
}
for(int i = 0 ; i < a ; i++){
cout << "#";
}
cout << "#" << endl;
} | a.cc: In function 'int main()':
a.cc:9:2: error: expected primary-expression before '/' token
9 | /for (int i = 0; i < a; i++) {
| ^
a.cc:9:3: error: expected primary-expression before 'for'
9 | /for (int i = 0; i < a; i++) {
| ^~~
a.cc:9:19: error: 'i' was not declared in this scope
9 | /for (int i = 0; i < a; i++) {
| ^
|
s652822152 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string box;
for (int j = 0; j < W + 2; j++) {
box += '#';
}
vector<string> total(H + 2);
total.at(0) = box;
for (int i = 0; i < H; i++) {
string a;
cin >> a;
string newa = '#' + a + '#';
total.at(i + 1) = newa;
}
total.at(H + 1) = box;
for (int k = 0; k < total.size(); k++) {
cout << total.at(k) << endl;
}
}
total.at(H + 2) = box;
}
| a.cc:24:3: error: 'total' does not name a type
24 | total.at(H + 2) = box;
| ^~~~~
a.cc:25:1: error: expected declaration before '}' token
25 | }
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.