結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
|
提出日時 | 2020-08-28 22:14:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 1,653 ms |
コンパイル使用メモリ | 167,424 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-14 00:59:47 |
合計ジャッジ時間 | 2,520 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 12 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <math.h> #include <iomanip> template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const int mod=1000000007; const int INF=1001001001; int main() { string S; cin>>S; int n=S.size(); int a=S[n-1]-'0'; if(n>1){a+=10*(S[n-2]-'0');} int b=S[n-1]-'0'; if(a%4==0||b%2!=0){cout<<1<<endl;} else{cout<<-1<<endl;} return 0; }