Submission #63255049


Source Code Expand

#include <random>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <chrono>
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((x).size())
typedef long long ll;
using ull = unsigned long long;
using namespace std;
mt19937 rnd(348502);
ll mod = 998244353;
ll mod1 = 1e9 + 7;
const ll N = 55;

char a[N][N];

void solve()
{
    int n, i, j;
    cin >> n;
    for ( i = 0; i < n; i++)
    {
        char c = '#';
        if (i % 2)
            c = '.';
        if (a[i][i] == 0)
        {
            int ind = i;
            while (a[i][ind] == 0 && ind < n)
            {
                a[i][ind] = c;
                ind++;
            }
            ind = i + 1;
            while (a[ind][i] == 0 && ind < n)
            {
                a[ind][i] = c;
                ind++;
            }
            ind = i + 1;
            while (a[ind][n - i - 1] == 0 && ind < n)
            {
                a[ind][n - i - 1] = c;
                ind++;
            }
            ind = i + 1;
            while (a[n - i - 1][ind] == 0 && ind < n)
            {
                a[n - i - 1][ind] = c;
                ind++;
            }
        }
    }
    for ( i = 0; i < n; i++)
    {
        for ( j  = 0; j < n; j++)
        {
            cout << a[i][j];
        }
        cout << '\n';
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
    }
    return 0;
}

Submission Info

Submission Time
Task B - Make Target
User CyberCow
Language C++ 23 (gcc 12.2)
Score 200
Code Size 1842 Byte
Status AC
Exec Time 1 ms
Memory 3616 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 20
Set Name Test Cases
Sample 00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt, 00-sample-004.txt
All 00-sample-001.txt, 00-sample-002.txt, 00-sample-003.txt, 00-sample-004.txt, 01-random-001.txt, 01-random-002.txt, 01-random-003.txt, 01-random-004.txt, 01-random-005.txt, 01-random-006.txt, 01-random-007.txt, 01-random-008.txt, 01-random-009.txt, 01-random-010.txt, 01-random-011.txt, 01-random-012.txt, 01-random-013.txt, 01-random-014.txt, 01-random-015.txt, 01-random-016.txt
Case Name Status Exec Time Memory
00-sample-001.txt AC 1 ms 3420 KiB
00-sample-002.txt AC 1 ms 3412 KiB
00-sample-003.txt AC 1 ms 3544 KiB
00-sample-004.txt AC 1 ms 3552 KiB
01-random-001.txt AC 1 ms 3424 KiB
01-random-002.txt AC 1 ms 3480 KiB
01-random-003.txt AC 1 ms 3416 KiB
01-random-004.txt AC 1 ms 3468 KiB
01-random-005.txt AC 1 ms 3480 KiB
01-random-006.txt AC 1 ms 3420 KiB
01-random-007.txt AC 1 ms 3540 KiB
01-random-008.txt AC 1 ms 3424 KiB
01-random-009.txt AC 1 ms 3476 KiB
01-random-010.txt AC 1 ms 3416 KiB
01-random-011.txt AC 1 ms 3424 KiB
01-random-012.txt AC 1 ms 3480 KiB
01-random-013.txt AC 1 ms 3476 KiB
01-random-014.txt AC 1 ms 3616 KiB
01-random-015.txt AC 1 ms 3348 KiB
01-random-016.txt AC 1 ms 3416 KiB