結果
問題 | No.1198 お菓子配り-1 |
ユーザー |
![]() |
提出日時 | 2020-10-03 18:57:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 422 bytes |
コンパイル時間 | 1,338 ms |
コンパイル使用メモリ | 166,488 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 04:47:09 |
合計ジャッジ時間 | 1,884 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define INF 1000000000#define MOD 998244353using ll=long long;using Graph=vector<vector<int>>;int main(){string S;cin>>S;int N=S.size();int x;if(N==1){x=S[0]-'0';if(x==1||x==4){cout<<-1<<endl;return 0;}}else{x=10*(S[N-2]-'0')+(S[N-1]-'0');}x%=4;if(x==2){cout<<-1<<endl;}else{cout<<1<<endl;}}