結果
問題 |
No.2785 四乗足す四の末尾の0
|
ユーザー |
|
提出日時 | 2024-06-14 22:14:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 493 bytes |
コンパイル時間 | 1,979 ms |
コンパイル使用メモリ | 193,044 KB |
最終ジャッジ日時 | 2025-02-21 22:05:43 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; while(T--){ long long N; cin >> N; N = abs(N); if(N == 1){cout << "Yes\n0\n"; continue;} cout << "No\n"; int answer = 0; long long x = N*N-2*N+2; while(x%10 == 0) x /= 10,answer++; x = N*N+2*N+2; while(x%10 == 0) x /= 10,answer++; cout << answer << "\n"; } }