Submission #762609

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7626092023-06-21 14:42:00goodbyehanbyeolOrganizing the Best Squad (FXCUP4_squad)C++17
0 / 100
25 ms49556 KiB
#include "squad.h"
#include <bits/stdc++.h>
#define mabs(x) ((x)>0?(x):(-x))
using namespace std;
typedef __int128 ll;
ll gcd(ll x, ll y){
if(!y) return x;
return gcd(y, x%y);
}
struct Frac{
ll a, b;
Frac(){}
Frac(ll x){
a=x, b=1;
}
Frac(ll _a, ll _b){
a = _a, b = _b;
if(b<0) a=-a,b=-b;
ll g = gcd(mabs(a), mabs(b));
a /= g, b /= g;
}
Frac operator+(const Frac &r)const{
return Frac(a*r.b+b*r.a, b*r.b);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

squad.cpp: In member function 'std::pair<Frac, int> LineContainer::query(Frac)':
squad.cpp:98:36: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'll' {aka '__int128'} [-Wformat=]
   98 |         printf("Query answer: a %lld b %lld x %lld/%lld -> %lld/%lld (idx %d)\n", it.a, it.b, x.a, x.b,
      |                                 ~~~^                                              ~~~~
      |                                    |                                                 |
      |                                    long long int                                     ll {aka __int128}
squad.cpp:98:43: warning: format '%lld' expects argument of type 'long long int', but argument 3 has type 'll' {aka '__int128'} [-Wformat=]
   98 |         printf("Query answer: a %lld b %lld x %lld/%lld -> %lld/%lld (idx %d)\n", it.a, it.b, x.a, x.b,
      |                                        ~~~^                                             ~~~~
      |                                           |                                                |
      |                                           long long int                                    ll {aka __int128}
squad.cpp:98:50: warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'll' {aka '__int128'} [-Wformat=]
   98 |         printf("Query answer: a %lld b %lld x %lld/%lld -> %lld/%lld (idx %d)\n", it.a, it.b, x.a, x.b,
      |                                               ~~~^                                            ~~~
      |                                                  |                                              |
      |                                                  long long int                                  ll {aka __int128}
squad.cpp:98:55: warning: format '%lld' expects argument of type 'long long int', but argument 5 has type 'll' {aka '__int128'} [-Wformat=]
   98 |         printf("Query answer: a %lld b %lld x %lld/%lld -> %lld/%lld (idx %d)\n", it.a, it.b, x.a, x.b,
      |                                                    ~~~^                                            ~~~
      |                                                       |                                              |
      |                                                       long long int                                  ll {aka __int128}
squad.cpp:98:63: warning: format '%lld' expects argument of type 'long long int', but argument 6 has type 'll' {aka '__int128'} [-Wformat=]
   98 |         printf("Query answer: a %lld b %lld x %lld/%lld -> %lld/%lld (idx %d)\n", it.a, it.b, x.a, x.b,
      |                                                            ~~~^
      |                                                               |
      |                                                               long long int
   99 |                it.get(x).a, it.get(x).b, it.idx);
      |                ~~~~~~~~~~~                                     
      |                          |
      |                          ll {aka __int128}
squad.cpp:98:68: warning: format '%lld' expects argument of type 'long long int', but argument 7 has type 'll' {aka '__int128'} [-Wformat=]
   98 |         printf("Query answer: a %lld b %lld x %lld/%lld -> %lld/%lld (idx %d)\n", it.a, it.b, x.a, x.b,
      |                                                                 ~~~^
      |                                                                    |
      |                                                                    long long int
   99 |                it.get(x).a, it.get(x).b, it.idx);
      |                             ~~~~~~~~~~~                             
      |                                       |
      |                                       ll {aka __int128}
squad.cpp: In member function 'std::pair<Frac, int> segmentTree::query(int, int, int, int, int, Frac)':
squad.cpp:119:14: warning: variable 'p1' set but not used [-Wunused-but-set-variable]
  119 |         auto p1 = query(i*2, l, m, s, e, x), p2 = query(i*2+1, m+1, r, s, e, x);
      |              ^~
squad.cpp:119:46: warning: variable 'p2' set but not used [-Wunused-but-set-variable]
  119 |         auto p1 = query(i*2, l, m, s, e, x), p2 = query(i*2+1, m+1, r, s, e, x);
      |                                              ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...