Submission #1165553

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11655532025-03-12 04:25:59sleepntsheepProgression (NOI20_progression)C++20
Compilation error
0 ms0 KiB
#include <stdio.h>
int max1(int i, int j) {
return i > j ? i : j;
}
int min1(int i, int j) {
return i < j ? i : j;
}
#define N (1333333)
struct Line {
using T = long long;
T m, c;
T operator()(T x) {
return x * m + c;
}
Line friend operator+(const Line &a, const Line &b) {
return Line{a.m + b.m, a.c + b.c};
}
void operator+=(const Line &o) {
m += o.m;
c += o.c;
}
Line friend operator*(const Line &a, T x) {
return Line{a.m * x, a.c * x};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Progression.cpp: In member function 'void<unnamed struct>::range_set(int, int, int, int, int, Line)':
Progression.cpp:88:34: error: no match for 'operator=' (operand types are 'Line' and 'int')
   88 |                         lza[v] = 0;
      |                                  ^
Progression.cpp:13:8: note: candidate: 'constexpr Line& Line::operator=(const Line&)'
   13 | struct Line {
      |        ^~~~
Progression.cpp:13:8: note:   no known conversion for argument 1 from 'int' to 'const Line&'
Progression.cpp:13:8: note: candidate: 'constexpr Line& Line::operator=(Line&&)'
Progression.cpp:13:8: note:   no known conversion for argument 1 from 'int' to 'Line&&'
Progression.cpp: In member function 'void<unnamed struct>::Node::p() const':
Progression.cpp:127:40: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
  127 |                         printf(" Node{%d %d %d %d %d}\n", pv, pf, sv, sf, ans);
      |                                       ~^                  ~~
      |                                        |                  |
      |                                        int                long long int
      |                                       %lld
Progression.cpp:127:46: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=]
  127 |                         printf(" Node{%d %d %d %d %d}\n", pv, pf, sv, sf, ans);
      |                                             ~^                    ~~
      |                                              |                    |
      |                                              int                  long long int
      |                                             %lld
Progression.cpp: In function 'int main()':
Progression.cpp:253:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  253 |         scanf("%d%d", &n, &q);
      |         ~~~~~^~~~~~~~~~~~~~~~
Progression.cpp:255:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  255 |                 scanf("%d", &d);
      |                 ~~~~~^~~~~~~~~~
Progression.cpp:264:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  264 |                 scanf("%d%d%d", &op, &l, &r);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Progression.cpp:266:30: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  266 |                         scanf("%d%d", &c, &s);
      |                         ~~~~~^~~~~~~~~~~~~~~~