답안 #1012736

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1012736 2024-07-02T14:30:04 Z Nika533 Costinland (info1cup19_costinland) C++17
0 / 100
1 ms 456 KB
#pragma gcc diagnostic "-std=c++1z"
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
using namespace std;
int n,m,T,k;
void test_case() {
     n=49; m=49;
     cin>>k; 
     char arr[n+5][m+5];
     for (int i=1; i<=n; i++) {
          for (int j=1; j<=m; j++) {
               arr[i][j]='.';
          }
     }
     for (int i=1; i<=n-1; i++) arr[i][m]='d';
     for (int i=1; i<=m-1; i++) arr[n][i]='r';

     vector<int> v; v.pb(1e9);
     while (k) {
          v.pb(k%6); k/=6;
     }
     int sz=v.size()-1;

     for (int i=1; i<sz; i++) {
          int j=1+(i-1)*2;
          arr[j][j]='X';
          arr[j+1][j]='X';
          arr[j][j+1]='X';
          arr[j+1][j+1]='X';
          arr[j][j+2]='d';
          arr[j+1][j+2]='d';
          arr[j+2][j]='r';
          arr[j+2][j+1]='r';
          if (v[i]==1) {
               arr[j][j+2]='X';
          }
          if (v[i]==2) {
               arr[j+1][j+2]='X';
          }
          if (v[i]==3) {
               arr[j][j+2]='X';
               arr[j+1][j+2]='X';
          }
          if (v[i]==4) {
               arr[j][j+2]='X';
               arr[j+1][j+2]='X';
               arr[j+2][j]='X';
          }
          if (v[i]==5) {
               arr[j][j+2]='X';
               arr[j+1][j+2]='X';
               arr[j+2][j+1]='X';
          }
     }

     int j=1+(sz-1)*2;
     if (v[sz]==2) {
          arr[j][j]='X';
     }
     if (v[sz]==3) {
          arr[j][j]='X';
          arr[j][j+1]='X';
     }
     if (v[sz]==4) {
          arr[j][j]='X';
          arr[j][j+1]='X';
          arr[j+1][j]='X';
     }
     if (v[sz]==5) {
          arr[j][j]='X';
          arr[j][j+1]='X';
          arr[j+1][j]='X';
          arr[j+2][j]='X';
     }


     cout<<n<<" "<<m<<endl;
     for (int i=1; i<=n; i++) {
          for (int j=1; j<=m; j++) {
               cout<<arr[i][j];
          }
          cout<<endl;
     }
}
main () {
	ios :: sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	T=1; 
	while (T--) test_case();
}

Compilation message

costinland.cpp:1: warning: ignoring '#pragma gcc diagnostic' [-Wunknown-pragmas]
    1 | #pragma gcc diagnostic "-std=c++1z"
      | 
costinland.cpp:92:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   92 | main () {
      | ^~~~
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 KB Partially Correct! Your size: 49
2 Partially correct 0 ms 348 KB Partially Correct! Your size: 49
3 Partially correct 0 ms 348 KB Partially Correct! Your size: 49
4 Partially correct 0 ms 348 KB Partially Correct! Your size: 49
5 Partially correct 0 ms 348 KB Partially Correct! Your size: 49
6 Incorrect 1 ms 456 KB The matrix does not generate the required number of Costins
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB The matrix does not generate the required number of Costins
2 Halted 0 ms 0 KB -