This documentation is automatically generated by online-judge-tools/verification-helper
#include "template/parsing_template.hpp"
構文解析をする際のテンプレート
現在見ている文字がexpectedと一致しているかを返す。
現在見ている文字がexpectedであるとして一文字進める。一致していない場合、assert
で落ちる。
c
が数値であるかを返す。
c
が大文字アルファベットかを返す。
c
が小文字アルファベットかを返す。
#pragma once
#include "../template/template.hpp"
namespace lib {
typedef std::string::const_iterator State;
bool expect(State &begin, char expected) {
return *begin == expected;
}
void consume(State &begin, char expected) {
assert(*begin == expected);
begin++;
}
bool isdigit(char c) {
return '0' <= c && c <= '9';
}
bool isAlpha(char c) {
return 'A' <= c && c <= 'Z';
}
bool isalpha(char c) {
return 'a' <= c && c <= 'z';
}
} // namespace lib
#line 2 "template/parsing_template.hpp"
#line 2 "template/template.hpp"
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--)
#define all(v) v.begin(), v.end()
using ll = long long;
using ld = long double;
using ull = unsigned long long;
template <typename T> bool chmin(T &a, const T &b) {
if (a <= b) return false;
a = b;
return true;
}
template <typename T> bool chmax(T &a, const T &b) {
if (a >= b) return false;
a = b;
return true;
}
namespace lib {
using namespace std;
} // namespace lib
// using namespace lib;
#line 4 "template/parsing_template.hpp"
namespace lib {
typedef std::string::const_iterator State;
bool expect(State &begin, char expected) {
return *begin == expected;
}
void consume(State &begin, char expected) {
assert(*begin == expected);
begin++;
}
bool isdigit(char c) {
return '0' <= c && c <= '9';
}
bool isAlpha(char c) {
return 'A' <= c && c <= 'Z';
}
bool isalpha(char c) {
return 'a' <= c && c <= 'z';
}
} // namespace lib