結果
| 問題 |
No.2297 Best Grouping
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-13 20:07:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 3,291 bytes |
| コンパイル時間 | 4,064 ms |
| コンパイル使用メモリ | 254,820 KB |
| 最終ジャッジ日時 | 2025-02-13 00:09:44 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
//定数倍高速化
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast;
using mint=modint998244353;
using ll=long long;
using uint=unsigned int;
using ull=unsigned long long;
using ld=long double;
using vec=vector<ll>;
using mat=vector<vec>;
using graph=vector<vector<pair<ll, ll> > >;
#define OVERLOAD_REP(_1, _2, _3, name, ...) name
#define REP1(i, n) for (auto i = std::decay_t<decltype(n)>{}; (i) != (n); ++(i))
#define REP2(i, l, r) for (auto i = (l); (i) != (r); ++(i))
#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__)
#define repd(i,l,r) for (int i=(int)(l); i>=r; i--)
#define exit_with(...) ({ __VA_ARGS__; exit(0); })
#define break_with(...) ({ __VA_ARGS__; break; })
#define continue_with(...) ({ __VA_ARGS__; continue; })
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define bs(v, k) (binary_search(all(v),(k)))
#define lbs(v, k) (lower_bound(all(v),(k))-v.begin())
#define ubs(v, k) (upper_bound(all(v),(k))-v.begin())
#define app emplace_back
#define del pop_back
//入出力
#define YESNO(bool) bool?cout<<"YES"<<endl:cout<<"NO"<<endl;
#define yesno(bool) bool?cout<<"yes"<<endl:cout<<"no"<<endl;
#define YesNo(bool) bool?cout<<"Yes"<<endl:cout<<"No"<<endl;
#define coutvec(v) \
rep(bakatan,0,(int)v.size()) cout<<v[bakatan]<<endl;
template<typename T>
istream& operator>>(istream& is,vector<T>& v) {
for (T &in:v) is>>in; return is;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T>& v) {
for (int i=0;i<(int)v.size();i++) {
out<<v[i]<<(i+1!=(int)v.size()?" ":"");
}
return out;
}
template<typename T>
istream& operator>>(istream& is,vector<vector<T>>& v) {
for (auto &x:v) for (T &in:x) is>>in; return is;
}
template<typename T>
ostream& operator<<(ostream& out,vector<vector<T>>& v) {
for (int i=0;i<(int)v.size();i++) {
for (int j=0;j<(int)v[i].size();j++) {
out<<v[i][j]<<(j+1!=(int)v[i].size()?" ":"");
}
out<<(i+1!=(int)v.size()?"\n":"");
}
return out;
}
ostream& operator<<(ostream& out,mint& N) {
out<<N.val(); return out;
}
template<class T, size_t n, size_t idx = 0>
auto make_vec(const size_t (&d)[n], const T& init) noexcept {
if constexpr (idx < n) return std::vector(d[idx], make_vec<T, n, idx + 1>(d, init));
else return init;
}
template<class T, size_t n>
auto make_vec(const size_t (&d)[n]) noexcept {
return make_vec(d, T{});
}
template<typename T>
inline void chmax(T& a,const T& b) {if (a<b) a=b;}
template<typename T>
inline void chmin(T& a,const T& b) {if (a>b) a=b;}
template<typename T>
inline vector<T> set_to_vec(set<T>& S) {
set<T> s=S; vector<T> res;
while (!s.empty()) {res.emplace_back(*s.begin()); s.erase(*begin(s));}
return res;
}
constexpr ll INF=1e17;
constexpr int mod1=998244353;
constexpr int mod2=1e9+7;
constexpr ld esp=1e-6;
signed main() {
cout<<fixed<<setprecision(10);
srand(time(NULL));
ll N; cin>>N;
cout<<(3-N%3)%3<<endl;
}