結果

問題 No.1764 Square
コンテスト
ユーザー takabatake2911
提出日時 2021-12-30 23:19:42
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,028 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 990 ms
コンパイル使用メモリ 176,132 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-23 17:58:52
合計ジャッジ時間 1,821 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

int main() {
    string s = "EABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCD";
    int n;
    cin >> n;
    string t = s.substr((1000 - n / 4) % 5, 5);
    if (n % 4 == 0) {
        cout << t[1];
        cout << t[0] << endl;
        cout << t[2] << endl;
        cout << t[3] << endl;
        cout << t[4] << endl;
        return 0;
    }
    if (n % 4 == 1) {
        cout << t[0] << endl;
        cout << t[2];
        cout << t[1] << endl;
        cout << t[3] << endl;
        cout << t[4] << endl;
        return 0;
    }
    if (n % 4 == 2) {
        cout << t[0] << endl;
        cout << t[1] << endl;
        cout << t[3];
        cout << t[2] << endl;
        cout << t[4] << endl;
        return 0;
    }
    if (n % 4 == 3) {
        cout << t[0] << endl;
        cout << t[1] << endl;
        cout << t[2] << endl;
        cout << t[4];
        cout << t[3] << endl;
        return 0;
    }
}
0