/ WHOJ /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:7:9: error: 'T' was not declared in this scope
    7 |         T=read(),n=read(),K=read();
      |         ^
foo.cc:7:15: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
    7 |         T=read(),n=read(),K=read();
      |           ~~~~^~
In file included from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/bits/sigstksz.h:24,
                 from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/signal.h:328,
                 from /nix/store/l4dvshb0bw0ipyx17f6rknzk83mdx81y-gcc-11.3.0/include/c++/11.3.0/csignal:42,
                 from stdc++.h:43:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
foo.cc:7:18: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         T=read(),n=read(),K=read();
      |                  ^
      |                  yn
foo.cc:7:24: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
    7 |         T=read(),n=read(),K=read();
      |                    ~~~~^~
In file included from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/bits/sigstksz.h:24,
                 from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/signal.h:328,
                 from /nix/store/l4dvshb0bw0ipyx17f6rknzk83mdx81y-gcc-11.3.0/include/c++/11.3.0/csignal:42,
                 from stdc++.h:43:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
foo.cc:7:27: error: 'K' was not declared in this scope
    7 |         T=read(),n=read(),K=read();
      |                           ^
foo.cc:7:33: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
    7 |         T=read(),n=read(),K=read();
      |                             ~~~~^~
In file included from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/bits/sigstksz.h:24,
                 from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/signal.h:328,
                 from /nix/store/l4dvshb0bw0ipyx17f6rknzk83mdx81y-gcc-11.3.0/include/c++/11.3.0/csignal:42,
                 from stdc++.h:43:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
foo.cc:9:12: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
    9 |     cow[0].pb({0,0}),cow[1].pb({0,0});
      |            ^~
foo.cc:9:29: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
    9 |     cow[0].pb({0,0}),cow[1].pb({0,0});
      |                             ^~
foo.cc:11:14: error: 'c' was not declared in this scope
   11 |         cin>>c;
      |              ^
foo.cc:12:19: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
   12 |         int x=read(),y=read();
      |               ~~~~^~
In file included from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/bits/sigstksz.h:24,
                 from /nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/signal.h:328,
                 from /nix/store/l4dvshb0bw0ipyx17f6rknzk83mdx81y-gcc-11.3.0/include/c++/11.3.0/csignal:42,
                 from stdc++.h:43:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
foo.cc:13:27: error: 'y' was not declared in this scope
   13 |         cow[c=='H'].pb({x,y});
      |                           ^
foo.cc:14:9: error: 'sum' was not declared in this scope
   14 |         sum+=y;
      |         ^~~
foo.cc:16:5: error: 'A' was not declared in this scope
   16 |     A=sz(cow[0]),B=sz(cow[1]);
      |     ^
foo.cc:16:7: error: 'sz' was not declared in this scope
   16 |     A=sz(cow[0]),B=sz(cow[1]);
      |       ^~
foo.cc:16:18: error: 'B' was not declared in this scope
   16 |     A=sz(cow[0]),B=sz(cow[1]);
      |                  ^
foo.cc:21:30: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'x'
   21 |             if(abs(cow[0][i].x-cow[1][j].x)<=K)
      |                              ^
foo.cc:21:42: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'x'
   21 |             if(abs(cow[0][i].x-cow[1][j].x)<=K)
      |                                          ^
foo.cc:22:62: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'y'
   22 |                 dp[i][j]=max(dp[i][j],dp[i-1][j-1]+cow[0][i].y+cow[1][j].y);
      |                                                              ^
foo.cc:22:74: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'y'
   22 |                 dp[i][j]=max(dp[i][j],dp[i-1][j-1]+cow[0][i].y+cow[1][j].y);
      |                                                                          ^
foo.cc:24:23: error: 'sum' was not declared in this scope
   24 |         printf("%d\n",sum-dp[A][B]);
      |                       ^~~
Found 22 testcases.
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1735 [USACO21DEC] Paired Up G
题目数据
下载
语言
C++
递交时间
2022-09-27 22:41:59
评测时间
2022-09-27 22:41:59
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes