結果
問題 |
No.1198 お菓子配り-1
|
ユーザー |
|
提出日時 | 2020-08-28 22:08:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 390 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 32,384 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-14 00:45:16 |
合計ジャッジ時間 | 798 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 WA * 1 |
ソースコード
#include<cstdio> #include<cstring> char s[55]; int main(){ scanf("%s",s+1); int n = strlen(s+1); int mod2 = 0, mod4 = 0; for(int i = 1; i <= n; i++){ int u = s[i]-'0'; mod2 = (mod2*10+u)%2; mod4 = (mod4*10+u)%4; } if(n==1 && s[1]=='1') printf("-1\n"); else if(mod2!=0 || mod4==0) printf("1\n"); else printf("-1\n"); return 0; }