結果
| 問題 |
No.2269 eN!の整数部分の下1桁
|
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2023-04-15 10:20:44 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 211 ms / 2,000 ms |
| コード長 | 450 bytes |
| コンパイル時間 | 2,696 ms |
| コンパイル使用メモリ | 244,376 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-10 22:45:23 |
| 合計ジャッジ時間 | 4,890 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int t;
cin>>t;
while(t--){
ll n;
cin>>n;
if(n==0) n = 1;
int ans = 0;
int now = n % 10;
n--;
while(now!=0){
ans += now;
ans %= 10;
int nxt = n % 10;
now *= nxt;
n--;
}
ans++;
ans%=10;
cout<<ans<<endl;
}
}
momoyuu