結果
問題 | No.487 2017 Calculation(2017の計算) |
ユーザー |
![]() |
提出日時 | 2017-04-06 02:08:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,174 bytes |
コンパイル時間 | 1,517 ms |
コンパイル使用メモリ | 164,956 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 11:08:56 |
合計ジャッジ時間 | 1,867 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)#define rep(i, n) FOR(i, 0, n)#define rep1(i, n) FOR(i, 1, int(n) + 1)#define rrep(i, n) RFOR(i, 0, n)#define rrep1(i, n) RFOR(i, 1, int(n) + 1)#define all(c) begin(c), end(c)const int MOD = 1000000007;template <typename T>void __dump__(std::ostream &os, const T &first) {os << first;}template <typename First, typename... Rest>void __dump__(std::ostream &os, const First &first, const Rest &... rest) {os << first << ", ";__dump__(os, rest...);}#define dump(...) \do { \std::ostringstream os; \os << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; \__dump__(os, __VA_ARGS__); \std::cerr << os.str() << std::endl; \} while (0)int main() {int m;cin >> m;int x = 1;rep(i, 2017*2) x *= 2017, x %= m;x += 2017, x %= m;cout << x << endl;}