結果
| 問題 | No.1198 お菓子配り-1 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-28 08:59:23 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 558 bytes |
| 記録 | |
| コンパイル時間 | 1,186 ms |
| コンパイル使用メモリ | 212,464 KB |
| 実行使用メモリ | 11,964 KB |
| 最終ジャッジ日時 | 2026-07-04 19:24:56 |
| 合計ジャッジ時間 | 2,271 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}