记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:8:23: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
    8 |         for (int &&i: g) cin >> i, --i;
      |                       ^
foo.cc:8:20: warning: loop variable 'i' of type 'int&&' binds to a temporary constructed from type 'int' [-Wrange-loop-construct]
    8 |         for (int &&i: g) cin >> i, --i;
      |                    ^
foo.cc:8:20: note: use non-reference type 'int' to make the copy explicit or 'const int&' to prevent copying
foo.cc:9:23: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
    9 |         for (int &&i: c) cin >> i;
      |                       ^
foo.cc:9:20: warning: loop variable 'i' of type 'int&&' binds to a temporary constructed from type 'int' [-Wrange-loop-construct]
    9 |         for (int &&i: c) cin >> i;
      |                    ^
foo.cc:9:20: note: use non-reference type 'int' to make the copy explicit or 'const int&' to prevent copying
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1498 Problem 1F. Infinite sequence
语言
C++
递交时间
2023-09-19 18:49:49
评测时间
2023-09-19 18:49:49
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes