結果

問題 No.2789 hako111223’s Master Thesis
ユーザー syun0713syun0713
提出日時 2024-06-21 21:22:59
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 7,249 bytes
コンパイル時間 2,303 ms
コンパイル使用メモリ 221,480 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-21 21:23:03
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:56:21: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   56 | void ain(set<T>& Y, auto n) {
      |                     ^~~~
main.cpp:63:26: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   63 | void ain(multiset<T>& Y, auto n) {
      |                          ^~~~

ソースコード

diff #
プレゼンテーションモードにする

#include<bits/stdc++.h>
using namespace std;
template<typename T>
using vec = vector<T>;
using ll = long long;
using ull = unsigned long long;
using vi = vec<int>;
using vs = vec<string>;
using si = set<int>;
using sll = set<ll>;
using vc = vec<char>;
using vvi = vec<vi>;
using vll = vec<ll>;
using vvll = vec<vll>;
using vsi = vec<si>;
using vsll = vec<sll>;
using vd = vec<double>;
using vvd = vec<vd>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using msi = map<string, int>;
using vpii = vec<pii>;
using vpll = vec<pll>;
using spii = set<pii>;
using spll = set<pll>;
using vb = vector<bool>;
using vvb = vector<vb>;
#define rep(i,j,n) for(ll i=j;i<n;i++)
#define rrep(i,j,n) for (ll i = n-1; i >=j; i--)
#define rp(i,n) rep(i,0,n)
#define rrp(i,n) rrep(i,0,n)
#define all(v) v.begin(), v.end()
#define pb push_back
#define ins insert
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define yn(jg) cout<<(jg? "Yes":"No")<<endl;
#define NL {cout<<endl;}
#define n0 {cout<<"-1"<<endl;}
#define lwb lower_bound
#define upb upper_bound
#define sz size()
#define fi first
#define se second
#define nxp next_permutation
ll mod0 = 998244353, lmax = 2e18, inf = 2e9;
double pi = 3.141592653589793238462643;
vll vh = { 998244353, 998244853, 1000000007, 1000000009, 1012924417 };
template<typename... T>
void in(T&... X) { (cin >> ... >> X); }
template<typename T>
void ain(vec<T>& Y) { rp(K, Y.size()) cin >> Y[K]; }
template<typename T>
void ain(set<T>& Y, auto n) {
rp(i, n) {
T YY; cin >> YY;
Y.insert(YY);
}
}
template<typename T>
void ain(multiset<T>& Y, auto n) {
rp(i, n) {
T YY; cin >> YY;
Y.insert(YY);
}
}
template<typename T>
void bin(vec<vec<T>>& Z) { rp(L, Z.size()) ain(Z[L]); }
template<typename T>
void aout(T& a) { for (auto I : a) cout << I << " "; cout << endl; }
void aout(pii a) { cout << a.fi << " " << a.se << endl; }
void aout(pll a) { cout << a.fi << " " << a.se << endl; }
template<typename T>
void aout(queue<T> a) {
while (!a.empty()) { cout << a.front(); a.pop(); }
}
template<typename T>
void aout(stack<T> a) {
while (!a.empty()) { cout << a.top(); a.pop(); }
}
#define bout(a) {for(auto J:a) aout(J);}
template<typename T>
bool chmin(T& M1, T M2) {
if (M1 > M2) { M1 = M2; return 1; }
else return 0;
}
template<typename T>
bool chmax(T& M1, T M2) {
if (M1 < M2) { M1 = M2; return 1; }
else return 0;
}
template<typename T>
auto vmax(T& a) {
return *max_element(all(a));
}
template<typename T>
auto vmin(T& a) {
return *min_element(all(a));
}
vector<pair<char, ll>> rle(string rr) {
vector<pair<char, ll>> ret;
char lc;
rep(i, 0, rr.size()) {
if (i > 0 && rr[i] == lc) ret[ret.sz - 1].second++;
else { ret.pb({ rr[i],1 }); }
lc = rr[i];
}
return ret;
}
vector<pair<int, ll>> rle(vi rr) {
vector<pair<int, ll>> ret;
int lc;
rep(i, 0, rr.size()) {
if (i > 0 && rr[i] == lc) ret[ret.sz - 1].second++;
else { ret.pb({ rr[i],1 }); }
lc = rr[i];
}
return ret;
}
vector<pair<ll, ll>> rle(vll rr) {
vector<pair<ll, ll>> ret;
ll lc;
rep(i, 0, rr.size()) {
if (i > 0 && rr[i] == lc) ret[ret.sz - 1].second++;
else { ret.pb({ rr[i],1 }); }
lc = rr[i];
}
return ret;
}
template<typename T>
auto lwa(vector<T>& a, T b) {//ab()
auto i = lwb(all(a), b);
if (i == a.begin()) return a.end();
else i--;
return i;
}
template<typename T>
auto lwa(set<T>& a, T b) {//ab
auto i = a.lwb(b);
if (i == a.begin()) return a.end();
else i--;
return i;
}
template<typename T>
auto lwa(multiset<T>& a, T b) {//ab
auto i = a.lwb(b);
if (i == a.begin()) return a.end();
else i--;
return i;
}
template<typename T>
auto lwc(vector<T>& a, T b) {//ab()
auto i = lwb(all(a), b);
if (i != a.end() && *i == b) return i;
if (i == a.begin()) return a.end();
else i--;
return i;
}
template<typename T>
auto lwc(set<T>& a, T b) {//ab
auto i = a.lwb(b);
if (i != a.end() && *i == b) return i;
if (i == a.begin()) return a.end();
else i--;
return i;
}
template<typename T>
auto lwc(multiset<T>& a, T b) {//ab
auto i = a.lwb(b);
if (i != a.end() && *i == b) return i;
if (i == a.begin()) return a.end();
else i--;
return i;
}
template<typename T>
vec<T> rsw(vec<T>& a) {//
vec<T> b = a;
rep(i, 1, b.size()) b[i] += b[i - 1];
return b;
}
bool kai(string S) {//
bool ans = 1;
rp(i, S.size()) if (S[i] != S[S.size() - 1 - i]) ans = 0;
return ans;
}
sll yk(ll n) {//O(sqrt(N)),set<int>
sll yaku;
for (ll i = 1; i * i <= n; i++) if (n % i == 0) {
yaku.insert(i);
yaku.insert(n / i);
}
return yaku;
}
vi ssa(int n) {//n:
vector<int> prime;
vector<int>lpf(n + 1, 0);
rep(i, 2, n + 1) {
if (lpf[i] == 0) {
lpf[i] = i;
prime.push_back(i);
}
for (int k : prime) {
if (k * i > n || k > lpf[i]) break;//kk<=i
lpf[k * i] = k;//kk*i
}
}
return prime;
}
vector<pll> sib(ll x) {//
if (x == 1) return vector<pll>(1, { 1,1 });
vector<pll> ans;
for (ll i = 2; i * i <= x; i++) {//rootxix
ll kaisu = 0;
while (x % i == 0) {
x /= i; kaisu++;
}
if (kaisu > 0) ans.pb({ i,kaisu });
}
if (x != 1) ans.pb({ x,1 });
return ans;
}
template<typename T>
vec<T> zat(vec<T> a) {//
auto b = a;
sort(all(b));
b.erase(unique(all(b)), b.end());
vec<T> c(a.size());
rp(i, a.size()) {
c[i] = lwb(all(b), a[i]) - b.begin();
}
return c;
}
template<typename T>
void cp(map < T, ll >& a, T b, ll c) {//countplus
if (a.find(b) == a.end()) a[b] = c;
else a[b] += c;
if (a[b] == 0) a.erase(b);
}
template<typename T>
vec<T> inv(vec<T> a) {//0-indexed
vec<T> ans(a.sz);
rp(i, a.sz) {
ans[a[i]] = i;
}
return ans;
}
vll hs(string s) {//hash
vll r = { 0,0,0,0,0 };
rp(i, 5) {
rp(j, s.sz) {
r[i] *= 27;
r[i] += (s[j] - 'a' + 1);
r[i] %= vh[i];
}
}
return r;
}
vll hsp(ll n) {//hashpow
vll r = { 1,1,1,1,1 };
rp(i, 5) {
rp(j, n) {
r[i] *= 27;
r[i] %= vh[i];
}
}
return r;
}
//lazy_segtree<S, op, e, F, mapping, composition, id> seg(n);
//S: op: e:
//F: mapping: composition:( f(g()) ) id:()
/*
using S = double;
using F = int;
S op(S a,S b) {
return min(a, b);
}
S e() {
return lmax;
}
S mapping(F x, S a) {//xa(x)
if (x != 0)return x;
else return a;
}
F composition(F f, F g) {//f(f)
if (f != 0)return f;
else return g;
}
F id() {return 0;}*/
//cout<<setprecision(15)<<fixed<<
//function<(1, 2, ...)> = [&](1 1, 2, 2, ...)
int main() {
int a, b, c, d; cin >> a >> b >> c >> d;
a = 31 - a + b;
if (a >= c) cout << 1;
else if (a >= d) cout << 2;
else cout << 3;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0