結果
| 問題 |
No.8045 怪文書
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-01 22:32:26 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 791 bytes |
| コンパイル時間 | 1,340 ms |
| コンパイル使用メモリ | 166,320 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-11-27 03:28:42 |
| 合計ジャッジ時間 | 23,367 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 TLE * 7 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define dom 998244353
#define all(c) begin(c),end(c)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template <typename T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }
#define long long long
#define List vector
#define var auto
#define Count size()
#define Length size()
int dd[] = { 0, 1, 0, -1, 0 }; //→↓←↑
void solve()
{
long N, M;
cin >> N >> M;
long ans = 1;
for (int i = 1; i <= N; i++)
{
ans = ans * i % M;
}
cout << ans << endl;
}
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
solve();
return 0;
}