結果
問題 | No.1198 お菓子配り-1 |
ユーザー |
![]() |
提出日時 | 2020-08-28 22:02:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 958 bytes |
コンパイル時間 | 1,645 ms |
コンパイル使用メモリ | 167,824 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 09:26:42 |
合計ジャッジ時間 | 2,265 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll = long long;ostream &operator<<(ostream &dest, __int128_t value) {ostream::sentry s(dest);if (s) {__uint128_t tmp = value < 0 ? -value : value;char buffer[128];char *d = std::end(buffer);do {--d;*d = "0123456789"[tmp % 10];tmp /= 10;} while (tmp != 0);if (value < 0) {--d;*d = '-';}int len = std::end(buffer) - d;if (dest.rdbuf()->sputn(d, len) != len) {dest.setstate(ios_base::badbit);}}return dest;}__int128 parse(string &s) {__int128 ret = 0;for (int i = 0; i < (int)s.length(); i++)if ('0' <= s[i] && s[i] <= '9')ret = 10 * ret + s[i] - '0';return ret;}istream &operator>>(istream &is, __int128_t &a){string s;is>>s;a = parse(s);return (is);}using Int = __int128_t;int main(){Int n; cin >> n;if((n % 2 == 1 || n % 4 == 0) && n != 1 && n != 4) {cout << 1 << endl;} else {cout << -1 << endl;}}