結果
問題 | No.1198 お菓子配り-1 |
ユーザー |
|
提出日時 | 2020-08-28 21:32:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 637 bytes |
コンパイル時間 | 1,000 ms |
コンパイル使用メモリ | 94,404 KB |
最終ジャッジ日時 | 2025-01-13 16:40:36 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>#include <queue>#include <math.h>#include <map>using namespace std;typedef long long int ll;int main(){cin.tie(nullptr);ios::sync_with_stdio(false);string n; cin >> n;if(n=="1"){printf("-1\n");}else if(n=="8"){printf("1\n");}else if((n.back()-'0')%2){printf("1\n");}else if(n.size()==1){printf("-1\n");}else{int p=(n[n.size()-2]-'0')*10+(n.back()-'0');if(p%4){printf("-1\n");}else{printf("1\n");}}}