結果
| 問題 | 
                            No.2785 四乗足す四の末尾の0
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Today03
                         | 
                    
| 提出日時 | 2024-06-14 22:38:42 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 239 ms / 2,000 ms | 
| コード長 | 703 bytes | 
| コンパイル時間 | 2,044 ms | 
| コンパイル使用メモリ | 193,828 KB | 
| 最終ジャッジ日時 | 2025-02-21 22:13:38 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 20 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int INF = 1e9 + 10;
const ll INFL = 4e18;
int main() {
    int T;
    cin >> T;
    while (T--) {
        int N;
        cin >> N;
        N = abs(N);
        if (N == 1) {
            cout << "Yes" << '\n';
            cout << 0 << '\n';
        }
        else {
            cout << "No" << '\n';
            __int128_t X = 1;
            X *= N;
            X *= N;
            X *= N;
            X *= N;
            X += 4;
            int ans = 0;
            while (X % 10 == 0) {
                X /= 10;
                ans++;
            }
            cout << ans << '\n';
        }
    }
}
            
            
            
        
            
Today03