結果
| 問題 |
No.1198 お菓子配り-1
|
| コンテスト | |
| ユーザー |
magsta
|
| 提出日時 | 2020-08-28 22:12:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 379 bytes |
| コンパイル時間 | 676 ms |
| コンパイル使用メモリ | 64,128 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 09:29:35 |
| 合計ジャッジ時間 | 1,216 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 WA * 1 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main() {
string S; cin >> S;
long long N = S.size();
long long A;
if (N == 1) A = S[N - 1] - '0';
else A = 10 * (S[N - 2] - '0') + S[N - 1] - '0';
if (A == 1 || A == 4) cout << -1 << endl;
else if (A % 4 == 0 || A % 4 == 1 || A % 4 == 3) cout << 1 << endl;
else cout << -1 << endl;
}
magsta