結果
| 問題 |
No.2185 平方数の下6桁
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-13 22:05:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,402 bytes |
| コンパイル時間 | 1,188 ms |
| コンパイル使用メモリ | 120,532 KB |
| 最終ジャッジ日時 | 2025-02-10 02:35:22 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 37 |
ソースコード
#include <algorithm>
#include <array>
#include <bit>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
void solve() {
std::string s;
std::cin >> s;
std::vector<int> a(s.size());
for (int i = 0; i < 6; i++) {
a[i] = s[i] - '0';
}
auto f = [&]() {
if (a.back() == 2 or a.back() == 3 or a.back() == 7 or a.back() == 8)
return false;
if (a.back() & 1) {
if (a[4] & 1) return false;
}
if (a.back() == 6 and a[4] % 2 == 0) return false;
if (a.back() == 5 and a[4] != 2) return false;
int cnt = 0;
for (int i = 5; i >= 0; i--) {
if (a[i] == 0)
cnt++;
else
break;
}
if (cnt & 1) return false;
if (a.back() == 1 or a.back() == 4 or a.back() == 9) {
if (a[4] & 1) return false;
}
if (a[4] & 1) {
if (a.back() != 6) return false;
}
return true;
};
if (f()) {
std::cout << "Yes\n";
} else {
std::cout << "No\n";
}
}
int main() {
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
std::cout << std::boolalpha;
int t = 1;
// std::cin >> t;
while (t--) solve();
// solve();
return 0;
}