結果
| 問題 | No.2269 eN!の整数部分の下1桁 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-14 22:03:18 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 416 bytes |
| 記録 | |
| コンパイル時間 | 1,160 ms |
| コンパイル使用メモリ | 209,656 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-30 07:30:13 |
| 合計ジャッジ時間 | 6,090 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}