結果
問題 |
No.2269 eN!の整数部分の下1桁
|
ユーザー |
|
提出日時 | 2023-04-14 22:03:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 416 bytes |
コンパイル時間 | 1,581 ms |
コンパイル使用メモリ | 192,588 KB |
最終ジャッジ日時 | 2025-02-12 06:42:27 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 9 TLE * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int solve(ll n){ if(n <= 1) return 2; int d = 0; ll aux = 1; for(int i = n;i >= n - 5 && i >= 0;--i){ d = (d + aux) % 10; aux = aux * n % 10; --n; } return d; } int main(){ int T; cin >> T; ll N; while(T--){ cin >> N; cout << solve(N) << '\n'; } return 0; }