Submission #687231

# Submission time Handle Problem Language Result Execution time Memory
687231 2023-01-26T08:07:01 Z smartmonky Costinland (info1cup19_costinland) C++14
0 / 100
1 ms 340 KB
#include <bits/stdc++.h>
 
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define int long long
 
using namespace std;
const int N = 1e6 + 1;
int dp[8][8], vis[8][8], mx[8][8];
int k;
char a[8][8];
int n = 5;
main(){
	ios_base::sync_with_stdio(0);
    cin.tie(0);
	cin >> k;
	cout << "5 5" << endl;
	for(int i = 1; i <= n; i++){
		a[i][n] = 'd';
		a[n][i] = 'r';
	}
	for(int i = 1; i <= n - 1; i++){
		for(int j = 1; j <= n - 1; j++){
			a[i][j] = '.';
		}
	}
	k -= 2;
	a[1][1] = 'X';
	int l = 2;
	while(k){
		if(k >= 2){
			k -= 2;
			a[l][1] = 'X';
			a[1][l] = 'X';
			if(k >= 2){
				a[l][l] = 'X';
				k -= 2;
			}
			if(a[l - 1][l] == '.' && k > 0){
				a[l - 1][l] = 'X';
				k--;
			}
			if(a[l][l - 1] == '.' && k > 0){
				a[l][l - 1] = 'X';
				k--;
			}
			}else if(k > 0){
				a[l][1] = 'X';
				k--;
				a[1][l] = 'r';
			}
		l++;
	}
	a[n][n] = '.';
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			cout << a[i][j];
		}
		cout << endl;
	}
}

Compilation message

costinland.cpp:16:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   16 | main(){
      | ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Correct! Your size: 5
2 Correct 0 ms 212 KB Correct! Your size: 5
3 Correct 1 ms 212 KB Correct! Your size: 5
4 Correct 0 ms 212 KB Correct! Your size: 5
5 Correct 0 ms 212 KB Correct! Your size: 5
6 Correct 0 ms 212 KB Correct! Your size: 5
7 Correct 1 ms 212 KB Correct! Your size: 5
8 Incorrect 0 ms 212 KB The matrix does not generate the required number of Costins
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -