結果

問題 No.1764 Square
ユーザー kappybarkappybar
提出日時 2021-12-11 20:46:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,849 bytes
コンパイル時間 1,617 ms
コンパイル使用メモリ 171,752 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-27 09:22:23
合計ジャッジ時間 2,388 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define popcount(x) __builtin_popcountll(x)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
const int INF = 1e9+10;
const long long LINF = 4e18;
//const int MOD = 1000000007;
const int MOD = 998244353;
const double PI = 3.14159265358979323846;
template<class T, class K>bool chmax(T &a, const K b) { if (a<b) { a=b; return true; } return false; }
template<class T, class K>bool chmin(T &a, const K b) { if (b<a) { a=b; return true; } return false; }
#ifdef LOCAL_
#define debug(var)  do{cerr << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){cerr << e << endl;}
template<typename T, typename K> void view(const pair<T, K> &e){cerr << "(" << e.fi << ", " << e.se << ")" << endl;}
template<typename T> void view(const set<T> &st){ for(const auto& e : st){cerr << e << " ";} cerr << endl;}
template<typename T, typename K> void view(const map<T, K> &mp){ for(const auto& [k, v]: mp){cerr << "(" << k << ", " << v << ")" << endl;}}
template<typename T> void view(const vector<T> &v){for(const auto& e : v){cerr << e << " "; } cerr << endl;}
template<typename T> void view(const vector<vector<T>> &vv){cerr << endl;int cnt = 0;for(const auto& v : vv){cerr << cnt << "th : "; view(v); cnt++;} cerr << endl;}
#else
#define debug(...) (void(0))
#endif

int main() {
    int k;
    cin >> k;
    vector<queue<char>> q(4);
    q[0].push('A');
    q[0].push('E');
    q[1].push('B');
    q[2].push('C');
    q[3].push('D');
    rep(i,k){
        char c = q[i%4].front();
        q[i%4].pop();
        q[(i+1)%4].push(c);
    }
    rep(i,4){
        while(!q[i].empty()){
            auto c = q[i].front();
            q[i].pop();
            cout << c;
        }
        cout << endl;
    }
    return 0;
}
0