結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
|
提出日時 | 2024-05-28 08:59:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 558 bytes |
コンパイル時間 | 2,091 ms |
コンパイル使用メモリ | 195,676 KB |
最終ジャッジ日時 | 2025-02-21 17:01:59 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> #define INF 1000000001LL #define MOD 1000000007LL #define long long long #define all(x) x.begin(),x.end() using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); string s; cin >> s; if(s == "1" || s == "2" || s == "4") { cout << -1 << endl; return 0; } s = "0"+s; string t; t.push_back(s[s.size()-2]); t.push_back(s[s.size()-1]); int p = stoi(t); if(p%2 || p%4 == 0) cout << 1 << endl; else cout <<-1 << endl; return 0; }