結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
![]() |
提出日時 | 2020-08-28 21:28:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 354 bytes |
コンパイル時間 | 2,616 ms |
コンパイル使用メモリ | 193,704 KB |
最終ジャッジ日時 | 2025-01-13 16:35:08 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ string N; cin >> N; string S; if (N.size() >= 2){ S = N.substr(N.size() - 2); } else { S = "0" + N; } int d = stoi(S); if (d % 2 == 1 && N != "1"){ cout << 1 << endl; } else if (d % 4 == 0 && N != "4"){ cout << 1 << endl; } else { cout << -1 << endl; } }