結果

問題 No.1198 お菓子配り-1
ユーザー t33f
提出日時 2020-08-28 22:24:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 65,032 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-16 09:30:09
合計ジャッジ時間 1,229 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
    string s; cin >> s;
    if (s == "1" || s == "4") {
        cout << -1 << endl;
        return 0;
    }
    int n = s.size();
    int x = s[n-1] - '0';
    if (n > 1) x += (s[n-2] - '0') * 10;
    cout << (x % 4 == 2 ? -1 : 1) << endl;
}
0