結果

問題 No.265 数学のテスト
ユーザー かにかに
提出日時 2015-08-07 23:25:07
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 2,146 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 91,176 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-25 06:24:20
合計ジャッジ時間 2,140 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 120 ms
4,380 KB
testcase_02 WA -
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 AC 2 ms
4,380 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1 ms
4,376 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#define aLL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXISt(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define MAX 100000000
#define pb push_back
using namespace std; 
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
int dx[] = {0,1,0,-1};
int dy[] = {-1,0,1,0};

int sttoi(std::string str){int ret;std::stringstream ss;ss << str;ss >> ret;return ret;}

int main(){
  int n,d;
  cin >> n >> d;
  string s;
  cin >> s;
  int i;
  int dim = 0;
  int count = 0;
  int keisu = 1;
  int dimen[d+1];
  for(int j = 0;j < d+1;j++){
    dimen[j] = 0;
  }
  for(i = 0;i < n;i++){
    if(s[i] == 'x'){
      count++;
    }else if(s[i] == '+'){
      if(count != 0){
        int ans = keisu;
        int tem = count-dim;
        for(int i = 0;i < dim;i++){
          keisu *= count;
          count--;
        }
        dimen[tem] += keisu;
        keisu = 1;
        count = 0;
      }
    }else if(s[i] == 'd'){
      dim++;
    }else if(s[i] == '*'){

    }else if(s[i] == '{'){

    }else if(s[i] == '}'){
      if(count != 0){
        int ans = keisu;
        int tem = count-dim;
        for(int i = 0;i < dim;i++){
          keisu *= count;
          count--;
        }
        dimen[tem] += keisu;
        count = 0;
      }
      keisu = 1;
      dim--;
    }else{
      keisu = s[i] - '0';
    }
  }
  string answer = "";
  for(int j = 0;j < d+1;j++){
    cout << dimen[j];
    if(j != d){
      cout << " ";
    }
  }
  cout << "" << endl;
}
0