結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
![]() |
提出日時 | 2020-08-28 21:52:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 2,570 ms |
コンパイル使用メモリ | 191,608 KB |
最終ジャッジ日時 | 2025-01-13 17:09:44 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.length(); int tmp; if(sz > 1) tmp = ((s[sz - 1] - '0') + (s[sz - 2] - '0') * 10); else tmp = s[sz - 1] - '0'; if((s[sz - 1] - '0') % 2 == 0){ if(tmp % 4 == 0) cout << 1 << endl; else cout << - 1 << endl; } else{ if(tmp % 4 == 1) cout << 1 << endl; else cout << -1 << endl; } }