็ตๆ
ๅ้ก | No.8077 ๐ง |
ใฆใผใถใผ |
|
ๆๅบๆฅๆ | 2022-04-01 20:53:20 |
่จ่ช | C++14 (gcc 13.3.0 + boost 1.87.0) |
็ตๆ |
AC
|
ๅฎ่กๆ้ | 2 ms / 2,000 ms |
ใณใผใ้ท | 5,244 bytes |
ใณใณใใคใซๆ้ | 4,039 ms |
ใณใณใใคใซไฝฟ็จใกใขใช | 229,032 KB |
ๅฎ่กไฝฟ็จใกใขใช | 5,248 KB |
ๆ็ตใธใฃใใธๆฅๆ | 2024-11-20 07:15:54 |
ๅ่จใธใฃใใธๆ้ | 4,508 ms |
ใธใฃใใธใตใผใใผID ๏ผๅ่ๆ ๅ ฑ๏ผ |
judge2 / judge4 |
๏ผ่ฆใญใฐใคใณ๏ผ
ใใกใคใซใใฟใผใณ | ็ตๆ |
---|---|
sample | AC * 3 |
other | AC * 10 |
ใฝใผในใณใผใ
#ifndef HIDDEN_IN_VISUAL_STUDIO // ๆใใใใฟ็จ// ่ญฆๅใฎๆๅถ#define _CRT_SECURE_NO_WARNINGS// ใฉใคใใฉใชใฎ่ชญใฟ่พผใฟ#include <bits/stdc++.h>using namespace std;// ๅๅใฎ็ญ็ธฎusing ll = long long; // -2^63 ๏ฝ 2^63 = 9 * 10^18๏ผint ใฏ -2^31 ๏ฝ 2^31 = 2 * 10^9๏ผusing pii = pair<int, int>; using pll = pair<ll, ll>; using pil = pair<int, ll>; using pli = pair<ll, int>;using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;using vl = vector<ll>; using vvl = vector<vl>; using vvvl = vector<vvl>;using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;using vc = vector<char>; using vvc = vector<vc>; using vvvc = vector<vvc>;using vd = vector<double>; using vvd = vector<vd>; using vvvd = vector<vvd>;template <class T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;using Graph = vvi;// ๅฎๆฐใฎๅฎ็พฉconst double PI = acos(-1);const vi dx4 = { 1, 0, -1, 0 }; // 4 ่ฟๅ๏ผไธ๏ผๅณ๏ผไธ๏ผๅทฆ๏ผconst vi dy4 = { 0, 1, 0, -1 };const vi dx8 = { 1, 1, 0, -1, -1, -1, 0, 1 }; // 8 ่ฟๅconst vi dy8 = { 0, 1, 1, 1, 0, -1, -1, -1 };const int INF = 1001001001; const ll INFL = 4004004004004004004LL;const double EPS = 1e-12; // ่จฑๅฎน่ชคๅทฎใซๅฟใใฆ่ชฟๆด// ๅ ฅๅบๅ้ซ้ๅstruct fast_io { fast_io() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } fastIOtmp;// ๆฑ็จใใฏใญใฎๅฎ็พฉ#define all(a) (a).begin(), (a).end()#define sz(x) ((int)(x).size())#define distance (int)distance#define Yes(b) {cout << ((b) ? "Yes\n" : "No\n");}#define rep(i, n) for(int i = 0, i##_len = int(n); i < i##_len; ++i) // 0 ใใ n-1 ใพใงๆ้ #define repi(i, s, t) for(int i = int(s), i##_end = int(t); i <= i##_end; ++i) // s ใใ t ใพใงๆ้ #define repir(i, s, t) for(int i = int(s), i##_end = int(t); i >= i##_end; --i) // s ใใ t ใพใง้้ #define repe(v, a) for(const auto& v : (a)) // a ใฎๅ จ่ฆ็ด ๏ผๅคๆดไธๅฏ่ฝ๏ผ#define repea(v, a) for(auto& v : (a)) // a ใฎๅ จ่ฆ็ด ๏ผๅคๆดๅฏ่ฝ๏ผ#define repb(set, d) for(int set = 0; set < (1 << int(d)); ++set) // d ใใใๅ จๆข็ดข๏ผๆ้ ๏ผ#define repp(a) sort(all(a)); for(bool a##_perm = true; a##_perm; a##_perm = next_permutation(all(a))) // a ใฎ้ ๅๅ จใฆ๏ผๆ้ ๏ผ#define smod(n, m) ((((n) % (m)) + (m)) % (m)) // ้่ฒ mod#define uniq(a) {sort(all(a)); (a).erase(unique(all(a)), (a).end());} // ้่ค้คๅป#define EXIT(a) {cout << (a) << endl; exit(0);} // ๅผทๅถ็ตไบ// ๆฑ็จ้ขๆฐใฎๅฎ็พฉtemplate <class T> inline ll pow(T n, int k) { ll v = 1; rep(i, k) v *= n; return v; }template <class T> inline bool chmax(T& M, const T& x) { if (M < x) { M = x; return true; } return false; } // ๆๅคงๅคใๆดๆฐ๏ผๆดๆฐใใใใ trueใ่ฟใ๏ผtemplate <class T> inline bool chmin(T& m, const T& x) { if (m > x) { m = x; return true; } return false; } // ๆๅฐๅคใๆดๆฐ๏ผๆดๆฐใใใใ trueใ่ฟใ๏ผ// ๆผ็ฎๅญใชใผใใผใญใผใtemplate <class T, class U> inline istream& operator>> (istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }template <class T> inline istream& operator>> (istream& is, vector<T>& v) { repea(x, v) is >> x; return is; }template <class T> inline vector<T>& operator--(vector<T>& v) { repea(x, v) --x; return v; }template <class T> inline vector<T>& operator++(vector<T>& v) { repea(x, v) ++x; return v; }// ๆๅ ็ฐๅข๏ผVisual Studio๏ผ#ifdef _MSC_VER#define popcount (int)__popcnt // ๅ จใใใไธญใฎ 1 ใฎๅๆฐ#define popcountll (int)__popcnt64inline int lsb(unsigned int n) { unsigned long i; _BitScanForward(&i, n); return i; } // ๆไธไฝใใใใฎไฝ็ฝฎ๏ผ0-indexed๏ผinline int lsbll(unsigned long long n) { unsigned long i; _BitScanForward64(&i, n); return i; }inline int msb(unsigned int n) { unsigned long i; _BitScanReverse(&i, n); return i; } // ๆไธไฝใใใใฎไฝ็ฝฎ๏ผ0-indexed๏ผinline int msbll(unsigned long long n) { unsigned long i; _BitScanReverse64(&i, n); return i; }template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }// ๆๅบ็จ๏ผgcc๏ผ#else#define popcount (int)__builtin_popcount#define popcountll (int)__builtin_popcountll#define lsb __builtin_ctz#define lsbll __builtin_ctzll#define msb(n) (31 - __builtin_clz(n))#define msbll(n) (63 - __builtin_clzll(n))#define gcd __gcd#endif// ใใใใฐ็จ#ifdef _MSC_VER#include "debug.hpp"#else#define dump(...)#define dumpel(v)#define input_from_file(f)#define output_to_file(f)#endif#endif // ๆใใใใฟ็จ//-----------------AtCoder ๅฐ็จ-----------------#include <atcoder/all>using namespace atcoder;using mint = modint1000000007;//using mint = modint998244353;//using mint = modint; // mint::set_mod(m);istream& operator>> (istream& is, mint& x) { ll x_; is >> x_; x = x_; return is; }ostream& operator<< (ostream& os, const mint& x) { os << x.val(); return os; }using vm = vector<mint>; using vvm = vector<vm>; using vvvm = vector<vvm>;//----------------------------------------------int main() {// input_from_file("input.txt");// output_to_file("output.txt");ll a, b, c, d, k;cin >> a >> b >> c >> d >> k;cout << (a * b + c - d) % k << endl;}