結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
|
提出日時 | 2020-08-28 21:33:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 546 bytes |
コンパイル時間 | 666 ms |
コンパイル使用メモリ | 67,288 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-13 23:51:39 |
合計ジャッジ時間 | 1,382 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 9 WA * 5 |
ソースコード
#include <iostream> #include <vector> #include <string> using namespace std; int main(){ string s; cin >> s; if((s[s.size() - 1] - '0') % 2 != 0){ cout << 1 << endl; return 0; } if(s.size() == 1){ if((s[0] - '0') % 4 != 0){ cout << -1 << endl; return 0; } cout << 1 << endl; } else{ int t = (s[0] - '0') * 10 + s[1] - '0'; if(t % 4 == 0){ cout << 1 << endl; return 0; } cout << -1 << endl; } }