AtCoder Regular Contest 019

Submission #1036289

Source codeソースコード

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
template<class T> using vv=vector<vector< T > >;

vector<vector<char> > board;
int n;

void print_board() {
  rep (i, n) {
    rep (j, n) {
      printf("%c", board[i][j]);
    }
    printf("\n");
  }
}

int main() {
  n = 150;
  board.assign(n, vector<char>(n, '.'));
  int cluster = 13;
  int sets = n / cluster;
  rep (i, cluster) {
    rep (j, sets) {
      int row = i * sets + j;
      rep (k, sets) {
        board[row][k * cluster + (i + k * j) % cluster] = 'O';
      }
      int column = sets * cluster + (i + sets * j) % cluster;
      if (column < 150) {
        board[row][column] = 'O';
      }
    }
  }
  int offset = cluster * sets;
  FOR (row, offset, n) {
    int i = row - offset;
    FOR (j, i * cluster, i * cluster + cluster) {
      board[row][j] = 'O';
    }
  }
      
  printf("%d\n", n);
  print_board();

  return 0;
}

Submission

Task問題 D - ほんとうのたたかい
User nameユーザ名 mu
Created time投稿日時
Language言語 C++11 (GCC 4.8.1)
Status状態 AC
Score得点 100
Source lengthソースコード長 1805 Byte
File nameファイル名
Exec time実行時間 18 ms
Memory usageメモリ使用量 800 KB

Test case

Set

Set name Score得点 / Max score Cases
All 100 / 100 test.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
test.txt AC 18 ms 800 KB