Submission #7636303


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
typedef long long ll;
typedef pair<int,int> P;
using vi=vector<int>;
using vvi=vector<vector<int>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
const int inf=1000000009;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}

int main(){
  int h,w,a,b;cin>>h>>w>>a>>b;
  if(a*2>w||b*2>h){
    cout<<"No"<<endl;
    return 0;
  }
  vvi v(h,vi(w));
  rep(i,h-b){
    rep(j,a){
      v[i][j]=1;
    }
  }
  for(int i=h-b;i<h;i++){
    for(int j=a;j<w;j++){
      v[i][j]=1;
    }
  }
  rep(i,h){
    rep(j,w){
      cout<<v[i][j];
    }
    cout<<endl;
  }
}

Submission Info

Submission Time
Task A - 01 Matrix
User blackyuki
Language C++14 (GCC 5.4.1)
Score 300
Code Size 738 Byte
Status AC
Exec Time 51 ms
Memory 5120 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 14
Set Name Test Cases
Sample sample-01.txt, sample-02.txt
All 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-01.txt AC 1 ms 256 KB
01-02.txt AC 1 ms 256 KB
01-03.txt AC 1 ms 256 KB
01-04.txt AC 3 ms 256 KB
01-05.txt AC 1 ms 256 KB
01-06.txt AC 49 ms 4864 KB
01-07.txt AC 3 ms 256 KB
01-08.txt AC 31 ms 3072 KB
01-09.txt AC 51 ms 5120 KB
01-10.txt AC 51 ms 5120 KB
01-11.txt AC 51 ms 5120 KB
01-12.txt AC 51 ms 5120 KB
sample-01.txt AC 1 ms 256 KB
sample-02.txt AC 1 ms 256 KB