Submission #2257263


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll a,b;
ll h=100,w=100;
char res[101][101];

int main(){
  cin>>a>>b;
  a--;b--;
  rep(i,100)rep(j,100){
    res[i][j]='.';
  }
  repl(i,49,100)repl(j,49,100)res[i][j]='#';
  res[49][49]='.';
  for(ll i=0;i<50;i+=2){
    for(ll j=0;j<50;j+=2){
      if(b==0)break;
      res[i][j]='#';
      b--;
    }
    if(b==0)break;
  }
  for(ll i=50;i<100;i+=2){
    for(ll j=50;j<100;j+=2){
      if(a==0)break;
      res[i][j]='.';
      a--;
    }
    if(a==0)break;
  }
  cout<<100<<" "<<100<<endl;
  rep(i,100){
    rep(j,100)cout<<res[i][j];
    cout<<endl;
  }

  return 0;
}

Submission Info

Submission Time
Task D - Grid Components
User yamad
Language C++14 (GCC 5.4.1)
Score 500
Code Size 1232 Byte
Status
Exec Time 2 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
All 500 / 500 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 30.txt, 31.txt, 32.txt, 33.txt, 34.txt, 35.txt, 36.txt, 37.txt, 38.txt, 39.txt, 40.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
Case Name Status Exec Time Memory
01.txt 2 ms 256 KB
02.txt 2 ms 256 KB
03.txt 2 ms 256 KB
04.txt 2 ms 256 KB
05.txt 2 ms 256 KB
06.txt 2 ms 256 KB
07.txt 2 ms 256 KB
08.txt 2 ms 256 KB
09.txt 2 ms 256 KB
10.txt 2 ms 256 KB
11.txt 2 ms 256 KB
12.txt 1 ms 256 KB
13.txt 2 ms 256 KB
14.txt 2 ms 256 KB
15.txt 2 ms 256 KB
16.txt 2 ms 256 KB
17.txt 2 ms 256 KB
18.txt 2 ms 256 KB
19.txt 2 ms 256 KB
20.txt 2 ms 256 KB
21.txt 2 ms 256 KB
22.txt 2 ms 256 KB
23.txt 2 ms 256 KB
24.txt 2 ms 256 KB
25.txt 2 ms 256 KB
26.txt 2 ms 256 KB
27.txt 2 ms 256 KB
28.txt 2 ms 256 KB
29.txt 2 ms 256 KB
30.txt 2 ms 256 KB
31.txt 2 ms 256 KB
32.txt 2 ms 256 KB
33.txt 2 ms 256 KB
34.txt 2 ms 256 KB
35.txt 2 ms 256 KB
36.txt 2 ms 256 KB
37.txt 2 ms 256 KB
38.txt 2 ms 256 KB
39.txt 2 ms 256 KB
40.txt 2 ms 256 KB
sample-01.txt 2 ms 256 KB
sample-02.txt 2 ms 256 KB
sample-03.txt 2 ms 256 KB
sample-04.txt 2 ms 256 KB