結果

問題 No.1469 programing
ユーザー 蜜蜂蜜蜂
提出日時 2021-04-09 21:20:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 38 ms / 3,000 ms
コード長 1,364 bytes
コンパイル時間 3,800 ms
コンパイル使用メモリ 227,012 KB
実行使用メモリ 11,604 KB
最終ジャッジ日時 2023-09-07 09:32:45
合計ジャッジ時間 5,035 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

//g++ 4.cpp -std=c++14 -O2 -I .
#include <bits/stdc++.h>
using namespace std;

#include <atcoder/all>
using namespace atcoder;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vld = vector<ld>;
using vvld = vector<vld>;

#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rep(i,start,end) for(ll i=start;i<(ll)(end);i++)
#define per(i,start,end) for(ll i=start;i>=(ll)(end);i--)

ll ans=0;
int h,w,a,b;

void dfs(int x,int y,int a,int b,vvi &grid){
  if(a==0&&b==0){
    ans++;
    return;
  }
  if(x>=h||y>=w){
    return;
  }
  if(grid[x][y]!=0){
    y++;
    if(y==w){
      x++;
      y=0;
    }
    dfs(x,y,a,b,grid);
    return;
  }
  if(b>0){
    grid[x][y]=1;
    dfs(x,y,a,b-1,grid);
    grid[x][y]=0;
  }
  if(a>0){
    if(y<w-1&&grid[x][y+1]==0){
      grid[x][y]=2;
      grid[x][y+1]=2;
      dfs(x,y,a-1,b,grid);
      grid[x][y]=0;
      grid[x][y+1]=0;
    }
    if(x<h-1&&grid[x+1][y]==0){
      grid[x][y]=3;
      grid[x+1][y]=3;
      dfs(x,y,a-1,b,grid);
      grid[x][y]=0;
      grid[x+1][y]=0;      
    }
  }
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  string s;
  cin>>s;

  rep(i,0,s.size()){
    if(i>0&&s[i-1]==s[i]){
      continue;
    }
    cout<<s[i];
  }
}
0