結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
|
提出日時 | 2020-09-04 14:47:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 537 bytes |
コンパイル時間 | 1,524 ms |
コンパイル使用メモリ | 167,548 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 10:47:40 |
合計ジャッジ時間 | 2,441 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1000000007; const int INF = 1001001001; int main(){ string s; cin >> s; int sz = s.size(); if(sz == 1){ int k = s[0] - '0'; if(k == 4 || k == 1) cout << -1 << endl; else if(k == 8 || k % 2 == 1) cout << 1 << endl; else cout << -1 << endl; } if(sz >= 2){ int k = (s[0] - '0') + 10 * (s[1] - '0'); if(k % 4 == 0 || k % 2 == 1) cout << 1 << endl; else cout << -1 << endl; } }