結果

問題 No.1198 お菓子配り-1
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2020-07-19 22:13:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 1,582 ms
コンパイル使用メモリ 165,504 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-24 19:08:34
合計ジャッジ時間 3,372 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int s(char a){
 if(a=='0'||a=='4'||a=='8'){
   return 0;
 }
  else if(a=='1'||a=='5'||a=='9'){
   return 1;
 }
  else if(a=='2'||a=='6'){
    return 2;
  }
  else{
    return 3;
  }
}
int main() {
string k;
  cin>>k;
  if(k=="1"||k=="4"){
    cout<<-1<<endl;
  }
  else{
    int ans=0;
    int z=k.size();
 if(((s(k.at(z-2)))*10+s(k.at(z-1)))%4==2){
   cout<<-1<<endl;
 }
    else{
      cout<<1<<endl;
    }
      }
cout<<k<<endl;
}
0