結果
| 問題 |
No.2269 eN!の整数部分の下1桁
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-18 01:20:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 442 bytes |
| コンパイル時間 | 2,157 ms |
| コンパイル使用メモリ | 192,876 KB |
| 最終ジャッジ日時 | 2025-02-12 09:48:55 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 11 |
ソースコード
#include <bits/stdc++.h>
using i64 = long long;
void solve() {
i64 N;
std::cin >> N;
int ans = 0;
int x = 1;
do {
ans = (ans + x) % 10;
x = x * N % 10;
N--;
} while (x);
std::cout << ans << "\n";
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int T;
std::cin >> T;
while (T--) {
solve();
}
return 0;
}