Submission #56260968
Source Code Expand
using namespace std;
// ライブラリ
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
// 型・メソッド・イテレータ系
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define drep(i, n) for(int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < (t); ++i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define bg begin
#define ed end
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define snuke_san srand((unsigned)clock()+(unsigned)time(NULL));
#define newline puts("")
template<typename T> using vc = vector<T>;
template<typename T> using vv = vc<vc<T>>;
template<typename T> using PQ = priority_queue<T, vc<T>, greater<T>>;
using uint = unsigned; using ll = long long; using ull = unsigned long long; using ld = long double;
using P = pair<int, int>; using lp = pair<ll, ll>; using lt = tuple<ll, ll, ll>;
using vi = vc<int>; using vvi = vv<int>; using vvvi = vv<vi>;
using vl = vc<ll>; using vvl = vv<ll>; using vvvl = vv<vl>;
using vch = vc<char>; using vvch = vv<char>; using vs = vc<string>; using vvs = vc<vs>;
// 入出力系
template<typename Tx, typename Ty>istream& operator>>(istream&i, pair<Tx, Ty>&v){return i>>v.fi>>v.se;}
template<typename Tx, typename Ty>ostream& operator<<(ostream&o, const pair<Tx, Ty>&v){return o<<v.fi<<", "<<v.se;}
template<typename T>istream& operator>>(istream&i, vc<T>&v){rep(j, sz(v))i>>v[j];return i;}
template<typename T>string join(const T&v, const string& d=""){stringstream s;rep(i, sz(v))(i?s<<d:s)<<v[i];return s.str();}
template<typename T>ostream& operator<<(ostream&o, const vc<T>&v){if(sz(v))o<<join(v, " ");return o;}
#define iint(...) int __VA_ARGS__; IN(__VA_ARGS__)
#define ill(...) ll __VA_ARGS__; IN(__VA_ARGS__)
#define ich(...) char __VA_ARGS__; IN(__VA_ARGS__)
#define istr(...) string __VA_ARGS__; IN(__VA_ARGS__)
#define ild(...) ld __VA_ARGS__; IN(__VA_ARGS__)
#define ivc(type, name, size) vector<type> name(size); IN(name)
#define ivc2(type, name1, name2, size) vector<type> name1(size), name2(size); for(int i = 0; i < size; i++) IN(name1[i], name2[i])
#define ivc3(type, name1, name2, name3, size) vector<type> name1(size), name2(size), name3(size); for(int i = 0; i < size; i++) IN(name1[i], name2[i], name3[i])
#define ivc4(type, name1, name2, name3, name4, size) vector<type> name1(size), name2(size), name3(size), name4(size); for(int i = 0; i < size; i++) IN(name1[i], name2[i], name3[i], name4[i]);
#define ivv(type, name, h, w) vector<vector<type>> name(h, vector<type>(w)); IN(name)
void scan(int &a) { cin >> a; } void scan(long long &a) { cin >> a; } void scan(char &a) { cin >> a; } void scan(double &a) { cin >> a; } void scan(string &a) { cin >> a; }
template <typename T> void scan(T &a) { cin >> a; }
template <typename T, typename S> void scan(pair<T, S> &p) { scan(p.first), scan(p.second); }
template <typename T> void scan(vector<T> &a) { for(auto &i : a) scan(i); }
void IN() {} template <typename Head, typename... Tail> void IN(Head &head, Tail &...tail) { scan(head); IN(tail...); }
#define ortn(...) { out(__VA_ARGS__); return 0; }
#define dame { puts("-1"); return 0; }
#define yes { puts("Yes"); return 0; }
#define no { puts("No"); return 0; }
#define yn(ok) { puts(ok ? "Yes" : "No"); }
void out() { cout << '\n'; } template <typename Head, typename... Tail> void out(const Head &head, const Tail &...tail) { cout << head; if(sizeof...(tail)) cout << ' '; out(tail...); }
// 数値系
template<typename T> int lbs(vector<T> &a, const T &b) { return lower_bound(all(a), b) - a.begin(); };
template<typename T> int ubs(vector<T> &a, const T &b) { return upper_bound(all(a), b) - a.begin(); };
template<typename Tx, typename Ty> Tx ceil(Tx x, Ty y) {assert(y);return (y<0 ? ceil(-x,-y) : (x>0 ? (x+y-1)/y : x/y));}
template<typename Tx, typename Ty> Tx floor(Tx x, Ty y) {assert(y);return (y<0 ? floor(-x,-y) : (x>0 ? x/y : (x-y+1)/y));}
template<typename T> ll sumof(const vc<T>&a){ll res(0);for(auto&&x:a)res+=x;return res;}
template<typename T> ll sumof(const vv<T>&a){ll res(0);for(auto&&x:a)res+=sumof(x);return res;}
template<typename T> vc<T> csum(vc<T> &a) { vc<T> res(a.size() + 1, 0); rep(i, a.size()) res[i + 1] = res[i] + a[i]; return res; }
template<typename T> void prepend(vc<T>&a, const T&x){a.insert(a.bg(), x);}
// 操作系
template<typename Tx, typename Ty> void operator--(pair<Tx, Ty>&a, int){a.fi--;a.se--;}
template<typename Tx, typename Ty> void operator++(pair<Tx, Ty>&a, int){a.fi++;a.se++;}
template<typename T> void operator--(vc<T>&a, int){for(T&x:a)x--;}
template<typename T> void operator++(vc<T>&a, int){for(T&x:a)x++;}
template<typename T> void operator+=(vc<T>&a, T b){for(T&x:a)x+=b;}
template<typename T> void operator-=(vc<T>&a, T b){for(T&x:a)x-=b;}
template<typename T> void operator*=(vc<T>&a, T b){for(T&x:a)x*=b;}
template<typename T> void operator/=(vc<T>&a, T b){for(T&x:a)x/=b;}
template<typename T> void operator+=(vc<T>&a, const vc<T>&b){a.insert(a.ed(), all(b));}
template<typename Tx, typename Ty> bool chmin(Tx& x, const Ty&y){if(y<x){x=y;return true;}else return false;}
template<typename Tx, typename Ty> bool chmax(Tx& x, const Ty&y){if(x<y){x=y;return true;}else return false;}
template<typename T> void uni(T&a){sort(all(a));a.erase(unique(all(a)), a.ed());}
template<typename T> void cc(vc<T>&a){vc<T> b=a;uni(b);rep(i, a.size())a[i]=lbs(b, a[i]);}
template<typename T = ll> pair<unordered_map<ll, ll>, unordered_map<ll, ll>> ccmp(vector<T> &a) { vector<T> ca = a; cc(ca); unordered_map<ll, ll> res, rev; rep(i, ca.size()) { res[a[i]] = ca[i]; rev[ca[i]] = a[i]; } return make_pair(res, rev); }
template<typename T> vc<pair<T, int>> RLE(const vc<T> &v) { vc<pair<T, int>> res; for(auto &e : v) if(res.empty() or res.back().first != e) res.emplace_back(e, 1); else res.back().second++; return res; }
template<typename T> void rotate(vv<T> &a) { ll n = a.size(), m = a[0].size(); vv<T> res(m, vc<T>(n, 0)); rep(i, n) rep(j, m) res[j][n - 1 - i] = a[i][j]; a = res; }
vi pm(int n, int s=0) {vi a(n); iota(all(a), s); return a;}
// よく使う値
const int INF = 1001001001;
const ll INFL = 1001002003004005006ll;
const ld EPS = 1e-10;
const int dx[8] = {0, -1, 0, 1, 1, -1, -1, 1};
const int dy[8] = {-1, 0, 1, 0, 1, -1, 1, -1};
template<int MOD> struct Fp {
ll val;
constexpr Fp(ll v = 0) noexcept : val(v % MOD) { if (val < 0) val += MOD; } constexpr int getmod() const { return(MOD); }
constexpr Fp operator - () const noexcept { return (val ? MOD - val : 0); }
constexpr Fp operator + (const Fp& r) const noexcept { return (Fp(*this) += r); }
constexpr Fp operator - (const Fp& r) const noexcept { return (Fp(*this) -= r); }
constexpr Fp operator * (const Fp& r) const noexcept { return (Fp(*this) *= r); }
constexpr Fp operator / (const Fp& r) const noexcept { return (Fp(*this) /= r); }
constexpr Fp& operator += (const Fp& r) noexcept { val += r.val; if (val >= MOD) val -= MOD; return (*this); }
constexpr Fp& operator -= (const Fp& r) noexcept { val -= r.val; if (val < 0) val += MOD; return (*this); }
constexpr Fp& operator *= (const Fp& r) noexcept { val = val * r.val % MOD; return (*this); }
constexpr Fp& operator /= (const Fp& r) noexcept { ll a = r.val, b = MOD, u = 1, v = 0;
while (b) { ll t = a / b; a -= t * b, swap(a, b); u -= t * v, swap(u, v); } val = val * u % MOD; if (val < 0) val += MOD; return (*this); }
constexpr bool operator == (const Fp& r) const noexcept { return (this->val == r.val); }
constexpr bool operator != (const Fp& r) const noexcept { return (this->val != r.val); }
friend constexpr istream& operator >> (istream& is, Fp<MOD>& x) noexcept { is >> x.val; x.val %= MOD; if (x.val < 0) x.val += MOD; return (is); }
friend constexpr ostream& operator << (ostream& os, const Fp<MOD>& x) noexcept { return (os << x.val); }
friend constexpr Fp<MOD> modpow(const Fp<MOD>& r, ll n) noexcept { if (n == 0) return (1); if (n < 0) return (modpow(modinv(r), -n));
auto t = modpow(r, n / 2); t = t * t; if (n & 1) t = t * r; return (t); }
friend constexpr Fp<MOD> modinv(const Fp<MOD>& r) noexcept { ll a = r.val, b = MOD, u = 1, v = 0;
while (b) { ll t = a / b; a -= t * b, swap(a, b); u -= t * v, swap(u, v); } return (Fp<MOD>(u)); }
};
const int MOD = 998244353;
using mint = Fp<MOD>; using vmi = vc<mint>; using vvmi = vc<vmi>; using vvvmi = vv<vmi>;
int main() {
iint(y);
if (y % 4 != 0) {
cout << 365 << endl;
}
else if (y % 100 != 0) {
cout << 366 << endl;
}
else if (y % 400 != 0) {
cout << 365 << endl;
}
else {
cout << 366 << endl;
}
return 0;
}
Submission Info
| Submission Time |
|
| Task |
A - Leap Year |
| User |
Chomusuke |
| Language |
C++ 23 (gcc 12.2) |
| Score |
100 |
| Code Size |
10333 Byte |
| Status |
AC |
| Exec Time |
1 ms |
| Memory |
3644 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
100 / 100 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt |
| All |
00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_01.txt |
AC |
1 ms |
3572 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3644 KiB |
| 00_sample_03.txt |
AC |
1 ms |
3492 KiB |
| 00_sample_04.txt |
AC |
1 ms |
3572 KiB |
| 01_test_01.txt |
AC |
1 ms |
3492 KiB |
| 01_test_02.txt |
AC |
1 ms |
3492 KiB |
| 01_test_03.txt |
AC |
1 ms |
3456 KiB |
| 01_test_04.txt |
AC |
1 ms |
3512 KiB |
| 01_test_05.txt |
AC |
1 ms |
3572 KiB |
| 01_test_06.txt |
AC |
1 ms |
3492 KiB |
| 01_test_07.txt |
AC |
1 ms |
3432 KiB |
| 01_test_08.txt |
AC |
1 ms |
3464 KiB |
| 01_test_09.txt |
AC |
1 ms |
3488 KiB |
| 01_test_10.txt |
AC |
1 ms |
3436 KiB |