結果
| 問題 | No.1198 お菓子配り-1 |
| コンテスト | |
| ユーザー |
Haa
|
| 提出日時 | 2020-08-28 21:32:32 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 491 bytes |
| 記録 | |
| コンパイル時間 | 1,408 ms |
| コンパイル使用メモリ | 166,732 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-16 09:15:05 |
| 合計ジャッジ時間 | 2,019 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 1e18;
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
int main(){
string s; cin >> s;
int n=s.size(), a;
if(n>=2)
a=(s[n-2]-'0')*10+(s[n-1]-'0');
else
a=(s[n-1]-'0');
if((a%4==0||a%2==1)&&s!="1"&&s!="4")
cout << 1 << endl;
else
cout << -1 << endl;
return 0;
}
Haa