結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
![]() |
提出日時 | 2020-08-29 15:23:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 618 bytes |
コンパイル時間 | 1,801 ms |
コンパイル使用メモリ | 166,272 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 09:36:27 |
合計ジャッジ時間 | 2,490 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2020.08.29 15:23:20 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { string s;cin >> s; if (s.size() == 1) { int t = s[0] - '0'; if (t >= 3 && (t % 2 == 1 || t == 8)) { puts("1"); } else { puts("-1"); } } else { int t = s[s.size()-1] - '0' + (s[s.size()-2] - '0') * 10; if (t % 4 == 0 || t % 2 == 1) { cout << 1 << endl; } else { cout << -1 << endl; } } return 0; }