Submission #1099976

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10999762024-10-12 10:03:58cpptowinFood Court (JOI21_foodcourt)C++17
0 / 100
406 ms117332 KiB
#include <bits/stdc++.h>
#define fo(i, d, c) for (int i = d; i <= c; i++)
#define fod(i, c, d) for (int i = c; i >= d; i--)
#define maxn 1000010
#define N 1010
#define fi first
#define se second
#define pb emplace_back
#define en cout << "\n";
#define int long long
#define inf (int)1e18
#define bitcount(x) __builtin_popcountll(x)
#define pii pair<int, int>
#define vii vector<pii>
#define lb(x) x & -x
#define bit(i, j) ((i >> j) & 1)
#define offbit(i, j) (i ^ (1LL << j))
#define onbit(i, j) (i | (1LL << j))
#define vi vector<int>
#define all(x) x.begin(), x.end()
#define ss(x) (int)x.size()
template <typename T1, typename T2>
bool minimize(T1 &a, T2 b)
{
if (a > b)
{
a = b;
return true;
}
return false;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

foodcourt.cpp: In member function 'void SegmentTree::down(long long int, long long int, long long int)':
foodcourt.cpp:108:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  108 |         int mid = l + r >> 1;
      |                   ~~^~~
foodcourt.cpp: In member function 'long long int SegmentTree::walkright(long long int, long long int, long long int, long long int, long long int)':
foodcourt.cpp:151:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  151 |         int mid = l + r >> 1;
      |                   ~~^~~
foodcourt.cpp:152:13: warning: unused variable 'ans' [-Wunused-variable]
  152 |         int ans = -1;
      |             ^~~
foodcourt.cpp: In member function 'long long int SegmentTree::walkleft(long long int, long long int, long long int, long long int, long long int)':
foodcourt.cpp:166:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  166 |         int mid = l + r >> 1;
      |                   ~~^~~
foodcourt.cpp:167:13: warning: unused variable 'ans' [-Wunused-variable]
  167 |         int ans = -1;
      |             ^~~
foodcourt.cpp: In function 'void build(long long int, long long int, long long int)':
foodcourt.cpp:198:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  198 |     int mid = l + r >> 1;
      |               ~~^~~
foodcourt.cpp: At global scope:
foodcourt.cpp:247:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  247 | main()
      | ^~~~
foodcourt.cpp: In function 'int main()':
foodcourt.cpp:296:13: warning: unused variable 'val' [-Wunused-variable]
  296 |         int val = 0;
      |             ^~~
foodcourt.cpp: In instantiation of 'Fenwick_Tree<T>::Fenwick_Tree(long long int) [with T = long long int]':
foodcourt.cpp:245:27:   required from here
foodcourt.cpp:49:9: warning: 'Fenwick_Tree<long long int>::n' will be initialized after [-Wreorder]
   49 |     int n;
      |         ^
foodcourt.cpp:48:15: warning:   'std::vector<long long int> Fenwick_Tree<long long int>::bit_add' [-Wreorder]
   48 |     vector<T> bit_add, bit_sub;
      |               ^~~~~~~
foodcourt.cpp:51:5: warning:   when initialized here [-Wreorder]
   51 |     Fenwick_Tree(int n = 0) : n(n), bit_add(n + 1), bit_sub(n + 1) {}
      |     ^~~~~~~~~~~~
foodcourt.cpp:252:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  252 |         freopen(name ".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:253:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  253 |         freopen(name ".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...