結果

問題 No.73 helloworld
ユーザー itezpaceitezpace
提出日時 2016-08-05 10:37:39
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,020 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 60,124 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 15:37:03
合計ジャッジ時間 1,101 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int C;
  vector<int> v;
  for(int i=0; i<26; ++i){
    cin>>C;
    v.push_back(C);
  }
  int h,e,l,o,w,r,d;
  int ih,ie,il,io,iw,ir,id;
  int ci;
  ci=49;
  ih='h'-'0';
  ih-=ci;
  ie='e'-'0';
  ie-=ci;
  il='l'-'0';
  il-=ci;
  io='o'-'0';
  io-=ci;
  iw='w'-'0';
  iw-=ci;
  ir='r'-'0';
  ir-=ci;
  id='d'-'0';
  id-=ci;
  h=v[ih];
  e=v[ie];
  l=v[il];
  o=v[io];
  w=v[iw];
  r=v[ir];
  d=v[id];
  vector<int> x;
  x.push_back(h);
  x.push_back(e);
  x.push_back(l);
  x.push_back(o);
  x.push_back(w);
  x.push_back(r);
  x.push_back(d);
  int a,y,z;
  z=1;
  for(int i=0; i<7; ++i){
    if(x[i]<1) {
      cout<<0<<endl;
      return 0;
    } else if(x[i]==1){
      y=1;
    } else if(x[i]>1){
      if(i==2){
        a=x[i];
        y=(((a-(a/3))*(a-(a/3)-1))/2)*(a/3);
      } else if(i==3){
        a=x[i];
        y=(a-(a/2))*(a/2);
      } else {
        a=x[i];
        y=a;
      }
    }
    z*=y;
  }
  cout<<z<<endl;
  return 0;
}
0