結果
問題 |
No.2269 eN!の整数部分の下1桁
|
ユーザー |
|
提出日時 | 2023-04-14 21:45:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 1,544 ms |
コンパイル使用メモリ | 166,092 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-10-10 12:27:34 |
合計ジャッジ時間 | 5,315 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 3 TLE * 1 -- * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; int main(){ ll T; cin>>T; for(int i=0;i<T;i++){ ll N; cin>>N; ll ans=0; for(int j=max(0ll,N-20);j<=N;j++){ //N!/j! ll memo=1; for(int k=j+1;k<=N;k++){ memo*=(k%10); memo%=10; } ans+=memo; ans%=10; } cout<<ans<<endl; } }