submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s936665588
p03943
Java
package ARC063; import java.util.*; public class A { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); if(a+b==c||b+c==a||c+a==b){ System.out.println("Yes"); }else{ System.out.println("No"); } sc.close(); } }
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s819594303
p03943
C++
#include <iostream> #include <string> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <complex> #include <utility> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <bitset> #include <ctime> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <cassert> #include <cstddef> #include <iomanip> #include <numeric> #include <tuple> #include <sstream> #include <fstream> using namespace std; #define REP(i, n) for (int (i) = 0; (i) < (n); (i)++) #define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++) #define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--) #define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--) #define DEBUG(C) cerr << #C << " = " << C << endl; using LL = long long; using VI = vector<int>; using VVI = vector<VI>; using VL = vector<LL>; using VVL = vector<VL>; using VD = vector<double>; using VVD = vector<VD>; using PII = pair<int, int>; using PDD = pair<double, double>; using PLL = pair<LL, LL>; using VPII = vector<PII>; #define ALL(a) begin((a)), end((a)) #define RALL(a) rbegin((a)), rend((a)) #define SORT(a) sort(ALL((a))) #define RSORT(a) sort(RALL((a))) #define REVERSE(a) reverse(ALL((a))) #define MP make_pair #define FORE(a, b) for (auto &&a : (b)) #define FIND(s, e) ((s).find(e) != (s).end()) #define EB emplace_back const int INF = 1e9; const int MOD = INF + 7; const LL LLINF = 1e18; int main(void) { int a, b, c; cin >> a >> b >> c; if (a == b || b == c || c == a) { f = true; } if (a + b == c || b + c == a || c + a == b) { f = true; } cout << (f ? "Yes" : "No") << endl; }
a.cc: In function 'int main()': a.cc:64:9: error: 'f' was not declared in this scope 64 | f = true; | ^ a.cc:67:9: error: 'f' was not declared in this scope 67 | f = true; | ^ a.cc:69:14: error: 'f' was not declared in this scope 69 | cout << (f ? "Yes" : "No") << endl; | ^
s645053465
p03943
C
#include <stdio.h> int main() { int n[3], max, other; int i; scanf("%d%d%d", n+0, n+1, n+2); other = n[0] + n[1] + [2]; max = n[0]; if ( max < n[1] ) max = n[1]; if ( max < n[2] ) max = n[2]; other -= max; if ( max = other ) printf("Yes"); else printf("No"); return 0; }
main.c: In function 'main': main.c:8:25: error: expected expression before '[' token 8 | other = n[0] + n[1] + [2]; | ^
s120575414
p03943
C++
#include <algorithm>//min/max/sort(rand-access it)/merge #include <array> #include <bitset> // #include <chrono>//std::chrono::/system_clock/steady_clock/high_resolution_clock/duration #include <climits>//INT_MAX/INT_MIN/ULLONG_MAX #include <cmath>//fmin/fmax/fabs/sin(h)/cos(h)/tan(h)/exp/log/pow/sqrt/cbrt/ceil/floor/round/trunc #include <cstdlib>//abs/atof/atoi/atol/atoll/strtod/strtof/..., srand/rand, calloc/malloc, exit, qsort // #include <fstream>//ifstream/ofstream #include <iomanip>//setfill/setw/setprecision/fixed/scientific #include <iostream>//cin/cout/wcin/wcout/left/right/internal/dec/hex/oct/fixed/scientific #include <iterator> #include <limits>//numeric_limits<type>::max/min/lowest/epsilon/infinity/quiet_NaN/signaling_NaN #include <list> #include <queue> #include <string>//stoi/stol/stoul/stoll/stoull/stof/stod/stold/to_string/getline #include <tuple> #include <utility>//pair #include <valarray> #include <vector> #define PRIME_SHORT 10007 #define PRIME 1000000007 using namespace std; typedef unsigned int ui; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<ll, int> plli; typedef pair<ull, int> puli; typedef pair<double, int> pdi; typedef pair<ll, ll> pllll; typedef pair<ull, ull> pulul; typedef pair<double, double> pdd; typedef tuple<int, int, int> ti3; typedef tuple<int, int, int, int> ti4; const bool debug = false; template<typename T> void rar(size_t n, T* a); template<typename T> void rar2(size_t n, size_t m, T** a); template<typename T> T ipow(T base, T exp); inline size_t left(size_t current, bool swap); inline size_t right(size_t current, bool swap); template<typename T> inline T griddist(T x, T y, T s, T t); template<typename T> inline T griddist(pair<T, T> one, pair<T, T> two); template<typename T> inline T griddist(tuple<T, T> one, tuple<T, T> two); template<typename T> inline T sqeucldist(T x, T y, T s, T t); template<typename T> inline T sqeucldist(pair<T, T> one, pair<T, T> two); template<typename T> inline T sqeucldist(tuple<T, T> one, tuple<T, T> two); inline ull modadd(ull a, ull b, int mod); inline ull modmult(ull a, ull b, int mod); int main(void) { int a, b, c; cin >> a >> b >> c; if (a == b + c || b == a + c || c == a + b || a == b && b == c){ cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; } template<typename T> void rar(size_t n, T* a) { for (size_t i = 0; i < n; ++i) cin >> a[i]; return; } template<typename T> void rar2(size_t n, int m, T** a) { for (int i = 0; i < n; ++i) { a[i] = new int[m]; for (int j = 0; j < m; ++j) cin >> a[i][j]; } return; } template<typename T> T ipow(T base, T exp) { T result = 1; while (exp) { if (exp & 1) result *= base; exp >>= 1; base *= base; } return result; } inline size_t left(size_t current, bool swap) { return swap ? right(current) : 2*current+1; } inline size_t right(size_t current, bool swap) { return swap ? left(current) : 2*(current+1); } template<typename T> inline T griddist(T x, T y, T s, T t) { return abs(x-s) + abs(y-t); } template<typename T> inline T griddist(pair<T, T> one, pair<T, T> two) { return abs(one.first - two.first) + abs(one.second - two.second); } template<typename T> inline T griddist(tuple<T, T> one, tuple<T, T> two) { return abs(get<0>(one) - get<0>(two)) + abs(get<1>(one) - get<1>(two)); } template<typename T> inline T sqeucldist(T x, T y, T s, T t) { T a = x-s; T b = y-t; return a*a+b*b; } template<typename T> inline T sqeucldist(pair<T, T> one, pair<T, T> two) { T a = one.first - two.first; T b = one.second - two.second; return a*a+b*b; } template<typename T> inline T sqeucldist(tuple<T, T> one, tuple<T, T> two) { T a = get<0>(one) - get<0>(two); T b = get<1>(one) - get<1>(two); return a*a+b*b; } inline ull modadd(ull a, ull b, int mod) { return ((a%mod) + (b%mod))%mod; } inline ull modmult(ull a, ull b, int mod) { return ((a%mod)*(b%mod))%mod; }
a.cc: In function 'size_t left(size_t, bool)': a.cc:99:24: error: no matching function for call to 'right(size_t&)' 99 | return swap ? right(current) : 2*current+1; | ~~~~~^~~~~~~~~ In file included from /usr/include/c++/14/iomanip:42, from a.cc:9: /usr/include/c++/14/bits/ios_base.h:1070:3: note: candidate: 'std::ios_base& std::right(ios_base&)' 1070 | right(ios_base& __base) | ^~~~~ /usr/include/c++/14/bits/ios_base.h:1070:19: note: no known conversion for argument 1 from 'size_t' {aka 'long unsigned int'} to 'std::ios_base&' 1070 | right(ios_base& __base) | ~~~~~~~~~~^~~~~~ a.cc:47:15: note: candidate: 'size_t right(size_t, bool)' 47 | inline size_t right(size_t current, bool swap); | ^~~~~ a.cc:47:15: note: candidate expects 2 arguments, 1 provided a.cc: In function 'size_t right(size_t, bool)': a.cc:102:23: error: no matching function for call to 'left(size_t&)' 102 | return swap ? left(current) : 2*(current+1); | ~~~~^~~~~~~~~ /usr/include/c++/14/bits/ios_base.h:1062:3: note: candidate: 'std::ios_base& std::left(ios_base&)' 1062 | left(ios_base& __base) | ^~~~ /usr/include/c++/14/bits/ios_base.h:1062:18: note: no known conversion for argument 1 from 'size_t' {aka 'long unsigned int'} to 'std::ios_base&' 1062 | left(ios_base& __base) | ~~~~~~~~~~^~~~~~ a.cc:98:15: note: candidate: 'size_t left(size_t, bool)' 98 | inline size_t left(size_t current, bool swap) { | ^~~~ a.cc:98:15: note: candidate expects 2 arguments, 1 provided
s057379186
p03943
C
#include <stdio.h> int main () { int W, H, N; scanf("%d %d %d", &W, &H, &N); int map[100][100] = {}; int i, j; for (i=0; i<H; i++) { for (j=0; j<W; j++) { map[i][j] = 1; } } int w, h, a; int x, y; for (i=0; i<N; i++) { scanf("%d %d %d", &w, &h, &a); switch (a) { case 1: for (y=0; y<H; y++) { for (x=0; x<w; x++) { map[y][x] = 0; } } break; case 2: for (y=0; y<H; y++) { for (x=W; x>=w; x--) { map[y][x] = 0; } } break; case 3: for (y=0; y<h; y++) { for (x=0; x<W; x++) { map[y][x] = 0; } } break; case 4: for (y=H; y>h; y--) { for (x=0; x=<W; x++) { map[y][x] = 0; } } break; } } int result = 0; for(y=0; y<H; y++) { for(x=0; x<W; x++) { if (map[x][y] == 1) result++; } } printf("%d\n", result); return 0; }
main.c: In function 'main': main.c:55:21: error: expected expression before '<' token 55 | for (x=0; x=<W; x++) { | ^
s310774593
p03943
C++
import Control.Applicative ((<$>)) distri :: Int -> Int -> int -> String distri a b c = if (a + b + c) `mod` 2 == 0 then "Yes" else "No" main :: IO() main = do [a, b, c] <- map read . words <$> getLine putStrLn . show $ distri a b c
a.cc:3:31: error: stray '`' in program 3 | distri a b c = if (a + b + c) `mod` 2 == 0 then "Yes" else "No" | ^ a.cc:3:35: error: stray '`' in program 3 | distri a b c = if (a + b + c) `mod` 2 == 0 then "Yes" else "No" | ^ a.cc:1:1: error: 'import' does not name a type 1 | import Control.Applicative ((<$>)) | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s101992201
p03943
C
#include<stdio.h> #include <string.h> #include <stdlib.h> int main() { int a; int b; int c; int sum1; int dai; // 個数のの入力 sum1 = 0; scanf("%d %d %d",&a,&b,&c); if(a > b) { if (a > c) { sum1 = b + c ; dai = a; } else { sum1 = a + b ; dai = c; } else { if (b > c) { sum1 = a + c ; dai = b; } else { sum1 = a + b ; dai = c; } } if (dai = sum1) { printf("YES"); } else { printf("NO"); } return 0; }
main.c: In function 'main': main.c:27:9: error: expected '}' before 'else' 27 | else { | ^~~~
s553279536
p03943
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication20 { class Program { static void Main(string[] args) { var a = Console.ReadLine().Split().Select(int.Parse).ToArray(); if (a[0] + a[1] == a[2] || a[0] + a[2] == a[1] || a[1] + a[2] == a[0]) Console.WriteLine("Yes"); else Console.WriteLine("No"); } } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:11:26: error: 'string' has not been declared 11 | static void Main(string[] args) | ^~~~~~ a.cc:11:35: error: expected ',' or '...' before 'args' 11 | static void Main(string[] args) | ^~~~ a.cc:18:6: error: expected ';' after class definition 18 | } | ^ | ; a.cc: In static member function 'static void ConsoleApplication20::Program::Main(int*)': a.cc:13:13: error: 'var' was not declared in this scope 13 | var a = Console.ReadLine().Split().Select(int.Parse).ToArray(); | ^~~ a.cc:14:17: error: 'a' was not declared in this scope 14 | if (a[0] + a[1] == a[2] || a[0] + a[2] == a[1] || a[1] + a[2] == a[0]) | ^ a.cc:15:17: error: 'Console' was not declared in this scope 15 | Console.WriteLine("Yes"); | ^~~~~~~ a.cc:16:18: error: 'Console' was not declared in this scope 16 | else Console.WriteLine("No"); | ^~~~~~~
s256691758
p03943
C
#include<stdio.h> #include <string.h> #include <stdlib.h> int main() { int a; int b; int c; int sum1; int dai; // 個数のの入力 sum1 = 0; scanf("%d %d %d",&a,&b,&c); if(a > b) { if (a > c) { sum b + c ; dai = a; } else { sum a + b ; dai = c; } else { if (b > c) { sum a + c ; dai = b; } else { sum a + b ; dai = c; } } if (dai = sum1) { printf("YES"); } else { printf("NO"); } return 0; }
main.c: In function 'main': main.c:20:13: error: unknown type name 'sum' 20 | sum b + c ; | ^~~ main.c:20:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+' token 20 | sum b + c ; | ^ main.c:24:13: error: unknown type name 'sum' 24 | sum a + b ; | ^~~ main.c:24:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+' token 24 | sum a + b ; | ^ main.c:27:9: error: expected '}' before 'else' 27 | else { | ^~~~ main.c:29:13: error: unknown type name 'sum' 29 | sum a + c ; | ^~~ main.c:29:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+' token 29 | sum a + c ; | ^ main.c:33:13: error: unknown type name 'sum' 33 | sum a + b ; | ^~~ main.c:33:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+' token 33 | sum a + b ; | ^
s802477977
p03943
C
#include <stdio.h> int main (void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if (a+b == c || b+c == a || c+a == b){ printf("Yes"); else printf("No"); }
main.c: In function 'main': main.c:9:4: error: expected '}' before 'else' 9 | else | ^~~~
s627630906
p03943
C
#include <stdio.h> #include <stdlib.h> int main (int argc, char* argv[]) { if (argc != 4) return 1; int buf1, buf2, buf3; buf1 = atoi(argv[1]) + atoi(argv[2]); buf2 = atoi(argv[2]) + atoi(argv[3]); buf3 = atoi(argv[1]) + atoi(argv[3]); if (buf1 == atoi(argv[3]) | buf2 == atoi(argv[1]) | buf3 == atoi(argv[2])) { printf("Yes\n"); } else printf ("No\n"); return 0; } #include <stdio.h> #include <stdlib.h> int main (int argc, char* argv[]) { if (argc != 4) return 1; int buf1, buf2, buf3; buf1 = atoi(argv[1]) + atoi(argv[2]); buf2 = atoi(argv[2]) + atoi(argv[3]); buf3 = atoi(argv[1]) + atoi(argv[3]); if (buf1 == atoi(argv[3]) | buf2 == atoi(argv[1]) | buf3 == atoi(argv[2])) { printf("Yes\n"); } else printf ("No\n"); return 0; }
main.c:25:5: error: redefinition of 'main' 25 | int main (int argc, char* argv[]) { | ^~~~ main.c:4:5: note: previous definition of 'main' with type 'int(int, char **)' 4 | int main (int argc, char* argv[]) { | ^~~~
s781177051
p03943
C
#include <stdio.h> int main (void){ int a,b,c; scanf("%d %d %d,&a,&b,&c); if (a+b == c || b+c == a || c+a == b){ printf("Yes"); else printf("No"); }
main.c: In function 'main': main.c:5:11: warning: missing terminating " character 5 | scanf("%d %d %d,&a,&b,&c); | ^ main.c:5:11: error: missing terminating " character 5 | scanf("%d %d %d,&a,&b,&c); | ^~~~~~~~~~~~~~~~~~~~ main.c:6:5: error: expected expression before 'if' 6 | if (a+b == c || b+c == a || c+a == b){ | ^~ main.c:10:1: error: expected declaration or statement at end of input 10 | } | ^
s316941325
p03943
C
#include <stdio.h> int main (void){ int a,b,c; scanf("%d%d%d,&a,&b,&c) if (a+b == c || b+c == a || c+a == b){ printf("Yes"); else printf("No"); }
main.c: In function 'main': main.c:5:7: warning: missing terminating " character 5 | scanf("%d%d%d,&a,&b,&c) | ^ main.c:5:7: error: missing terminating " character 5 | scanf("%d%d%d,&a,&b,&c) | ^~~~~~~~~~~~~~~~~ main.c:6:1: error: expected expression before 'if' 6 | if (a+b == c || b+c == a || c+a == b){ | ^~ main.c:10:1: error: expected declaration or statement at end of input 10 | } | ^
s436930453
p03943
C++
#include <iostream> #include <algorithm>   int main() { int a, b, c; std::cin >> a >> b >> c; int m = std::max({a, b, c}); std::cout << (m == a + b + c - m ? "Yes" : "No") << std::endl; }
a.cc:3:1: error: extended character   is not valid in an identifier 3 |   | ^ a.cc:3:1: error: '\U000000a0' does not name a type 3 |   | ^
s450861137
p03943
C
#include <stdio.h> int main (void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if((a + b ==c)||(b+c==a)||(c+a==b){ printf("yes\n");} else{ printf("No\n");} return 0; }
main.c: In function 'main': main.c:6:37: error: expected ')' before '{' token 6 | if((a + b ==c)||(b+c==a)||(c+a==b){ | ~ ^ | ) main.c:12:1: error: expected expression before '}' token 12 | } | ^
s503946378
p03943
C++
int a, b, c; cin >> a >> b >> c; if(a+b==c || b+c==a || c+a==b){ cout << "YES"; }else{ cout << "NO"; }
a.cc:2:5: error: 'cin' does not name a type 2 | cin >> a >> b >> c; | ^~~ a.cc:3:5: error: expected unqualified-id before 'if' 3 | if(a+b==c || b+c==a || c+a==b){ | ^~ a.cc:5:6: error: expected unqualified-id before 'else' 5 | }else{ | ^~~~
s562464300
p03943
C
#include<stdio.h> int main (void){ int a,b,c,d,e; scanf("%d%d%d¥n",&a,&b,&c); d = a/2 + b/2 + c/2 ; e = [ a/2 +b/2 +c/2]; if (d == e){ printf("Yes"); elif{ printf("No"); } return0; }
main.c: In function 'main': main.c:7:5: error: expected expression before '[' token 7 | e = [ a/2 +b/2 +c/2]; | ^ main.c:10:1: error: 'elif' undeclared (first use in this function) 10 | elif{ | ^~~~ main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in main.c:10:5: error: expected ';' before '{' token 10 | elif{ | ^ | ; main.c:14:1: error: expected declaration or statement at end of input 14 | } | ^
s378070213
p03943
Java
import java.util.Scanner; public class MissionA { public static void main(String[] args) { //変数// int a; //パックAの個数 int b; //パックBの個数 int c; //パックCの個数 boolean ans = false; //分けれるかどうか Scanner scan = new Scanner(System.in); //入力// a = scan.nextInt(); b = scan.nextInt(); c = scan.nextInt(); scan.close(); //処理// if( a == b + c ){ ans = true; }else if( b == a + c ){ ans = true; }else if( c == a + b ){ ans = true; } //結果// if(ans){ System.out.println( "Yes" ); }else{ System.out.println( "No" ); } } }
Main.java:3: error: class MissionA is public, should be declared in a file named MissionA.java public class MissionA { ^ 1 error
s206764359
p03943
Java
public class Main { public static void main(String args[]) { Scanner s = new Scanner(System.in); String arr[] = s.nextLine().split(" "); ArrayList<Integer> arrr = new ArrayList<Integer>(); for(String str : arr){ arrr.add(Integer.parseInt(str)); } int a = Integer.parseInt(arr[0]); int b = Integer.parseInt(arr[1]); int c = Integer.parseInt(arr[2]); if((a+b) == c){ System.out.println("Yes"); } else{ System.out.println("No"); } System.out.println(""); } }
Main.java:3: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner s = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol ArrayList<Integer> arrr = new ArrayList<Integer>(); ^ symbol: class ArrayList location: class Main Main.java:5: error: cannot find symbol ArrayList<Integer> arrr = new ArrayList<Integer>(); ^ symbol: class ArrayList location: class Main 4 errors
s788908958
p03943
C
#include<stdio.h> int main (void){ int a,b,c,d,e; scanf("%d%d%d",&a,&b,&c) d =a/2 + b/2 + c/2 ; e =[ a/2 +b/2 +c/2] ; if (d == e){ printf("Yes"); elif{ printf("No"); } }
main.c: In function 'main': main.c:5:25: error: expected ';' before 'd' 5 | scanf("%d%d%d",&a,&b,&c) | ^ | ; 6 | d =a/2 + b/2 + c/2 ; | ~ main.c:7:4: error: expected expression before '[' token 7 | e =[ a/2 +b/2 +c/2] ; | ^ main.c:10:1: error: 'elif' undeclared (first use in this function) 10 | elif{ | ^~~~ main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in main.c:10:5: error: expected ';' before '{' token 10 | elif{ | ^ | ; main.c:13:1: error: expected declaration or statement at end of input 13 | } | ^
s111862222
p03943
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int a = sc.nextInt(); // スペース区切りの整数の入力 int b = sc.nextInt(); int c = sc.nextInt(); // 文字列の入力 int max = a; if(max < b){ max = b; } if(max < c){ max = c; } // 出力 int total = a + b + c; if(max = total - max){ System.out.println("Yes"); }else{ System.out.println("No"); } } }
Main.java:22: error: incompatible types: int cannot be converted to boolean if(max = total - max){ ^ 1 error
s427802720
p03943
C
#include<stdio.h> int main (void){ int a,b,c,d,e; scanf("%d%d%d",&a,&b,&c); d =a/2 + b/2 + c/2 ; e =[ a/2 +b/2 +c/2]; if (d == e){ printf("Yes"); else{ printf("No"); } return0; }
main.c: In function 'main': main.c:7:4: error: expected expression before '[' token 7 | e =[ a/2 +b/2 +c/2]; | ^ main.c:10:1: error: expected '}' before 'else' 10 | else{ | ^~~~ main.c:13:1: error: 'return0' undeclared (first use in this function) 13 | return0; | ^~~~~~~ main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in
s585367815
p03943
C
#include <stdio.h> #indlude <math.h> int main (void){ int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a/2==0 && b/2==0 & c/2==0){ printf("yes\n");} else{ printf("No\n");} return 0; }
main.c:2:2: error: invalid preprocessing directive #indlude; did you mean #include? 2 | #indlude <math.h> | ^~~~~~~ | include
s384166547
p03943
C
#include<stdio.h> int main (void){ int a,b,c,d,e; scanf("%d%d%d",&a,&b,&c) d =a/2 + b/2 + c/2 e =[ a/2 +b/2 +c/2] if (d == e){ printf("Yes") else{ printf("No") } return0; }
main.c: In function 'main': main.c:5:25: error: expected ';' before 'd' 5 | scanf("%d%d%d",&a,&b,&c) | ^ | ; 6 | d =a/2 + b/2 + c/2 | ~ main.c:14:1: error: expected declaration or statement at end of input 14 | } | ^
s241087832
p03943
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 整数の入力 int a = sc.nextInt(); // スペース区切りの整数の入力 int b = sc.nextInt(); int c = sc.nextInt(); // 文字列の入力 int max = a; if(max < b){ max = b; } if(max < c){ max = c } // 出力 int total = a + b + c; if(max = total - max){ System.out.println("Yes"); }else{ System.out.println("No"); } } }
Main.java:17: error: ';' expected max = c ^ 1 error
s615342284
p03943
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Magatro { static int a, b, c; static void Main() { Read(); if (c == a + b) { Console.WriteLine("Yes"); } else { Console.WriteLine("No"); } } static void Read() { int[] q = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); Array.Sort(q); a = q[0]; b = q[1]; c = q[2]; } }
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.Linq; | ^~~~~~ a.cc:4:7: error: expected nested-name-specifier before 'System' 4 | using System.Text; | ^~~~~~ a.cc:5:7: error: expected nested-name-specifier before 'System' 5 | using System.Threading.Tasks; | ^~~~~~ a.cc:30:2: error: expected ';' after class definition 30 | } | ^ | ; a.cc: In static member function 'static void Magatro::Main()': a.cc:15:13: error: 'Console' was not declared in this scope 15 | Console.WriteLine("Yes"); | ^~~~~~~ a.cc:19:13: error: 'Console' was not declared in this scope 19 | Console.WriteLine("No"); | ^~~~~~~ a.cc: In static member function 'static void Magatro::Read()': a.cc:24:12: error: structured binding declaration cannot have type 'int' 24 | int[] q = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); | ^~ a.cc:24:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto' a.cc:24:12: error: empty structured binding declaration a.cc:24:15: error: expected initializer before 'q' 24 | int[] q = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); | ^ a.cc:25:9: error: 'Array' was not declared in this scope 25 | Array.Sort(q); | ^~~~~ a.cc:25:20: error: 'q' was not declared in this scope 25 | Array.Sort(q); | ^
s696545859
p03943
C++
#include <iostream> #include <algorithm> using namespace std; int a, b, c, Max int main() { cin >> a >> b >> c; Max = max(a, max(b, c)); if(a + b + c - Max == Max) { cout << "YES\n"; } else { cout << "NO\n"; } return 0; }
a.cc:8:1: error: expected initializer before 'int' 8 | int main() { | ^~~
s208189088
p03944
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x,y,n; cin >> x >> y >> n; vector<vector<int>> data(n,vector<int>(3)) for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ cin >> data[i][j]; } } set<int> a,b,c,d; for(int i=0;i<n;i++){ if(data[i][2]==1) a.insert(data[i][0]); if(data[i][2]==2) b.insert(data[i][0]); if(data[i][2]==3) c.insert(data[i][1]); if(data[i][2]==4) d.insert(data[i][1]); } int minx=*rbegin(a); int maxx=*begin(b); int miny=*rbegin(c); int maxy=*begin(d); int S; if(minx>=maxx) S=0; if(minx<maxx){ if(miny>=maxy) S=0; if(miny<maxy) S=(maxx-minx)*(maxy-miny); } cout << S << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for(int i=0;i<n;i++){ | ^~~ a.cc:8:15: error: 'i' was not declared in this scope 8 | for(int i=0;i<n;i++){ | ^
s449253920
p03944
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x,y,n; cin >> x >> y >> n; vector<vector<int>> data(n,vector<int>(3)) for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ cin >> data[i][j]; } } set<int> a,b,c,d; for(int i=0;i<n;i++){ if(data[i][2]==1) a.insert(data[i][0]); if(data[i][2]==2) b.insert(data[i][0]); if(data[i][2]==3) c.insert(data[i][1]); if(data[i][2]==4) d.insert(data[i][1]); } int minx=*rbegin(a); int maxx=*begin(b); int miny=*rbegin(c); int maxy=*begin(d); int S; if(minx>=maxx) S=0; if(minx<maxx){ if(miny>=maxy) S=0; if(miny<maxy) S=x*y-(maxx-minx)*(maxy-miny); } cout << S << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for(int i=0;i<n;i++){ | ^~~ a.cc:8:15: error: 'i' was not declared in this scope 8 | for(int i=0;i<n;i++){ | ^
s006631257
p03944
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x,y,n; cin >> x >> y >> n; vector<vector<int>> data(n,vector<int>(3)) for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ cin >> data[i][j]; } } set<int> a,b,c,d; for(int i=0;i<n;i++){ if(data[i][2]==1) a.insert(data[i][0]); if(data[i][2]==2) b.insert(data[i][0]); if(data[i][2]==3) c.insert(data[i][1]); if(data[i][2]==4) d.insert(data[i][1]); } int minx=*rbegin(a); int maxx=*begin(b); int miny=*rbegin(c); int maxy=*begin(d); int S; if(minx>=maxx) S=0; if(miny>=maxy) S=0; else S=x*y-(maxx-minx)*(maxy-miny); cout << S << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for(int i=0;i<n;i++){ | ^~~ a.cc:8:15: error: 'i' was not declared in this scope 8 | for(int i=0;i<n;i++){ | ^
s022620391
p03944
C++
#include <bits/stdc++.h> using namespace std; int main(){ int x,y,n; cin >> x >> y >> n; vector<vector<int>> data(n,vector<int>(3)) for(int i=0;i<n;i++){ for(int j=0;j<3;j++){ cin >> data[i][j]; } } set<int> a,b,c,d; for(int i=0;i<n;i++){ if(data[i][2]==1) a.insert(data[i][0]); if(data[i][2]==2) b.insert(data[i][0]); if(data[i][2]==3) c.insert(data[i][1]); if(data[i][2]==4) d.insert(data[i][1]); } int minx=*rbegin(a); int maxx=*begin(b); int miny=*rbegin(c); int maxy=*begin(d); int S; if(minx>=maxx) S=0; if(miny>=maxy) S=0; else S=x*y-(maxx-minx)*(maxy-miny) cout << S << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: expected ',' or ';' before 'for' 8 | for(int i=0;i<n;i++){ | ^~~ a.cc:8:15: error: 'i' was not declared in this scope 8 | for(int i=0;i<n;i++){ | ^ a.cc:27:37: error: expected ';' before 'cout' 27 | else S=x*y-(maxx-minx)*(maxy-miny) | ^ | ; 28 | cout << S << endl; | ~~~~
s083557611
p03944
C++
#include <bits/stdc++.h> using namespace std; #include<cstdlib> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) typedef long long ll; int main(){ int w,h,n; cin >> w >> h >> n; vector<vector<int>> black(4,vector<int>(0)); rep(i,n){ int x,y,a; cin >> x >> y >> a; a--; if(a==0||a==1) black.at(a).push_back(x); else black.at(a).push_back(y); } black.at(0).push_back(0); black.at(1).push_back(w); black.at(2).push_back(0); black.at(3).push_back(h); sort(black.at(0).rbegin(), black.at(0).rend()); sort(black.at(1).begin(), black.at(1).end()); sort(black.at(2).rbegin(), black.at(2).rend()); sort(black.at(3).begin(), black.at(3).end()); int max_x=black.at(0).at(0); int min_x=black.at(1).at(0); int max_y=black.at(2).at(0); int min_y=black.at(3).at(0); int whitex=max(0,min_x-max_x); int whitey=max(0,m_y-max_y); //cout << max_x << " " << min_x << " " << max_y << " " << min_y << endl; cout << whitex*whitey; }
a.cc: In function 'int main()': a.cc:38:20: error: 'm_y' was not declared in this scope; did you mean 'min_y'? 38 | int whitey=max(0,m_y-max_y); | ^~~ | min_y
s893774788
p03944
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) using namespace std; using ll = long long; const int INF = 1001001001; const ll INF_LL = 1001001001001001001LL; int main(void){ int w,h,n; cin >> w >> h >> n; vector<int> x(n),y(n),a(n); rep(i,n) cin >> x[i] >> y[i] >> a[i]; vector<vector<bool>> white(h,vector<bool>(w,true)); rep(i,n){ switch(a[i]){ case 1: rep(j,w){ if(j<x[i]) rep(k,h) white[k][j] = false; } break; case 2: rep(j,w){ if(j>x[i]) rep(k,h) white[k][j] = false; } break; case 3: rep(j,h){ if(j<y[i]) rep(k,w) white[j][k] = false; } break; case 4: rep(j,h){ if(j>y[i]) rep(k,w) white[j][k] = false; } } int ans; int wht = -1; rep(i,h+1){ int tmp = 0; rep(j,w+1){ if(white[i][j]){ tmp++; } } wht = max(wht,tmp); } wht--; ans = wht>=0 ? wht*wht:0; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:59:2: error: expected '}' at end of input 59 | } | ^ a.cc:10:15: note: to match this '{' 10 | int main(void){ | ^
s358136052
p03944
C++
#ifdef LOCAL //#define _GLIBCXX_DEBUG #endif //#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> Pi; typedef vector<ll> Vec; typedef vector<int> Vi; typedef vector<string> Vs; typedef vector<char> Vc; typedef vector<P> VP; typedef vector<vector<ll>> VV; typedef vector<vector<int>> VVi; typedef vector<vector<char>> VVc; typedef vector<vector<vector<ll>>> VVV; typedef vector<vector<vector<vector<ll>>>> VVVV; #define REP(i, a, b) for(ll i=(a); i<(b); i++) #define PER(i, a, b) for(ll i=(a); i>=(b); i--) #define rep(i, n) REP(i, 0, n) #define per(i, n) PER(i, n, 0) const ll INF=1e18+18; const ll MOD=1000000007; #define Yes(n) cout << ((n) ? "Yes" : "No") << endl; #define YES(n) cout << ((n) ? "YES" : "NO") << endl; #define ALL(v) v.begin(), v.end() #define rALL(v) v.rbegin(), v.rend() #define pb(x) push_back(x) #define mp(a, b) make_pair(a,b) #define Each(a,b) for(auto &a :b) #define rEach(i, mp) for (auto i = mp.rbegin(); i != mp.rend(); ++i) #ifdef LOCAL #define dbg(x_) cerr << #x_ << ":" << x_ << endl; #define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;} #define dbgset(st) cerr << #st << ":"<<endl; for (auto i = st.begin(); i != st.end(); ++i) { cerr << *i <<" ";}cerr<<endl; #define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;} #define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl; #else #define dbg(...) #define dbgmap(...) #define dbgset(...) #define dbgarr(...) #define dbgdp(...) #endif #define out(a) cout<<a<<endl #define out2(a,b) cout<<a<<" "<<b<<endl #define vout(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl #define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end()) #define fi first #define se second template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; } template<typename T1, typename T2> ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; } template<typename T>istream& operator>>(istream&i,vector<T>&v) {rep(j,v.size())i>>v[j];return i;} // vector template<typename T> ostream &operator<<(ostream &s, const vector<T> &v) { int len=v.size(); for(int i=0; i<len; ++i) { s<<v[i]; if(i<len-1) s<<" "; } return s; } // 2 dimentional vector template<typename T> ostream &operator<<(ostream &s, const vector<vector<T> > &vv) { int len=vv.size(); for(int i=0; i<len; ++i) { s<<vv[i]<<endl; } return s; } int solve(){ ll w,h,n; cin>>w>>h>>n; ll lw = 0; ll rw = w; ll lh = 0; ll rh = h; rep(i,n){ ll x,y,a; cin>>x>>y>>a; if(a==1){ chmax(lw,x); } if(a==2){ chmin(rw,x); } if(a==3){ chmax(lh,y); } if(a==4){ chmin(rh,y); } } if(rw-lw<=0 || rh-lh<=0){ out(0); return ; } ll ans = max(0LL,(rw-lw) * (rh-lh)); out(ans); return 0; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout<<std::setprecision(10); // ll T; // cin>>T; // while(T--) solve(); }
a.cc: In function 'int solve()': a.cc:114:9: error: return-statement with no value, in function returning 'int' [-fpermissive] 114 | return ; | ^~~~~~
s971459685
p03944
C++
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); ++i) using namespace std; using ll = long long; using P = pair<int,int>; const ll MOD = 1e9+7; int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); int w, h, n; cin >> w >> h >> n; vector<pair<int, int>> xy(n); int left_x = 0; int right_x = w; int down_y = 0; int up_y = h; rep(i, n) { int x, y, a; cin >> x >> y >> a; xy[i].first = x; xy[i].second = y; if(a == 1) left_x = max(left_x, x); if(a == 2) right_x = min(right_x, x); if(a == 3) down_y = max(down_y, y); if(a == 4) up_y = min(up_y, y); } int ans = 0; ans = (right_x-left_x)*(up_y-down_y); if(ans < 0) ans = 0; if(ans > w*h) ans = w*h cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:37:26: error: expected ';' before 'cout' 37 | if(ans > w*h) ans = w*h | ^ | ; 38 | 39 | cout << ans << endl; | ~~~~
s495011549
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w , n; cin >> w >> h >> n; vector < tuple <double,double,double >> A(n); for (int i=0 ; i<n ; i++){ double a,b,c; cin >> a >> b >> c; A.at(i) = make_tuple(a,b,c) ; } int ld_x =0, ld_y = 0 , ru_x = w , ru_y = h; for ( int i=0 ; i<n; i++){ double a,b,c; tie(a,b,c) = A.at(i) ; if ( c==1){ ld_x = max(ld_x , a) ; }else if ( c==2){ ru_x = min(ru_x , a) ; }else if ( c==3){ ld_y = max(ld_y , b) ; }else if ( c==4){ ru_y = min(ru_y , b) ; } } double c = (ru_x - ld_x)*(ru_y - ld_y) ; cout << (c<=0 ? 0 : c) << endl; }
a.cc: In function 'int main()': a.cc:18:17: error: no matching function for call to 'max(int&, double&)' 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:18:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:18:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ a.cc:20:17: error: no matching function for call to 'min(int&, double&)' 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:20:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:20:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ a.cc:22:17: error: no matching function for call to 'max(int&, double&)' 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:22:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ a.cc:24:17: error: no matching function for call to 'min(int&, double&)' 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:24:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:24:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~
s030137000
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w , n; cin >> w >> h >> n; vector < tuple double,double,double >> A(n); for (int i=0 ; i<n ; i++){ double a,b,c; cin >> a >> b >> c; A.at(i) = make_tuple(a,b,c) ; } int ld_x =0, ld_y = 0 , ru_x = w , ru_y = h; for ( int i=0 ; i<n; i++){ double a,b,c; tie(a,b,c) = A.at(i) ; if ( c==1){ ld_x = max(ld_x , a) ; }else if ( c==2){ ru_x = min(ru_x , a) ; }else if ( c==3){ ld_y = max(ld_y , b) ; }else if ( c==4){ ru_y = min(ru_y , b) ; } } double c = (ru_x - ld_x)*(ru_y - ld_y) ; cout << (c<=0 ? 0 : c) << endl; }
a.cc: In function 'int main()': a.cc:7:39: error: template argument 1 is invalid 7 | vector < tuple double,double,double >> A(n); | ^~ a.cc:7:39: error: template argument 2 is invalid a.cc:11:7: error: request for member 'at' in 'A', which is of non-class type 'int' 11 | A.at(i) = make_tuple(a,b,c) ; | ^~ a.cc:16:20: error: request for member 'at' in 'A', which is of non-class type 'int' 16 | tie(a,b,c) = A.at(i) ; | ^~ a.cc:18:17: error: no matching function for call to 'max(int&, double&)' 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:18:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:18:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ a.cc:20:17: error: no matching function for call to 'min(int&, double&)' 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:20:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:20:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ a.cc:22:17: error: no matching function for call to 'max(int&, double&)' 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:22:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ a.cc:24:17: error: no matching function for call to 'min(int&, double&)' 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:24:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:24:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~
s841302712
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w , n; cin >> w >> h >> n; vector < tuple double,double,int>> A(n); for (int i=0 ; i<n ; i++){ double a,b,c; cin >> a >> b >> c; A.at(i) = make_tuple(a,b,c) ; } int ld_x =0, ld_y = 0 , ru_x = w , ru_y = h; for ( int i=0 ; i<n; i++){ double a,b,c; tie(a,b,c) = A.at(i) ; if ( c==1){ ld_x = max(ld_x , a) ; }else if ( c==2){ ru_x = min(ru_x , a) ; }else if ( c==3){ ld_y = max(ld_y , b) ; }else if ( c==4){ ru_y = min(ru_y , b) ; } } double c = (ru_x - ld_x)*(ru_y - ld_y) ; cout << (c<=0 ? 0 : c) << endl; }
a.cc: In function 'int main()': a.cc:7:35: error: template argument 1 is invalid 7 | vector < tuple double,double,int>> A(n); | ^~ a.cc:7:35: error: template argument 2 is invalid a.cc:11:7: error: request for member 'at' in 'A', which is of non-class type 'int' 11 | A.at(i) = make_tuple(a,b,c) ; | ^~ a.cc:16:20: error: request for member 'at' in 'A', which is of non-class type 'int' 16 | tie(a,b,c) = A.at(i) ; | ^~ a.cc:18:17: error: no matching function for call to 'max(int&, double&)' 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:18:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:18:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 18 | ld_x = max(ld_x , a) ; | ~~~^~~~~~~~~~ a.cc:20:17: error: no matching function for call to 'min(int&, double&)' 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:20:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:20:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 20 | ru_x = min(ru_x , a) ; | ~~~^~~~~~~~~~ a.cc:22:17: error: no matching function for call to 'max(int&, double&)' 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:22:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 22 | ld_y = max(ld_y , b) ; | ~~~^~~~~~~~~~ a.cc:24:17: error: no matching function for call to 'min(int&, double&)' 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:24:17: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'double') 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:24:17: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 24 | ru_y = min(ru_y , b) ; | ~~~^~~~~~~~~~
s157718061
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w , n; cin >> h >> w >> n; vector < tuple <int,int,int>> a(n); for (int i=0 ; i<n ; i++){ int a,b,c; cin >> a >> b >> c; a.at(i) = make_tuple(a,b,c) ; } int ld_x =0, ld_y = h , ru_x = w , ru_y = h; for ( int i=0 ; i<n; i++){ int a,b,c; tie(a,b,c) = a.at(i) ; if ( c==1){ ld_x = max(ld_x , a) ; }else if ( c==2){ ru_x = min(ru_x , a) ; }else if ( c==3){ ld_y = max(ld_y , b) ; }else if ( c==1){ ru_y = min(ru_y , b) ; } } cout << (ru_x - ld_x)*(ru_y - ld_y) << endl; }
a.cc: In function 'int main()': a.cc:11:7: error: request for member 'at' in 'a', which is of non-class type 'int' 11 | a.at(i) = make_tuple(a,b,c) ; | ^~ a.cc:16:20: error: request for member 'at' in 'a', which is of non-class type 'int' 16 | tie(a,b,c) = a.at(i) ; | ^~
s103361670
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w , n; cin >> h >> w >> n; vector < tuple <int,int,int>> a(n); for (int i=0 ; i<n ; i++){ int a,b,c; cin >> a >> b >> c; a.at(i) = make_tuple(a,b,c) ; } int ld_x =0, ld_y = h , ru_x = w , ru_y = h; for ( int i=0 ; i<n; i++){ int a,b,c; tie(a,b,c) = a.at(i) if ( c==1){ ld_x = max(ld_x , a) }else if ( c==2){ ru_x = min(ru_x , a) }else if ( c==3){ ld_y = max(ld_y , b) }else if ( c==1){ ru_y = min(ru_y , b) } } cout << (ru_x - ld_x)*(ru_y - ld_y) << endl; }
a.cc: In function 'int main()': a.cc:11:7: error: request for member 'at' in 'a', which is of non-class type 'int' 11 | a.at(i) = make_tuple(a,b,c) ; | ^~ a.cc:16:20: error: request for member 'at' in 'a', which is of non-class type 'int' 16 | tie(a,b,c) = a.at(i) | ^~ a.cc:19:6: error: 'else' without a previous 'if' 19 | }else if ( c==2){ | ^~~~ a.cc:20:27: error: expected ';' before '}' token 20 | ru_x = min(ru_x , a) | ^ | ; 21 | }else if ( c==3){ | ~ a.cc:22:27: error: expected ';' before '}' token 22 | ld_y = max(ld_y , b) | ^ | ; 23 | }else if ( c==1){ | ~ a.cc:24:27: error: expected ';' before '}' token 24 | ru_y = min(ru_y , b) | ^ | ; 25 | } | ~
s550830118
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w , n; cin >> h >> w >> n; vector < tuple <int,int,int>> a(n); for (int i=0 ; i<n ; i++){ int a,b,c; cin >> a >> b >> c; a.at(i) = make_tuple(a,b,c) ; } int ld_x =0, ld_y = h , ru_x = w , ru_y = h; for ( int i=0 ; i<n; i++){ if ( a[i][2]==1){ ld_x = max(ld_x , a[i][0]) }else if ( a[i][2]==2){ ru_x = min(ru_x , a[i][0]) }else if ( a[i][2]==3){ ld_y = max(ld_y , a[i][1]) }else if ( a[i][2]==1){ ru_y = min(ru_y , a[i][1]) } } cout << (ru_x - ld_x)*(ru_y - ld_y) << endl; }
a.cc: In function 'int main()': a.cc:11:7: error: request for member 'at' in 'a', which is of non-class type 'int' 11 | a.at(i) = make_tuple(a,b,c) ; | ^~ a.cc:15:14: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 15 | if ( a[i][2]==1){ | ^ a.cc:16:29: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 16 | ld_x = max(ld_x , a[i][0]) | ^ a.cc:17:20: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 17 | }else if ( a[i][2]==2){ | ^ a.cc:18:29: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 18 | ru_x = min(ru_x , a[i][0]) | ^ a.cc:19:20: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 19 | }else if ( a[i][2]==3){ | ^ a.cc:20:29: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 20 | ld_y = max(ld_y , a[i][1]) | ^ a.cc:21:20: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 21 | }else if ( a[i][2]==1){ | ^ a.cc:22:29: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int> >, std::tuple<int, int, int> >::value_type' {aka 'std::tuple<int, int, int>'} and 'int') 22 | ru_y = min(ru_y , a[i][1]) | ^
s528441262
p03944
C++
10 10 5 1 6 1 4 1 3 6 9 4 9 4 2 3 1 3a#include <bits/stdc++.h> using namespace std; int main() { int w, h, n; cin >> w >> h >> n; vector<vector<int>> a(n, vector<int>(3)); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { cin >> a.at(i).at(j); } } //残っている白い領域の左下の座標をbに 右上の座標をcに代入 vector<int> b = {0,0}, c = {w,h}; for (vector<int> d : a) { if (d.at(2) == 1) { if (d.at(0) > b.at(0)) b.at(0) = d.at(0); } if (d.at(2) == 2) { if (d.at(0) < c.at(0)) c.at(0) = d.at(0); } if (d.at(2) == 3) { if (d.at(1) > b.at(1)) b.at(1) = d.at(1); } if (d.at(2) == 4) { if (d.at(1) < c.at(1)) c.at(1) = d.at(1); } } cout << (c.at(0)-b.at(0))*(c.at(1)-b.at(1)); }
a.cc:6:7: error: stray '#' in program 6 | 3 1 3a#include <bits/stdc++.h> | ^ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 10 10 5 | ^~ a.cc: In function 'int main()': a.cc:11:3: error: 'cin' was not declared in this scope 11 | cin >> w >> h >> n; | ^~~ a.cc:13:3: error: 'vector' was not declared in this scope 13 | vector<vector<int>> a(n, vector<int>(3)); | ^~~~~~ a.cc:13:17: error: expected primary-expression before 'int' 13 | vector<vector<int>> a(n, vector<int>(3)); | ^~~ a.cc:16:14: error: 'a' was not declared in this scope 16 | cin >> a.at(i).at(j); | ^ a.cc:21:10: error: expected primary-expression before 'int' 21 | vector<int> b = {0,0}, c = {w,h}; | ^~~ a.cc:21:24: error: expected primary-expression before ',' token 21 | vector<int> b = {0,0}, c = {w,h}; | ^ a.cc:21:26: error: 'c' was not declared in this scope 21 | vector<int> b = {0,0}, c = {w,h}; | ^ a.cc:22:15: error: expected primary-expression before 'int' 22 | for (vector<int> d : a) { | ^~~ a.cc:41:3: error: 'cout' was not declared in this scope 41 | cout << (c.at(0)-b.at(0))*(c.at(1)-b.at(1)); | ^~~~ a.cc:41:20: error: 'b' was not declared in this scope 41 | cout << (c.at(0)-b.at(0))*(c.at(1)-b.at(1)); | ^ a.cc:42:1: error: expected primary-expression before '}' token 42 | } | ^ a.cc:41:47: error: expected ')' before '}' token 41 | cout << (c.at(0)-b.at(0))*(c.at(1)-b.at(1)); | ^ | ) 42 | } | ~ a.cc:22:7: note: to match this '(' 22 | for (vector<int> d : a) { | ^ a.cc:42:1: error: expected primary-expression before '}' token 42 | } | ^
s109726039
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int w, h, n; cin >> w >> h >> n; vector<vector<int>> a(n, vector<int>(3)); for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { cin >> a.at(i).at(j); } } //残っている白い領域の左下の座標をbに 右上の座標をcに代入 vector<int> b = {0,0}, c = {w,h}; for (vector<int> d : a) { if (d.at(2) == 1) { if (d.at(0) > b.at(0)) b.at(0) = d.at(0); } if (d.at(2) == 2) { if (d.at(0) < c.at(0)) c.at(0) = d.at(0); } if (d.at(2) == 3) { if (d.at(1) > b.at(1)) b.at(1) = d.at(1); } if (d.at(2) == 4) { if (d.at(1) < c.at(1)) c.at(1) = d.at(1); } } cout << (c.at(0)-b.at(0))*(c.at(1)-b.at(1)) }
a.cc: In function 'int main()': a.cc:36:46: error: expected ';' before '}' token 36 | cout << (c.at(0)-b.at(0))*(c.at(1)-b.at(1)) | ^ | ; 37 | } | ~
s702541486
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W ,H , N; cin >> W >> H >> N; vector <tuple <int , int , int >> A(N); for ( int i=0 ; i<N ; i++){ int a,b,c; cin >> a >> b >> c; A.at(i)=make_tuple(c,a,b); } sort(A.begin() , A.end()); int x_max ,x_min , y_max , y_min; for ( int i=0 ; i< N ; i++){ int c,b, a; tie(c,a,b) = A.at(i) ; if ( c == 1){ x_min=mmax(x_min,a); continue ; } if ( c == 2){ x_max=min(x_max,a); continue ; } if ( c == 3){ y_min =max(y_min,b); continue ; } if ( c == 4){ y_max =min(y_max,b); } } if (x_min<x_max && y_min < y_max){ cout << (x_max-x_min)*(y_max-y_min) <<endl; }else cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:19:13: error: 'mmax' was not declared in this scope; did you mean 'fmax'? 19 | x_min=mmax(x_min,a); | ^~~~ | fmax
s171064087
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W ,H , N; cin >> W >> H >> N; vector <tuple <int , int , int >> A(N); for ( int i=0 ; i<N ; i++){ int a,b,c; cin >> a >> b >> c; A.at(i)=make_tuple(c,a,b); } sort(A.begin() , A.end()); int x_max ,x_min , y_max , y_min; for ( int i=0 ; i< N ; i++){ int c,b, a; tie(c,a,b) = A.at(i) if ( c == 1){ x_max=max(x_max,a); continue ; } if ( c == 2){ x_min=min(x_min,a); continue ; } if ( c == 3){ y_max =max(y_max,b); continue ; } if ( c == 4){ y_min =min(y_min,b); } } if (x_min<x_max && y_min < y_max){ cout << (x_max-x_min)*(y_max-y_min) <<endl; }else cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:17:25: error: expected ';' before 'if' 17 | tie(c,a,b) = A.at(i) | ^ | ; 18 | if ( c == 1){ | ~~
s066351409
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W ,H , N; cin >> W >> H >> N; vector <tuple <int , int , int >> A(N); for ( int i=0 ; i<N ; i++){ int a,b,c; cin >> a >> b >> c; A.at(i)=make_tuple(c,a,b); } sort(A.begin() , A.end()); int x_max ,x_min , y_max , y_min; for ( int i=0 ; i< N ; i++){ if ( A(i).first == 1){ x_max=max(x_max,A(i).second); continue ; } if ( A(i).first == 2){ x_min=min(x_min,A(i).second); continue ; } if ( A(i).first == 3){ y_max =max(y_max,A(i).third); continue ; } if ( A(i).first == 4){ y_min =min(y_min,A(i).third); } } if (x_min<x_max && y_min < y_max){ cout << (x_max-x_min)*(y_max-y_min) <<endl; }else cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:16:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 16 | if ( A(i).first == 1){ | ~^~~ a.cc:17:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 17 | x_max=max(x_max,A(i).second); | ~^~~ a.cc:20:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 20 | if ( A(i).first == 2){ | ~^~~ a.cc:21:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 21 | x_min=min(x_min,A(i).second); | ~^~~ a.cc:24:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 24 | if ( A(i).first == 3){ | ~^~~ a.cc:25:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 25 | y_max =max(y_max,A(i).third); | ~^~~ a.cc:28:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 28 | if ( A(i).first == 4){ | ~^~~ a.cc:29:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 29 | y_min =min(y_min,A(i).third); | ~^~~
s063480549
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W ,H , N; cin >> W >> H >> N; vector <tuple <int , int , int >> A(N); for ( int i=0 ; i<N ; i++){ int a,b,c; cin >> a >> b >> c; A(i)=tuple(c,a,b); } sort(A.begin() , A.end()); int x_max ,x_min , y_max , y_min; for ( int i=0 ; i< N ; i++){ if ( A(i).first == 1){ x_max=max(x_max,A(i).second); continue ; } if ( A(i).first == 2){ x_min=min(x_min,A(i).second); continue ; } if ( A(i).first == 3){ y_max =max(y_max,A(i).third); continue ; } if ( A(i).first == 4){ y_min =min(y_min,A(i).third); } } if (x_min<x_max && y_min < y_max){ cout << (x_max-x_min)*(y_max-y_min) <<endl; }else cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:11:6: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 11 | A(i)=tuple(c,a,b); | ~^~~ a.cc:16:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 16 | if ( A(i).first == 1){ | ~^~~ a.cc:17:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 17 | x_max=max(x_max,A(i).second); | ~^~~ a.cc:20:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 20 | if ( A(i).first == 2){ | ~^~~ a.cc:21:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 21 | x_min=min(x_min,A(i).second); | ~^~~ a.cc:24:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 24 | if ( A(i).first == 3){ | ~^~~ a.cc:25:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 25 | y_max =max(y_max,A(i).third); | ~^~~ a.cc:28:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 28 | if ( A(i).first == 4){ | ~^~~ a.cc:29:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 29 | y_min =min(y_min,A(i).third); | ~^~~
s766229006
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W ,H , N; cin >> W >> H >> N; vector <tuple <int , int , int >> a(N); for ( int i=0 ; i<N ; i++){ int a,b,c; cin >> a >> b >> c; a(i)=tuple(c,a,b); } sort(a.begin() , a.end()); int x_max ,x_min , y_max , y_min; for ( int i=0 ; i< N ; i++){ if ( a(i).first == 1){ x_max=max(x_max,a(i).second); continue ; } if ( a(i).first == 2){ x_min=min(x_min,a(i).second); continue ; } if ( a(i).first == 3){ y_max =max(y_max,a(i).third); continue ; } if ( a(i).first == 4){ y_min =min(y_min,a(i).third); } } if (x_min<x_max && y_min < y_max){ cout << (x_max-x_min)*(y_max-y_min) <<endl; }else cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:11:6: error: 'a' cannot be used as a function 11 | a(i)=tuple(c,a,b); | ~^~~ a.cc:16:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 16 | if ( a(i).first == 1){ | ~^~~ a.cc:17:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 17 | x_max=max(x_max,a(i).second); | ~^~~ a.cc:20:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 20 | if ( a(i).first == 2){ | ~^~~ a.cc:21:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 21 | x_min=min(x_min,a(i).second); | ~^~~ a.cc:24:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 24 | if ( a(i).first == 3){ | ~^~~ a.cc:25:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 25 | y_max =max(y_max,a(i).third); | ~^~~ a.cc:28:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 28 | if ( a(i).first == 4){ | ~^~~ a.cc:29:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 29 | y_min =min(y_min,a(i).third); | ~^~~
s883530316
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W ,H , N; cin >> W >> H >> N; vector <tuple <int , int , int >> a; for ( int i=0 ; i<N ; i++){ int a,b,c; cin >> a >> b >> c; a.push_back(make_tuple(c,a,b)); } sort(a.begin() , a.end()); int x_max ,x_min , y_max , y_min; for ( int i=0 ; i< N ; i++){ if ( a(i).first == 1){ x_max=max(x_max,a(i).second); continue ; } if ( a(i).first == 2){ x_min=min(x_min,a(i).second); continue ; } if ( a(i).first == 3){ y_max =max(y_max,a(i).third); continue ; } if ( a(i).first == 4){ y_min =min(y_min,a(i).third); } } if (x_min<x_max && y_min < y_max){ cout << (x_max-x_min)*(y_max-y_min) <<endl; }else cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:11:7: error: request for member 'push_back' in 'a', which is of non-class type 'int' 11 | a.push_back(make_tuple(c,a,b)); | ^~~~~~~~~ a.cc:16:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 16 | if ( a(i).first == 1){ | ~^~~ a.cc:17:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 17 | x_max=max(x_max,a(i).second); | ~^~~ a.cc:20:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 20 | if ( a(i).first == 2){ | ~^~~ a.cc:21:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 21 | x_min=min(x_min,a(i).second); | ~^~~ a.cc:24:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 24 | if ( a(i).first == 3){ | ~^~~ a.cc:25:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 25 | y_max =max(y_max,a(i).third); | ~^~~ a.cc:28:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 28 | if ( a(i).first == 4){ | ~^~~ a.cc:29:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 29 | y_min =min(y_min,a(i).third); | ~^~~
s012466111
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W ,H , N; cin >> W >> H >> N; vector <tuple <int , int , int >> a(N); for ( int i=0 ; i<N ; i++){ int a,b,c; cin >> a >> b >> c; a.at(i) = make_tuple(c,a,b); } sort(a.begin() , a.end()); int x_max ,x_min , y_max , y_min; for ( int i=0 ; i< N ; i++){ if ( a(i).first == 1){ x_max=max(x_max,a(i).second); continue ; } if ( a(i).first == 2){ x_min=min(x_min,a(i).second); continue ; } if ( a(i).first == 3){ y_max =max(y_max,a(i).third); continue ; } if ( a(i).first == 4){ y_min =min(y_min,a(i).third); } } if (x_min<x_max && y_min < y_max){ cout << (x_max-x_min)*(y_max-y_min) <<endl; }else cout << 0 << endl; }
a.cc: In function 'int main()': a.cc:11:7: error: request for member 'at' in 'a', which is of non-class type 'int' 11 | a.at(i) = make_tuple(c,a,b); | ^~ a.cc:16:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 16 | if ( a(i).first == 1){ | ~^~~ a.cc:17:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 17 | x_max=max(x_max,a(i).second); | ~^~~ a.cc:20:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 20 | if ( a(i).first == 2){ | ~^~~ a.cc:21:24: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 21 | x_min=min(x_min,a(i).second); | ~^~~ a.cc:24:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 24 | if ( a(i).first == 3){ | ~^~~ a.cc:25:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 25 | y_max =max(y_max,a(i).third); | ~^~~ a.cc:28:11: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 28 | if ( a(i).first == 4){ | ~^~~ a.cc:29:25: error: no match for call to '(std::vector<std::tuple<int, int, int> >) (int&)' 29 | y_min =min(y_min,a(i).third); | ~^~~
s892034661
p03944
Java
import java.util.Scanner; public class TaskB { public static void main(String[] args) { Scanner in = new Scanner(System.in); int w = in.nextInt(); int h = in.nextInt(); int x0 = 0, y0 = 0; int n = in.nextInt(); for (int i = 0; i < n; i++) { int x1 = in.nextInt(); int y1 = in.nextInt(); int a1 = in.nextInt(); switch (a1) { case 1: x0 = Math.max(x0, x1); break; case 2: w = Math.min(w, x1); break; case 3: y0 = Math.max(y0, y1); break; case 4: h = Math.min(h, y1); break; } } int square = Math.max(0, w - x0) * Math.max(0, h - y0); System.out.println(square); } }
Main.java:3: error: class TaskB is public, should be declared in a file named TaskB.java public class TaskB { ^ 1 error
s649599532
p03944
C++
#include <bits/stdc++.h> #define rep(i , n) for (int i = 0; i < (int)(n); i++) #define INF 1e9; using namespace std; using ll = long long; #include <bits/stdc++.h> int main() { int W , H , N; cin >> W >> H >> N; int l = 0 , r = W , u = H , d = 0; rep(i , n){ int x , y , a; cin >> x >> y >> a; if(a == 1){ l = max(l , x); } if(a == 2){ r = min(r , x); } if(a == 3){ d = max(d , x); } if(a == 4){ u = min(u , x); } } cout << max(0 , r - l) * max(0 , u - d) << endl; }
a.cc: In function 'int main()': a.cc:11:13: error: 'n' was not declared in this scope 11 | rep(i , n){ | ^ a.cc:2:46: note: in definition of macro 'rep' 2 | #define rep(i , n) for (int i = 0; i < (int)(n); i++) | ^
s034602814
p03944
C++
#include<iostream> using namespace std; int main (){ int W, H, N; cin >> W >> H >> N; int x[N]; int y[N]; int a[N]; for (int i = 0; i < N; i ++){ cin >> x[i] >> y[i] >> a[i]; if (a == 1){ W -= x[i]; } else if (a == 2){ } else if (a == 3){ } else if (a == 4){ H -= y[i]; } } cout << W * H << '\n'; }
a.cc: In function 'int main()': a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if (a == 1){ | ~~^~~~ a.cc:14:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | } else if (a == 2){ | ~~^~~~ a.cc:16:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | } else if (a == 3){ | ~~^~~~ a.cc:18:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 18 | } else if (a == 4){ | ~~^~~~
s175568634
p03944
C++
10 10 5 1 6 1 4 1 3 6 9 4 9 4 2 3 1 3
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 10 10 5 | ^~
s117177603
p03944
C
int main(void){ int W,H,N,i,j,k,x[100],y[100],a[100]; int size=0; scanf("%d %d %d",&W,&H,&N); int mat[W][H]; for(i=0;i<=N;i++){ scanf("%d %d %d",&x[i],&y[i],&a[i]); } for(i=0;i<W;i++){ for(j=0;j<H;j++){ mat[i][j]=0;//white } } for(i=0;i<N;i++){ if(a[i]==1){ for(j=0;j<x[i];j++){ for(k=0;k<H;k++){ mat[j][K]=1; } } } else if(a[i]==2){ for(j=x[i];j<W;j++){ for(k=0;k<H;k++){ mat[j][K]=1; } } } else if(a[i]==3){ for(j=0;j<W;j++){ for(k=0;k<y[i];k++){ mat[j][K]=1; } } } else if(a[i]==4){ for(j=0;j<W;j++){ for(k=y[i];k<H;k++){ mat[j][K]=1; } } for(i=0;i<W;i++){ for(j=0;j<H;j++){ if(mat[i][j]==0){ size++; } } } printf("%d",size); return 0; }
main.c: In function 'main': main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%d %d %d",&W,&H,&N); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%d %d %d",&W,&H,&N); | ^~~~~ main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:22:24: error: 'K' undeclared (first use in this function) 22 | mat[j][K]=1; | ^ main.c:22:24: note: each undeclared identifier is reported only once for each function it appears in main.c:55:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 55 | printf("%d",size); | ^~~~~~ main.c:55:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:55:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:55:3: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:58:1: error: expected declaration or statement at end of input 58 | } | ^ main.c:58:1: error: expected declaration or statement at end of input
s707903753
p03944
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int w, h, n; cin >> w >> h >> n; vector<pair<int, int>> xy(n); for (int i = 0; i < n; i++) { int t1, t2, t3; cin >> t1 >> t2 >> t3; if (t3 > 2) xy[i] = make_pair(t2, t3); else xy[i] = make_pair(t1, t3); } int lw = 0, uw = w, lh = 0, uh = h; for (auto x : xy) { if (x.second > 2) { if (x.second % 2 == 1) lh = max(x.first, lh); else uh = min(x.first, uh); } else if (x.second % 2 == 1) lw = max(x.first, lw); else uw = min(x.first, uw); } if ((uw - lw) < 0 || (uh - lh) < 0) cout << 0 << endl; else cout << (uw - lw) * (uh - lh)) << endl; }
a.cc: In function 'int main()': a.cc:37:38: error: expected ';' before ')' token 37 | cout << (uw - lw) * (uh - lh)) << endl; | ^ | ;
s320996581
p03944
C++
#include <bits/stdc++.h> #include <string.h> //s#define rep(i, n) for (int i = 0; i < (n); i++) #define MAX 10000 using namespace std; #define ll long long #define pb push_back #define mp make_pair #define all(a) (a).begin(),(a).end() #define rep(i,a,n) for(int i=a; i<n; i++) #define r0 return 0 #define INF (int)1e15 int main(){ long long left=0,right,top,bottom=0; int n; cin>>right>>top>>n; for(int i=0;i<n;i++){ int x,y,a; cin>>x>>y>>a; if(a == 1) left = max(x,left); else if(a == 2) right = min(right,x); else if(a == 3) bottom = max(right, y); else if(a == 4) top = min(y,top); } int area = (right - left) * (top - bottom); if(left >= right || top <= bottom) cout<<"0"<<endl; else cout<<area<<endl; return 0; }
a.cc: In function 'int main()': a.cc:29:19: error: no matching function for call to 'max(int&, long long int&)' 29 | left = max(x,left); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:29:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 29 | left = max(x,left); | ~~~^~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:29:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 29 | left = max(x,left); | ~~~^~~~~~~~ a.cc:31:21: error: no matching function for call to 'min(long long int&, int&)' 31 | right = min(right,x); | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:31:21: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 31 | right = min(right,x); | ~~~^~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:31:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 31 | right = min(right,x); | ~~~^~~~~~~~~ a.cc:33:21: error: no matching function for call to 'max(long long int&, int&)' 33 | bottom = max(right, y); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed: a.cc:33:21: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') 33 | bottom = max(right, y); | ~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed: a.cc:33:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' 33 | bottom = max(right, y); | ~~~^~~~~~~~~~ a.cc:35:18: error: no matching function for call to 'min(int&, long long int&)' 35 | top = min(y,top); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)' 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed: a.cc:35:18: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int') 35 | top = min(y,top); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)' 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)' 5686 | min(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)' 5696 | min(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed: a.cc:35:18: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 35 | top = min(y,top); | ~~~^~~~~~~
s285163679
p03944
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int w, h, n; cin >> w >> h >> n; int w_right = w; int w_left = 0; int h_upper = h; int h_lower = 0; for (int i = 0; i < n; i++) { int x, y, a; cin >> x >> y >> a; if (a == 1) w_left = max(w_left, x); if (a == 2) w_right = min(w_right, x); if (a == 3) h_lower = max(h_lower, y); if (a == 4) h_upper = min(h_upper, y); } cout << max(0, w_right - w_left) * maz(0, h_upper - h_lower) << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:44: error: 'maz' was not declared in this scope 19 | cout << max(0, w_right - w_left) * maz(0, h_upper - h_lower) << endl; | ^~~
s330234304
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W, H, N; cin >> W >> H >> N; vector<vector<bool>>data(H,vector<bool>(W,true)); for(int i=0;i<N;i++){ int x, y, a; cin >> x >> y >> a; if(a==1){ for(int j=0;j<H;j++){ for(int k=0;k<x;k++){ data.at(j).at(k)=false; } } } if(a==2){ for(int j=0;j<H;j++){ for(int k=x;k<W;k++){ data.at(j).at(k)=false; } } } if(a==3){ for(int j=0;j<y;j++){ for(int k=0;k<x;k++){ data.at(j).at(k)=false; } } } if(a==4){ for(int j=y;j<H;j++){ for(int k=0;k<x;k++){ data.at(j).at(k)=false; } } } } int count=0; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ if(data.at(i).at(j)) cuont++; } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:43:28: error: 'cuont' was not declared in this scope; did you mean 'count'? 43 | if(data.at(i).at(j)) cuont++; | ^~~~~ | count
s420867168
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int W, H, N; cin >> W >> H >> N; vector<vector<int>> color(H, vector<int>(W,0)); int x, y, a; int area=0; for(int i=0; i<N; i++){ cin >> x >> y >> a; if(a==1){ for(int j=0; j<x; j++){ for(int k=0; k<H; k++){ color.at(k).at(j)=1; } } }else if(a==2){ for(int j=x; j<W; j++){ for(int k=0; k<H; k++){ color.at(k).at(j)=1; } } }else if(a==3){ for(int j=0; j<W; j++){ for(int k=0; k<y; k++){ color.at(k).at(j)=1; } } }else if(a==4){ for(int j=0; j<W; j++){ for(int k=y; k<H; k++){ color.at(k).at(j)=1; } } }else{ cout << error <<endl; } } for(int j=0; j<W; j++){ for(int k=0; k<H; k++){ if(color.at(j).at(k)==1){ area++; } } } }
a.cc: In function 'int main()': a.cc:37:15: error: 'error' was not declared in this scope; did you mean 'perror'? 37 | cout << error <<endl; | ^~~~~ | perror
s882744499
p03944
C++
#include<iostream> #include<cmath> #include<numeric> #include<functional> #include<string> #include<algorithm> #include<vector> #include<map> #include<iomanip> #include<queue> #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<n;i++) #define ll long long #define INF 2147483647 using namespace std; using Graph=vector<vector<int>>; int main(){ int w,h,n; cin>>w>>h>>n; int x[n],y[n],a[n]; int xleft=0,xright=w; int ydown=0,yup=h; rep(i,n){ cin>>x[i]>>y[i]>>a[i]; switch(a[i]){ case 1; xleft=max(xleft,x[i]); break; case 2: xright=min(xright,x[i]); break; case 3: ydown=max(ydown,y[i]); break; case 4: yup=min(yup,y[i]); } } int xrange=max(0,xright-xleft); int yrange=max(0,yup-ydown); cout<<xrange*yrange; }
a.cc: In function 'int main()': a.cc:26:13: error: expected ':' before ';' token 26 | case 1; | ^ | :
s292091009
p03944
C++
#include<iostream> #include<cmath> #include<numeric> #include<functional> #include<string> #include<algorithm> #include<vector> #include<map> #include<iomanip> #include<queue> #define rep(i,n) for(int i=0;i<n;i++) #define rep1(i,n) for(int i=1;i<n;i++) #define ll long long #define INF 2147483647 using namespace std; using Graph=vector<vector<int>>; int main(){ int w,h,n; cin>>w>>h>>n; int x[n],y[n],a[n]; int xleft=0,xright=w; int ydown=0,yup=h; dep(i,n){ cin>>x[i]>>y[i]>>a[i]; switch(a[i]){ case 1; xleft=max(xleft,x[i]); break; case 2: xright=min(xright,x[i]); break; case 3: ydown=max(ydown,y[i]); break; case 4: yup=min(yup,y[i]); } } int xrange=max(0,xright-xleft); int yrange=max(0,yup-ydown); cout<<xrange*yrange; }
a.cc: In function 'int main()': a.cc:23:7: error: 'i' was not declared in this scope 23 | dep(i,n){ | ^ a.cc:23:3: error: 'dep' was not declared in this scope; did you mean 'rep'? 23 | dep(i,n){ | ^~~ | rep
s401910696
p03944
C++
#include<iostream> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; int left = 0; int right = W; int bottom = 0; int top = H; for(int i=0; i<N; i++){ int x, y, a; cin >> x >> y >> a; switch(a){ case 1: left = max(left, x); case 2: right = min(right, x); case 3: bottom = max(bottom, y); case 4: bottom = min(bottom, y); } if(right-left<0 || top-bottom<0){ cout << 0 << endl; }else{ cout << (right-left)*(top-bottom) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:31:2: error: expected '}' at end of input 31 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s605435601
p03944
C++
#include<iostream> int main(){ int W, H, N; cin >> W >> H >> N; int left = 0; int right = W; int bottom = 0; int top = H; for(int i=0; i<N; i++){ int x, y, a; cin >> x >> y >> a; switch(a){ case 1: left = max(left, x); case 2: right = min(right, x); case 3: bottom = max(bottom, y); case 4: bottom = min(bottom, y); } if(right-left<0 || top-bottom<0){ cout << 0 << endl; }else{ cout << (right-left)*(top-bottom) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin >> W >> H >> N; | ^~~ | 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:15:16: error: 'max' was not declared in this scope; did you mean 'std::max'? 15 | left = max(left, x); | ^~~ | std::max In file included 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: /usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:17:17: error: 'min' was not declared in this scope; did you mean 'std::min'? 17 | right = min(right, x); | ^~~ | std::min /usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ a.cc:24:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 24 | cout << 0 << 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:24:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 24 | cout << 0 << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:26:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 26 | cout << (right-left)*(top-bottom) << 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:26:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 26 | cout << (right-left)*(top-bottom) << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:29:2: error: expected '}' at end of input 29 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s366573637
p03944
C++
#include <bits/stdc++.h> #include <math.h> #define rep(i,n) for (int i=0;i < (n); ++i) #define ALL(x) (x).begin(), (x).end() using namespace std; using ll = long long; int main() { int w,h,n; cin >> w >> h >>n; vector<vector<int>> mp(h,vector<int>(w,0)); rep(i,n){ int x,y,a; cin >> x >> y >> a; if(a==1){ rep(j,x-1){ rep(k,h){ mp[h][j]=1; } } } else if(a==2){ for(int j = x;j<w-1;j++){ rep(k,h){ mp[h][j]=1; } } } else if(a==3){ rep(j,y-1){ rep(k,w){ mp[j-1][w]=1; } } } else if(a==3){ for(int j = y;j<h-1;j++){ rep(k,w){ mp[j][w]=1; } } } } int ans = 0; rep(i,w){ rep(j,h){ if(mp[j][i]==0) ans++; } } cout << as << endl }
a.cc: In function 'int main()': a.cc:47:13: error: 'as' was not declared in this scope; did you mean 'ans'? 47 | cout << as << endl | ^~ | ans
s816168187
p03944
C++
#include <bits/stdc++.h> #include <math.h> #define rep(i,n) for (int i=0;i < (n); ++i) #define ALL(x) (x).begin(), (x).end() using namespace std; using ll = long long; int main() { int w,h,n; cin >> w >> h >>n; vector<vector<int>> mp(h,vector<int>(x,0)); rep(i,n){ int x,y,a; cin >> x >> y >> a; if(a==1){ rep(j,x-1){ rep(k,h){ mp[h][j]=1; } } } else if(a==2){ for(int j = x,j<w-1;j++){ rep(k,h){ mp[h][j]=1; } } } else if(a==3){ rep(j,y-1){ rep(k,w){ mp[j-1][w]=1; } } } else if(a==3){ for(int j = y,j<h-1;j++){ rep(k,w){ mp[j][w]=1; } } } } int ans = 0; rep(i,w){ rep(j,h){ if(mp[j][i]==0) ans++; } } cout << as << endl }
a.cc: In function 'int main()': a.cc:11:42: error: 'x' was not declared in this scope 11 | vector<vector<int>> mp(h,vector<int>(x,0)); | ^ a.cc:22:28: error: expected ';' before '<' token 22 | for(int j = x,j<w-1;j++){ | ^ | ; a.cc:22:28: error: expected primary-expression before '<' token a.cc:34:28: error: expected ';' before '<' token 34 | for(int j = y,j<h-1;j++){ | ^ | ; a.cc:34:28: error: expected primary-expression before '<' token a.cc:47:13: error: 'as' was not declared in this scope; did you mean 'ans'? 47 | cout << as << endl | ^~ | ans
s493928804
p03944
C++
#include <bits/stdc++.h> #include <ext/rope> #define VALHALLA cin.tie(0);ios_base::sync_with_stdio(false);cout<<fixed<<setprecision(13);cerr<<fixed<<setprecision(5); #define endl "\n" #define pb push_back #define all(v) v.begin(),v.end() #define debug(x) std::cerr << #x << ": " << (x) << '\n'; #define sz(x) (int)x.size() #define fast(map_name) map_name.reserve(1024);map_name.max_load_factor(0.25); using namespace std; using namespace __gnu_cxx; typedef long long int ll; typedef pair<int,int> ii; typedef complex<double> point; const double epsilon=1e-9; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll mod=1e9+7; template <typename T> inline Max(T a, T b) { return (a<b ? b:a);} template <typename T> inline Min(T a, T b) { return (a>b ? b:a);} double dot(point a,point b){ return (conj(a)*b).real() ; } double cross(point a,point b){ return (conj(a)*b).imag() ; } double dist(point a, point b){ return abs(a-b); } struct neal { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM); } }; struct HASH{ size_t operator()(const pair<int,int>&x)const{ return (size_t) x.first * 37U + (size_t) x.second; } }; bool isprime(ll n) { if (n == 2 || n == 3) return true; if (n < 2 || n % 2 == 0 || n % 3 == 0) return false; for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) { if (n % (i - 1) == 0 || n % (i + 1) == 0) { return false; } } return true; } inline ll exp(ll a, ll b, ll mod) { ll n = 1; ll p = a; while (b > 0) { if (b % 2 == 1) { n *= p; n %= mod; } p *= p; p %= mod; b /= 2; } return n; } inline bool comp(double a,double b) { return (fabs(a-b)<epsilon); } ll gcd(ll u, ll v) { ll r; while (0 != v) { r = u % v; u = v; v = r; } return u; } /* FUCNTION TEMPLATE ENDS HERE */ int main() { VALHALLA int w,h,n;cin>>w>>h>>n; int xleft=0,xright=w,ydown=0,yup=h; for(int i=0,x,y,a;i<n;++i) { cin>>x>>y>>a; if(a==1) { xleft=Max(xleft,x); } else if(a==2) { xright=Min(xright,x); } else if(a==3) { ydown=Max(ydown,y); } else if(a==4) { yup=Min(yup,y); } } cout<<Max(0,(xright-xleft)*(yup-ydown))<<endl; }
a.cc:19:31: error: ISO C++ forbids declaration of 'Max' with no type [-fpermissive] 19 | template <typename T> inline Max(T a, T b) { return (a<b ? b:a);} | ^~~ a.cc:20:31: error: ISO C++ forbids declaration of 'Min' with no type [-fpermissive] 20 | template <typename T> inline Min(T a, T b) { return (a>b ? b:a);} | ^~~
s271838495
p03944
C++
#include <bits/stdc++.h> #include <ext/rope> #define VALHALLA cin.tie(0);ios_base::sync_with_stdio(false);cout<<fixed<<setprecision(13);cerr<<fixed<<setprecision(5); #define endl "\n" #define pb push_back #define all(v) v.begin(),v.end() #define debug(x) std::cerr << #x << ": " << (x) << '\n'; #define sz(x) (int)x.size() #define fast(map_name) map_name.reserve(1024);map_name.max_load_factor(0.25); using namespace std; using namespace __gnu_cxx; typedef long long int ll; typedef pair<int,int> ii; typedef complex<double> point; const double epsilon=1e-9; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll mod=1e9+7; /* VARIABLE DECLARATION START */ int globe[int(1e6)]; /* FUCNTION TEMPLATE STARTS HERE */ template <typename T> inline Max(T a, T b) { return (a<b ? b:a);} template <typename T> inline Min(T a, T b) { return (a>b ? b:a);} double dot(point a,point b){ return (conj(a)*b).real() ; } double cross(point a,point b){ return (conj(a)*b).imag() ; } double dist(point a, point b){ return abs(a-b); } struct neal { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31); } size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM); } }; struct HASH{ size_t operator()(const pair<int,int>&x)const{ return (size_t) x.first * 37U + (size_t) x.second; } }; bool isprime(ll n) { if (n == 2 || n == 3) return true; if (n < 2 || n % 2 == 0 || n % 3 == 0) return false; for (ll i = 6; (i - 1) * (i - 1) <= n; i += 6) { if (n % (i - 1) == 0 || n % (i + 1) == 0) { return false; } } return true; } inline ll exp(ll a, ll b, ll mod) { ll n = 1; ll p = a; while (b > 0) { if (b % 2 == 1) { n *= p; n %= mod; } p *= p; p %= mod; b /= 2; } return n; } inline bool comp(double a,double b) { return (fabs(a-b)<epsilon); } ll gcd(ll u, ll v) { ll r; while (0 != v) { r = u % v; u = v; v = r; } return u; } /* FUCNTION TEMPLATE ENDS HERE */ int main() { VALHALLA int w,h,n;cin>>w>>h>>n; int xleft=0,xright=w,ydown=0,yup=h; for(int i=0,x,y,a;i<n;++i) { cin>>x>>y>>a; if(a==1) { xleft=Max(xleft,x); } else if(a==2) { xright=Min(xright,x); } else if(a==3) { ydown=Max(ydown,y); } else if(a==4) { yup=Min(yup,y); } } cout<<Max(0,(xright-xleft)*(yup-ydown))<<endl; }
a.cc:22:31: error: ISO C++ forbids declaration of 'Max' with no type [-fpermissive] 22 | template <typename T> inline Max(T a, T b) { return (a<b ? b:a);} | ^~~ a.cc:23:31: error: ISO C++ forbids declaration of 'Min' with no type [-fpermissive] 23 | template <typename T> inline Min(T a, T b) { return (a>b ? b:a);} | ^~~
s357197939
p03944
C++
#include<bits/stdc++.h> using namespace std; using tiii = tuple<int,int,int>; int main(){ int W, H ,N; cin >> W >> H >> N; tiii T; vector<tiii>A(110); for(int i =0; i <N; i++){ cin >> get<0>(A[i]) >> get<1>(A[i]) >> get<2>(A[i]); } //tuple<x座標,y座標,a> int colored_H ,colored_W= 0; //塗り潰されたHとW int colored_H2,colored_W2= 0;//塗り潰されたHとW(座標(H,W)側からの距離) for(int i=0; i <N; i++){ if(get<2>(A[i]) == 1 && colored_W < get<0>(A[i])){ //a == 1のとき,左側を塗りつぶす.すでに塗り潰されていれば無視 colored_W = get<0>(A[i]); } else if(get<2>(A[i]) == 2 && colored_W2 < (W - get<0>(A[i]) ) ){ colored_W2 = W - get<0>(A[i]); } else if(get<2>(A[i]) == 3 && colored_H < get<1>(A[i]) ){ colored_H = get<1>(A[i]); } //↓問題のコード else if(get<2>(A[i]) == 4 && colored_H2 < (H - get<1>(A[i]) ) ){ colored_H2 = H - get<1>(A[i]);  //この一行を入れるとなぜか正しく動作する //ここで出力しない場合,なぜかここでcoloredH2が変更されない //↑問題のコード  } } H -= colored_H + colored_H2; W -= colored_W + colored_W2; if(H < 0) H = 0; if(W < 0) W = 0; cout << H * W << endl; }
a.cc:32:6: error: extended character   is not valid in an identifier 32 |  //この一行を入れるとなぜか正しく動作する | ^ a.cc: In function 'int main()': a.cc:32:6: error: '\U00003000' was not declared in this scope 32 |  //この一行を入れるとなぜか正しく動作する | ^~
s390032362
p03944
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // 整数の入力 int W = sc.nextInt(); int H = sc.nextInt(); int N = sc.nextInt(); // 要素数Nの配列x,yと整数aの定義 int[] x = int[](N); int[] y = int[](N); int a; // 白い部分の4隅の座標を定義 int Xr = 0; int Xh = W; int Yr = 0; int Yh = H; // N回操作後の白い部分の4隅の座標を代入 for (int i=1; i<=N; i++) { x[i] = sc.nextInt(); y[i] = sc.nextInt(); a = sc.nextInt(); if (a==1) { if (x[i]>Xr) { Xr = x[i]; } } else if (a==2) { if (x[i]<Xh) { Xh = x[i]; } } else if (a==3) { if (y[i]>Yr) { Yr = y[i]; } } else if (a==4) { if (y[i]<Yh) { Yh = y[i]; } } } // 面積の出力 System.out.println((Xh - Xr) * (Yh - Yr)); } }
Main.java:10: error: '.class' expected int[] x = int[](N); ^ Main.java:10: error: not a statement int[] x = int[](N); ^ Main.java:10: error: ';' expected int[] x = int[](N); ^ Main.java:11: error: '.class' expected int[] y = int[](N); ^ Main.java:11: error: not a statement int[] y = int[](N); ^ Main.java:11: error: ';' expected int[] y = int[](N); ^ 6 errors
s022824438
p03944
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int W, H, N; cin >> W >> H >> N; vector<int> x(N), y(N), a(N); for(int i = 0; i < N; i++) { cin >> x[i] >> y[i] >> a[i]; } int x0 = W; int y0 = H; int x1 = 0; int y1 = 0; for(int i = 0; i < N; i++) { if(a[i] == 1 && x1 < x[i]) { x1 = x[i]; } else if(a[i] == 2 && x0 > x[i]) { x0 = x[i]; } else if(a[i] == 3 && y1 < y[i]) y1 = y[i]; else if(a[i] == 4 && y0 > y[i]) y0 = y[i]; } if(x0 <= x1 || y0 <= y1) cout >> 0; else cout << (y0 - y1) * (x0 - x1); return 0; }
a.cc: In function 'int main()': a.cc:28:33: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:28:33: note: candidate: 'operator>>(int, int)' (built-in) 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ~~~~~^~~~ a.cc:28:33: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:28:28: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ In file included from /usr/include/c++/14/istream:1109, 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: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int]': a.cc:28:36: required from here 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:28:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 28 | if(x0 <= x1 || y0 <= y1) cout >> 0; | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/ioman
s974372428
p03944
C++
#include <iostream> #include <cmath> using namespace std; int main(){ double w,h,n,a,b,c; cin>>w>>h>>n; double xl,xr,yu,yd; xl=0; xr=w; yu=h; yd=0; for(int i=0;i<n;i++){ cin>>a>>b>>c; if(c==1 and xl<a){ xl=a; } else if(c==2 and xr>a){ xr=a; } else if(c==3 and yb<b){ yd=b; } else if(c==4 and yb>b){ yu=b; } if((xr-xl)<=0 or (yu-yd)<=0){ cout<<0; break; } } if((xr-xl)>0 and (yu-yd)>0){ cout<<(xr-xl)*(yu-yd); } }
a.cc: In function 'int main()': a.cc:22:22: error: 'yb' was not declared in this scope; did you mean 'yd'? 22 | else if(c==3 and yb<b){ | ^~ | yd
s927186618
p03944
C++
#include <iostream> #include <cmath> using namespace std; int main(){ double w,h,n,a,b,c; cin>>w>>h>>n; double xl,xr,yu,yd; xl=0; xr=w; yu=h; yd=0; for(int i=0;i<n;i++){ cin>>a>>b>>c; if(c==1){ xl=a; } else if(c==2){ xr=a; } else if(c==3){ yd=b; } else if(c==4){ yu=b; } if((xr-xl)<=0 or (yu-yd)<=0) { cout<<0; break; } } } if((xr-xl)>0 and (yu-yd)>0){ cout<<(xr-xl)*(yu-yd); } }
a.cc:34:3: error: expected unqualified-id before 'if' 34 | if((xr-xl)>0 and (yu-yd)>0){ | ^~ a.cc:39:1: error: expected declaration before '}' token 39 | } | ^
s428199207
p03944
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int w,h,n,a,b,c; cin>>w>>h>>n; int xl,xr,yu,yd; xl=0; xr=w; yu=h; yd=0; for(int i=0;i<n;i++){ cin>>a>>b>>c; if(c==1){ xl=a; } else if(c==2){ xr=a; } else if(c==3){ yd=b; } else if(c==4){ yu=d; } } cout<<(xr-xl)*(yu-yd); }
a.cc: In function 'int main()': a.cc:26:10: error: 'd' was not declared in this scope 26 | yu=d; | ^
s007919144
p03944
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int w,h,n,a,b,c; cin>>w>>h>>n; int xl,xr,yu,yd; xl=0; xr=w; yu=h; yd=0; for(int i=0;i<n;i++){ cin>>a>>b>>c; if(c==1){ xl=a; } else if(c==2){ xr=a; } else if(c==3){ yd=b; } else if(c==4){ yu=d; } } cout<<(xr-xl)*(yu*yd); }
a.cc: In function 'int main()': a.cc:26:10: error: 'd' was not declared in this scope 26 | yu=d; | ^
s819482938
p03944
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int w,h,n,a,b,c; cin>>w>>h>>n; int xl,xr,yu,yd; xl=0; xr=w; yu=h; yd=0; for(int i=0;i<n;i++){ cin>>a>>b>>c; if(c==1){ xl=a; } else if(c==2){ xr=a; } else if(c==3){ yd=b; } else if(c==4){ yu=d; } } cout<<(xr-xl)*(yu0yd); }
a.cc: In function 'int main()': a.cc:26:10: error: 'd' was not declared in this scope 26 | yu=d; | ^ a.cc:29:18: error: 'yu0yd' was not declared in this scope 29 | cout<<(xr-xl)*(yu0yd); | ^~~~~
s654181087
p03944
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; void ABC40(void); void ABC41(void); void ABC42(void); void ABC43(void); void ABC44(void); void ABC45(void); void ABC46(void); void ABC47(void); void ABC48(void); void ABC49(void); int main(void){ ABC47(); } void ABC47(){ int minx=0,maxx,miny=0,maxy,n,x,y,i,a; cin>>maxx>>maxy>>n; for(i=0;i<n;i++){ cin>>x>>y>>a; if(a==1&&x>minx)minx=x; if(a==2&&x<maxx)maxx=x; if(a==3&&y>miny)miny=y; if(a==4&&y<maxy)maxy=y; } if((maxx-minx)>=0&&(maxy-miny)>=0)s=(maxx-minx)*(maxy-miny); if(s>=0)cout<<s<<endl; else cout<<0<<endl; }
a.cc: In function 'void ABC47()': a.cc:29:39: error: 's' was not declared in this scope 29 | if((maxx-minx)>=0&&(maxy-miny)>=0)s=(maxx-minx)*(maxy-miny); | ^ a.cc:30:8: error: 's' was not declared in this scope 30 | if(s>=0)cout<<s<<endl; | ^
s074944492
p03944
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; void ABC40(void); void ABC41(void); void ABC42(void); void ABC43(void); void ABC44(void); void ABC45(void); void ABC46(void); void ABC47(void); void ABC48(void); void ABC49(void); int main(void){ ABC47(); } void ABC47(){ int minx=0,maxx,miny=0,maxy,n,x,y,i,a; cin>>maxx>>maxy>>n; for(i=0;i<n;i++){ cin>>x>>y>>a; if(a==1&&x>minx)minx=x; if(a==2&&x<maxx)maxx=x; if(a==3&&y>miny)miny=y; if(a==4&&y<maxy)maxy=y; } if((maxx-minx)&&(maxy-miny))s=(maxx-minx)*(maxy-miny); if(s>=0)cout<<s<<endl; else cout<<0<<endl; }
a.cc: In function 'void ABC47()': a.cc:29:33: error: 's' was not declared in this scope 29 | if((maxx-minx)&&(maxy-miny))s=(maxx-minx)*(maxy-miny); | ^ a.cc:30:8: error: 's' was not declared in this scope 30 | if(s>=0)cout<<s<<endl; | ^
s907651508
p03944
C++
#include <bits/stdc++.h> #include <math.h> using namespace std; void ABC40(void); void ABC41(void); void ABC42(void); void ABC43(void); void ABC44(void); void ABC45(void); void ABC46(void); void ABC47(void); void ABC48(void); void ABC49(void); int main(void){ ABC47(); } void ABC47(){ int minx=0,maxx,miny=0,maxy,n,x,y,i,a,h,w; cin>>maxx>>maxy>>n; w=maxx; h=maxy; for(i=0;i<n;i++){ cin>>x>>y>>a; if(x>=max||y>=min)continue; if(a==1&&x>minx)minx=x; if(a==2&&x<maxx)maxx=x; if(a==3&&y>miny)miny=y; if(a==4&&y<maxy)maxy=y; } int s=(maxx-minx)*(maxy-miny); if(s>=0)cout<<s<<endl; else cout<<0<<endl; }
a.cc: In function 'void ABC47()': a.cc:26:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>=' 26 | if(x>=max||y>=min)continue; | ~^~~~~ a.cc:26:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>=' 26 | if(x>=max||y>=min)continue; | ~^~~~~
s120871331
p03944
C++
#include <bits/stdc++.h> using namespace std; int main(){ int xmax, ymax, n; cin >> xmax >> ymax >> n; vector<int> x(n); vector<int> y(n); vector<int> a(n); int xmin = 0; int ymin = 0; for (int i = 0; i < n; i++) { cin >> x.at(i) >> y.at(i) >> a.at(i); if (a.at(i) == 1) { xmin = max(xmin,x.at(i)); } else if (a.at(i) == 2) { xmax = min(xmax,x.at(i)); } else if (a.at(i) == 3) { ymin = max(ymin,y.at(i)); } else if (a.at(i) == 4) { ymin = max(ymin,y.at(i)); } } int s; s = max(0,(xmax-xmin))*max(0,(yymax-ymin)); cout << s << endl; }
a.cc: In function 'int main()': a.cc:34:33: error: 'yymax' was not declared in this scope; did you mean 'ymax'? 34 | s = max(0,(xmax-xmin))*max(0,(yymax-ymin)); | ^~~~~ | ymax
s650885409
p03944
C++
#include <bits/stdc++.h> using namespace std; int main(){ int xmax, ymax, n; cin >> xmax >> ymax >> n; vector<int> x(n); vector<int> y(n); vector<int> a(n); int xmin = 0; int ymin = 0; for (int i = 0; i < n; i++) { cin >> x.at(i) >> y.at(i) >> a.at(i); if (a.at(i) == 1) { xmin = max(xmin,x.at(i)); } else if (a.at(i) == 2) { xmax = min(xmax,x.at(i)); } else if (a.at(i) == 3) { ymin = max(ymin,y.at(i)); } else if (a.at(i) == 4) { ymin = max(ymin,y.at(i)); } } int s; s = max(0,(xmax-xmin))*max(0,(max-ymin)); cout << s << endl; }
a.cc: In function 'int main()': a.cc:34:36: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-' 34 | s = max(0,(xmax-xmin))*max(0,(max-ymin)); | ~~~^~~~~
s600228399
p03944
C++
#include <iostream> #include <algorithm> using namespace std; const int maxn = 100 + 10; int main() { int w, h, n; cin >> w >> h >> n; int wl = 0, wr = w, hd = 0, hu = h; while (n--) { int x, y, a; cin >> x >> y >> a; switch (a) { case 1: wl = x; break; case 2: wr = x; break; case 3: hd = y; break; case 4: hu = y; break; default: break; } } int ans; if (wr <= wl || hu <= hd) ans = 0; else ans = (wr - wl) * (hu - hd); cout << ans << endl; return 0; }
a.cc:1:21: warning: extra tokens at end of #include directive 1 | #include <iostream> #include <algorithm> using namespace std; const int maxn = 100 + 10; int main() { int w, h, n; cin >> w >> h >> n; int wl = 0, wr = w, hd = 0, hu = h; while (n--) { int x, y, a; cin >> x >> y >> a; switch (a) { case 1: wl = x; break; case 2: wr = x; break; case 3: hd = y; break; case 4: hu = y; break; default: break; } } int ans; if (wr <= wl || hu <= hd) ans = 0; else ans = (wr - wl) * (hu - hd); cout << ans << endl; 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
s906645966
p03944
C++
#include<iostream> using namespace std; int max(int a,int b) { if(a>b) return a; else return b; } int min(int a,int b) { if(a<b) return a; else return b; } int main() { int w,h,n,s,i,x[105],y[105],a[105]; cin>>w>>h>>n; int x1=0,x2=w,y1=0,y2=h; for(i=0;i<n;i++) { cin>>x[i]>>y[i]>>a[i]; if(a==1) x1=max(x1,x[i]); if(a==2) x2=min(x2,x[i]); if(a==3) y1=max(y1,y[i]); if(a==4) y2=min(y2,y[i]); } s=(x2-x1)*(y2-y1); if(x2-x1<=0||y2-y1<=0) s=0; cout<<s<<endl; }
a.cc: In function 'int main()': a.cc:25:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 25 | if(a==1) | ~^~~ a.cc:27:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 27 | if(a==2) | ~^~~ a.cc:29:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 29 | if(a==3) | ~^~~ a.cc:31:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 31 | if(a==4) | ~^~~
s151829892
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> v(3*N); for(int i = 0; i < 3*N; i++){ cin >> v[i]; } for(int i = 0; i < N; i++){ if(v[3i+2] == 1){ left.push(v[3i]); } else if(v.at(3i + 2) == 2){ right.push(v[3i]); } else if(v[3i + 2] == 3){ down.push(vec[3i+1]); } else if(v[3i + 2] == 4){ up.push(v[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:15:12: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 15 | if(v[3i+2] == 1){ | ~~^~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:15:13: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:15:13: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 15 | if(v[3i+2] == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:15:13: note: mismatched types 'const _CharT*' and 'std::complex<double>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:15:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:15:13: note: mismatched types 'const _CharT*' and 'std::complex<double>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:15:13: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:15:13: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(v[3i+2] == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:15:13: note: mismatched types 'const std::complex<_Tp>' and 'int' 15 | if(v[3i+2] == 1){ | ^ /usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const _Tp&)' 349 | operator+(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/incl
s723212011
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } for(int i = 0; i < N; i++){ if(vec[3i+2] == 1){ left.push(vec[3i]); } else if(vec.at(3i + 2) == 2){ right.push(vec[3i]); } else if(vec[3i + 2] == 3){ down.push(vec[3i+1]); } else if(vec[3i + 2] == 4){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:15:14: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 15 | if(vec[3i+2] == 1){ | ~~^~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:15:15: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:15:15: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 15 | if(vec[3i+2] == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:15:15: note: mismatched types 'const _CharT*' and 'std::complex<double>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:15:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:15:15: note: mismatched types 'const _CharT*' and 'std::complex<double>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:15:15: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:15:15: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 15 | if(vec[3i+2] == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:15:15: note: mismatched types 'const std::complex<_Tp>' and 'int' 15 | if(vec[3i+2] == 1){ | ^ /usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const _Tp&)' 349 | operator+(c
s601786858
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 for(int i = 0; i < N; i++){ if(vec.at(3i + 2) == 1){ left.push(vec[3i]); } else if(vec.at(3i + 2) == 2){ right.push(vec[3i]); } else if(vec[3i + 2] == 3){ down.push(vec[3i+1]); } else if(vec[3i + 2] == 4){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:18:18: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 18 | if(vec.at(3i + 2) == 1){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const _CharT*' and 'std::complex<double>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const _CharT*' and 'std::complex<double>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::complex<_Tp>' and 'int' 18 | if(vec.at(3i + 2) == 1){ |
s375374004
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 for(int i = 0; i < N; i++){ if(vec.at(3i + 2) == 1){ left.push(vec[3i]); } else if(vec.at(3i + 2) == '2'){ right.push(vec[3i]); } else if(vec[3i + 2] == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2] == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:18:18: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 18 | if(vec.at(3i + 2) == 1){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const _CharT*' and 'std::complex<double>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const _CharT*' and 'std::complex<double>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:18:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | if(vec.at(3i + 2) == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:18:20: note: mismatched types 'const std::complex<_Tp>' and 'int' 18 | if(vec.at(3i + 2) == 1){ |
s851045504
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec.at(3i + 2) == 1){ left.push(vec[3i]); } else if(vec.at(3i + 2) == '2'){ right.push(vec[3i]); } else if(vec[3i + 2] == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2] == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:22:18: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 22 | if(vec.at(3i + 2) == 1){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:20: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:20: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if(vec.at(3i + 2) == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:20: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:20: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:20: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:20: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec.at(3i + 2) == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:22:20: note: mismatched types 'const std::complex<_Tp>' and 'int' 22 | if(vec.at(3i + 2) == 1){ |
s982588432
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec[3i + 2] == 1){ left.push(vec[3i]); } else if(vec.at(3i + 2) == '2'){ right.push(vec[3i]); } else if(vec[3i + 2] == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2] == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:22:15: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 22 | if(vec[3i + 2] == 1){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::complex<_Tp>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std:
s762140621
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec[3i + 2] == 1){ left.push(vec[3i]); } else if(vec[3i + 2] == '2'){ right.push(vec[3i]); } else if(vec[3i + 2] == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2] == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:22:15: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 22 | if(vec[3i + 2] == 1){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::complex<_Tp>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std:
s603467131
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec[3i + 2] == '1'){ left.push(vec[3i]); } else if(vec[3i + 2] == '2'){ right.push(vec[3i]); } else if(vec[3i + 2] == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2] == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:22:15: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 22 | if(vec[3i + 2] == '1'){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::complex<_Tp>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/complex:349:5: note: candidate: 'template<c
s997329370
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec[3i + 2] == 1){ left.push(vec[3i]); } else if(vec[3i + 2] == 2){ right.push(vec[3i]); } else if(vec[3i + 2] == 3){ down.push(vec[3i+1]); } else if(vec[3i + 2] == 4){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:22:15: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 22 | if(vec[3i + 2] == 1){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == 1){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::complex<_Tp>' and 'int' 22 | if(vec[3i + 2] == 1){ | ^ /usr/include/c++/14/complex:349:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std:
s544759002
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec[3i + 2] == '1'){ left.push(vec[3i]); } else if(vec[3i + 2] == '2'){ right.push(vec[3i]); } else if(vec[3i + 2] == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2] == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:22:15: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 22 | if(vec[3i + 2] == '1'){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2] == '1'){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::complex<_Tp>' and 'int' 22 | if(vec[3i + 2] == '1'){ | ^ /usr/include/c++/14/complex:349:5: note: candidate: 'template<c
s520580411
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } vector<int> left(0);//1 vector<int> right(0);//2 vector<int> down(0);//3 vector<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec[3i + 2]) == '1'){ left.push(vec[3i]); } else if(vec[3i + 2]) == '2'){ right.push(vec[3i]); } else if(vec[3i + 2]) == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2]) == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:22:15: error: no match for 'operator+' (operand types are 'std::complex<double>' and 'int') 22 | if(vec[3i + 2]) == '1'){ | ~~ ^ ~ | | | | | int | std::complex<double> In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 22 | if(vec[3i + 2]) == '1'){ | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const _CharT*' and 'std::complex<double>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:22:17: note: 'std::complex<double>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 22 | if(vec[3i + 2]) == '1'){ | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:22:17: note: mismatched types 'const std::complex<_Tp>' and 'int' 22 | if(vec[3i + 2]) == '1'){ | ^ /usr/include/c++/14/complex:349:5: note: candid
s518953120
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W, H, N; cin >> W >> H >> N; vector<int> vec(3*N); for(int i = 0; i < 3*N; i++){ cin >> vec[i]; } priority_queue<int> left(0);//1 priority_queue<int> right(0);//2 priority_queue<int> down(0);//3 priority_queue<int> up(0);//4 int U = H; int D = 0; int L = 0; int R = W; for(int i = 0; i < N; i++){ if(vec[3i + 2]) == '1'){ left.push(vec[3i]); } else if(vec[3i + 2]) == '2'){ right.push(vec[3i]); } else if(vec[3i + 2]) == '3'){ down.push(vec[3i+1]); } else if(vec[3i + 2]) == '4'){ up.push(vec[3i+1]); } } int length = min_element(up.begin(), up.end()) = max_element(down.begin(), down.end()); int wide = min_element(right.begin(), up.end()) = max_element(left.begin(), down.end()); if(length < 0 || wide < 0){ cout << 0 << endl; } else{ cout << lenth*wide << endl; }
a.cc: In function 'int main()': a.cc:12:29: error: no matching function for call to 'std::priority_queue<int>::priority_queue(int)' 12 | priority_queue<int> left(0);//1 | ^ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:1: /usr/include/c++/14/bits/stl_queue.h:691:9: note: candidate: 'template<class _InputIterator, class _Alloc, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(_InputIterator, _InputIterator, const _Compare&, _Sequence&&, const _Alloc&) [with _Alloc = _InputIterator; _Requires = _Alloc; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 691 | priority_queue(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:691:9: note: candidate expects 5 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:679:9: note: candidate: 'template<class _InputIterator, class _Alloc, class, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Sequence&, const _Alloc&) [with _Alloc = _InputIterator; <template-parameter-2-3> = _Alloc; _Requires = <template-parameter-1-3>; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 679 | priority_queue(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:679:9: note: candidate expects 5 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:671:9: note: candidate: 'template<class _InputIterator, class _Alloc, class, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Alloc&) [with _Alloc = _InputIterator; <template-parameter-2-3> = _Alloc; _Requires = <template-parameter-1-3>; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 671 | priority_queue(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:671:9: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:663:9: note: candidate: 'template<class _InputIterator, class _Alloc, class, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(_InputIterator, _InputIterator, const _Alloc&) [with _Alloc = _InputIterator; <template-parameter-2-3> = _Alloc; _Requires = <template-parameter-1-3>; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 663 | priority_queue(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:663:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:649:9: note: candidate: 'template<class _InputIterator, class> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(_InputIterator, _InputIterator, const _Compare&, _Sequence&&) [with <template-parameter-2-2> = _InputIterator; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 649 | priority_queue(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:649:9: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:638:9: note: candidate: 'template<class _InputIterator, class> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Sequence&) [with <template-parameter-2-2> = _InputIterator; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 638 | priority_queue(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:638:9: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:629:9: note: candidate: 'template<class _InputIterator, class> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(_InputIterator, _InputIterator, const _Compare&) [with <template-parameter-2-2> = _InputIterator; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 629 | priority_queue(_InputIterator __first, _InputIterator __last, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:629:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:594:9: note: candidate: 'template<class _Alloc, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(std::priority_queue<_Tp, _Sequence, _Compare>&&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 594 | priority_queue(priority_queue&& __q, const _Alloc& __a) | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:594:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:590:9: note: candidate: 'template<class _Alloc, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const std::priority_queue<_Tp, _Sequence, _Compare>&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 590 | priority_queue(const priority_queue& __q, const _Alloc& __a) | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:590:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:585:9: note: candidate: 'template<class _Alloc, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, _Sequence&&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 585 | priority_queue(const _Compare& __x, _Sequence&& __c, const _Alloc& __a) | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:585:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:579:9: note: candidate: 'template<class _Alloc, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, const _Sequence&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 579 | priority_queue(const _Compare& __x, const _Sequence& __c, | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:579:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:573:9: note: candidate: 'template<class _Alloc, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 573 | priority_queue(const _Compare& __x, const _Alloc& __a) | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:573:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:569:9: note: candidate: 'template<class _Alloc, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Alloc&) [with _Requires = _Alloc; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 569 | priority_queue(const _Alloc& __a) | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:569:9: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/stl_queue.h: In substitution of 'template<class _Tp, class _Sequence, class _Compare> template<class _Alloc> using std::priority_queue<_Tp, _Sequence, _Compare>::_Uses = typename std::enable_if<std::uses_allocator<_Sequence, _Alloc>::value>::type [with _Alloc = int; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]': /usr/include/c++/14/bits/stl_queue.h:567:33: required from here 567 | template<typename _Alloc, typename _Requires = _Uses<_Alloc>> | ^~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:513:15: error: no type named 'type' in 'struct std::enable_if<false, void>' 513 | using _Uses = typename | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:554:9: note: candidate: 'template<class _Seq, class _Requires> std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue() [with _Requires = _Seq; _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 554 | priority_queue() | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:554:9: note: candidate expects 0 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:563:7: note: candidate: 'std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, _Sequence&&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 563 | priority_queue(const _Compare& __x, _Sequence&& __s = _Sequence()) | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:563:38: note: no known conversion for argument 1 from 'int' to 'const std::less<int>&' 563 | priority_queue(const _Compare& __x, _Sequence&& __s = _Sequence()) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_queue.h:558:7: note: candidate: 'std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, const _Sequence&) [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]' 558 | priority_queue(const _Compare& __x, const _Sequence& __s) | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:558:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_queue.h:496:11: note: candidate: 'std::priority_queue<int>::priority_queue(const std::priority_queue<int>&)' 496 | class priority_queue | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:496:11: note: no known conversion for argument 1 from 'int' to 'const std::priority_queue<int>&' /usr/include/c++/14/bits/stl_queue.h:496:11: note: candidate: 'std::priority_queue<int>::priority_queue(std::priority_queue<int>&&)' /usr/include/c++/14/bits/stl_queue.h:496:11: note: no known conversion for argument 1 from
s218135337
p03944
C++
#include <bits/stdc++.h> using namespace std; int main() { int w,h,n; cin>>w>>h>>n; int X1=0,X2=w,Y1=0,Y2=h; for(int i=0;i<n;i++) { int x,y,a; cin>>x>>y>>a; if(a==1) { X1=max(X1,x); } else if(a==2) { X2=min(X2,x); } else if(a==3) { Y1=max(Y1,y); } else if(a==4) { Y2=min(Y2,y); } } long long ans=max(X2-X1)*(Y2-Y1); if(X2<=X1 ||Y2<=Y1)ans=0; cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:31:20: error: no matching function for call to 'max(int)' 31 | long long ans=max(X2-X1)*(Y2-Y1); | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 1 provided In file included from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)' 5706 | max(initializer_list<_Tp> __l) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5706:5: note: template argument deduction/substitution failed: a.cc:31:20: note: mismatched types 'std::initializer_list<_Tp>' and 'int' 31 | long long ans=max(X2-X1)*(Y2-Y1); | ~~~^~~~~~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)' 5716 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate expects 2 arguments, 1 provided
s102913545
p03944
C++
#include<bits/stdc++.h> using namespace std; int main(){ int W,H,N; cin>>W>>H>>N; int maxX=0; int minX=W; int maxY=0; int minY=H; for(int i=0;i<N;i++){ int x,y,a; cin>>x>>y>>a; if(a==1){ if(maxX<x) maxX=x; } if(a==2){ if(x<minX) minX=x; } if(a==3){ if(maxY<y) maxY=y; } if(a==4){ if(y<minY) minY=y; } }if(minX<=MaxX || minY<=maxY) cout<<0<<endl; else{ int ans=(minX-maxX)*(minY-maxY); cout<<ans<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:30:13: error: 'MaxX' was not declared in this scope; did you mean 'maxX'? 30 | }if(minX<=MaxX || minY<=maxY) | ^~~~ | maxX
s686395011
p03944
C++
#include<bits/stdc++.h> using namespace std; int main() { int w, h, n, bxr=0, bxl=0, byu=0, byl=0, ans = 0; cin >> w >> h >> n ; vector<int> vecx(n), vecy(n), op(n); for(int i=0; i<n; i++){ cin >> vecx(n) >> vecy(n) >> op(n); } bxl = w; byu = h; ans = w*h; for(int i=0;i<n;i++){ if(op[i] == 1 && bxr<vecx[i]){ bxr = vecx[i]; } if(op[i] == 2 && vecx[i]<bxl){ bxl = vecx[i]; } if(op[i] == 3 && byl<vecy[i]){ byl = vecy[i]; } if(op[i] == 4 && vecy[i]<byu){ byu = vecy[i]; } } ans = (byu - byl)*(bxl - bxr); cout << ans <<endl; }
a.cc: In function 'int main()': a.cc:9:16: error: no match for call to '(std::vector<int>) (int&)' 9 | cin >> vecx(n) >> vecy(n) >> op(n); | ~~~~^~~ a.cc:9:27: error: no match for call to '(std::vector<int>) (int&)' 9 | cin >> vecx(n) >> vecy(n) >> op(n); | ~~~~^~~ a.cc:9:36: error: no match for call to '(std::vector<int>) (int&)' 9 | cin >> vecx(n) >> vecy(n) >> op(n); | ~~^~~
s702789783
p03944
C
#include<stdio.h> int main(){ int W,H,N = 0; scanf("%d %d %d",&W,&H,&N); int genten[2] = {0,0}; int kado[2] = {W,H}; int S = 0; int WW[N],HH[N],NN[N]; for(int i=0; i<N; i++){ scanf("%d %d %d",&WW[i],&HH[i],&NN[i]); } for(int j=0; j<N; j++){ if(NN[j]==1){ if(genten[0] < WW[j]){ genten [0] = WW[j]; } }else if(NN[j]==2){ if(kado[0] > WW[j]){ kado[0] = WW[j]; } }else if(NN[j]==3){ if(genten[1] < HH[j]){ genten [1] = HH[j]; } }else{ if(kado[1] > HH[j]){ kado[1] = HH[j]; } } } if((kado[0]-genten[0] > 0) && (kado[1]-genten[1] > 0 ) ){ S = (kado[0]-genten[0])*(kado[1]-genten[1]); }else{ S = 0; } printf("%d",S) return 0; }
main.c: In function 'main': main.c:42:23: error: expected ';' before 'return' 42 | printf("%d",S) | ^ | ; 43 | 44 | return 0; | ~~~~~~
s990487971
p03944
C
#include<stdio.h> int main(){ int W,H,N = 0; scanf("%d %d %d",&W,&H,&N); int genten[2] = {0,0}; int kado[2] = {W,H}; int S = 0; int WW[N],HH[N],NN[N]; for(int i=0; i<N; i++){ scanf("%d %d %d",&WW[i],&HH[i],&NN[i]); } for(int j=0; j<N; j++){ if(NN[j]==1){ if(genten[0] < WW[j]){ genten [0] = WW[j]; } }else if(NN[j]==2){ if(kado[0] > WW[j]){ kado[0] = WW[j]; } }else if(NN[j]==3){ if(genten[1] < HH[j]){ genten [1] = HH[j]; } }else{ if(kado[1] > HH[j]){ kado[1] = HH[j]; } } } if((kado[0]-genten[0] > 0) && (kado[1]-genten[1]) ){ S = (kado[0]-genten[0])*(kado[1]-genten[1]); }else{ S = 0; } printf("%d",S) return 0; }
main.c: In function 'main': main.c:42:23: error: expected ';' before 'return' 42 | printf("%d",S) | ^ | ; 43 | 44 | return 0; | ~~~~~~