Submission #56532346


Source Code Expand

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#define _GLIBCXX_DEBUG
// kyopuro2.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cassert>
#include <bitset>
#include <sstream>
#include <stdlib.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define eb emplace_back

const long long INF = 1LL << 60;
const long long MOD = 998244353;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

using db = double;
using ll = long long;
using ldb = long double;
using ch = char;
using st = string;
using vi = vector<int>;
using vll = vector<ll>;
using vb = vector<bool>;
using vc = vector<ch>;
using vs = vector<st>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvc = vector<vc>;
using vvs = vector<vs>;
using vvll = vector<vll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using vP = vector <P>;
using vPll = vector<Pll>;
using p_qi = priority_queue<int>;

// 深さ優先探索
vector<bool> seen(300009, false);
vi L(300009,-1);
vi S(300009.-1);
vi fo;
vi lo;
void dfs(const vi& G, int v,int& fp,int&lp) {
    fo[v] = fp++;
    seen[v] = true; // v を訪問済にする
    // v から行ける各頂点 next_v について

    if (!(seen[G[v]])) {
        dfs(G, G[v], fp, lp); // 再帰的に探索
    }
    if (seen[G[v]]) {
        if (S[G[v]] > 0) {
            L[v] = L[G[v]] + 1;
            S[v] = S[G[v]];
        }
        else {
            S[v] = fo[v] - fo[G[v]] + 1;
            cout << S[v] << "\n";
            L[v] = 1;
        }
    }

    lo[v] = lp++;
}
template< typename T >
T mod_pow(T x, T n, const T& p) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) (ret *= x) %= p;
        (x *= x) %= p;
        n >>= 1;
    }
    return ret;
}
int dx[] = { -1,0,1,0 }; int dy[] = { 0,1,0,-1 };
char ldru[] = { 'L','D','R','U' };
ll dp[200009][2][2];
ll GetDigit(ll num) {
    return to_string(num).length();
}


int binary(int bina) {
    int ans = 0;
    for (int i = 0; bina > 0; i++)
    {
        ans = ans + (bina % 2) * pow(10, i);
        bina = bina / 2;
    }
    return ans;
}

int main() {
    int N;
    cin >> N;
    vs S(N);
    int m = 0;
    rep(i, N) {
        cin >> S[i];
        
        m = max(m,(int)S[i].size());
    }
    rep(j, m) {
        int a = 0;
        rep(l, N) {
            if (S[N - l - 1].size() <= j) {
                a++;
            }
            else {
                rep(n, a) {
                    cout << "*";
                }
                a = 0;
                cout << S[N - l - 1][j];
            }
        }
        cout << "\n";
    }
}


// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


Submission Info

Submission Time
Task B - Vertical Writing
User michael_80
Language C++ 20 (gcc 12.2)
Score 200
Code Size 4427 Byte
Status AC
Exec Time 2 ms
Memory 5416 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:128:37: warning: comparison of integer expressions of different signedness: ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
  128 |             if (S[N - l - 1].size() <= j) {
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 21
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt
All 00_sample_01.txt, 00_sample_02.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 2 ms 5360 KiB
00_sample_02.txt AC 2 ms 5344 KiB
01_random_01.txt AC 2 ms 5380 KiB
01_random_02.txt AC 2 ms 5352 KiB
01_random_03.txt AC 2 ms 5204 KiB
01_random_04.txt AC 2 ms 5200 KiB
01_random_05.txt AC 2 ms 5304 KiB
01_random_06.txt AC 2 ms 5360 KiB
01_random_07.txt AC 2 ms 5292 KiB
01_random_08.txt AC 2 ms 5376 KiB
01_random_09.txt AC 2 ms 5380 KiB
01_random_10.txt AC 2 ms 5276 KiB
01_random_11.txt AC 2 ms 5336 KiB
01_random_12.txt AC 2 ms 5248 KiB
01_random_13.txt AC 2 ms 5308 KiB
01_random_14.txt AC 2 ms 5416 KiB
01_random_15.txt AC 2 ms 5360 KiB
02_handmade_01.txt AC 2 ms 5324 KiB
02_handmade_02.txt AC 2 ms 5232 KiB
02_handmade_03.txt AC 2 ms 5332 KiB
02_handmade_04.txt AC 2 ms 5316 KiB