제출 #432734

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4327342021-06-18 12:56:08Kevin_Zhang_TW말 (IOI15_horses)C++17
100 / 100
287 ms60808 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb emplace_back
#define AI(i) begin(i), end(i)
template<class T> bool chmin(T &a, T b) { return b < a && (a = b, true); }
template<class T> bool chmax(T &a, T b) { return a < b && (a = b, true); }
#ifdef KEV
#define DE(args...) kout("[ " + string(#args) + " ] = ", args)
void kout() { cerr << endl; }
template<class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ', kout(b...); }
template<class T> void debug(T l, T r) { while (l != r) cerr << *l << " \n"[next(l)==r], ++l; }
#else
#define DE(...) 0
#define debug(...) 0
#endif
#include "horses.h"
const int MAX_N = 500010, p = 1e9 + 7;
const ll inf = p;
//ll dp[MAX_N], mdp[MAX_N];
int sx[MAX_N], sy[MAX_N], n;
struct dint {
ll val, mod_val;
dint (ll a, ll b) : val(a), mod_val(b) {}
dint () : val(0), mod_val(0) {}
#define fastop(op) dint &operator op (const dint &b) { val = min(inf, (val op b.val)), mod_val = val op b.val % p; return *this; }
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

horses.cpp: In member function 'dint& dint::operator*=(const dint&)':
horses.cpp:30:60: warning: operation on '((dint*)this)->dint::val' may be undefined [-Wsequence-point]
   30 | #define fastop(op) dint &operator op (const dint &b) { val = min(inf, (val op b.val)), mod_val = val op b.val % p; return *this; }
      |                                                        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
horses.cpp:31:2: note: in expansion of macro 'fastop'
   31 |  fastop(*=);
      |  ^~~~~~
horses.cpp: In member function 'dint& dint::operator+=(const dint&)':
horses.cpp:30:60: warning: operation on '((dint*)this)->dint::val' may be undefined [-Wsequence-point]
   30 | #define fastop(op) dint &operator op (const dint &b) { val = min(inf, (val op b.val)), mod_val = val op b.val % p; return *this; }
      |                                                        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
horses.cpp:32:2: note: in expansion of macro 'fastop'
   32 |  fastop(+=);
      |  ^~~~~~
horses.cpp: In function 'int qry(int, int)':
horses.cpp:93:25: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   93 |  return node(lv, rv).get();
      |         ~~~~~~~~~~~~~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:108:26: warning: declaration of 'val' shadows a global declaration [-Wshadow]
  108 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp:78:6: note: shadowed declaration is here
   78 | node val[MAX_N << 1];
      |      ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:118:26: warning: declaration of 'val' shadows a global declaration [-Wshadow]
  118 | int updateY(int pos, int val) {
      |                      ~~~~^~~
horses.cpp:78:6: note: shadowed declaration is here
   78 | node val[MAX_N << 1];
      |      ^~~
#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...