Submission #315044

# Submission time Handle Problem Language Result Execution time Memory
315044 2020-10-22T01:20:08 Z yjojdkgk5bp Costinland (info1cup19_costinland) C++14
11.6842 / 100
500 ms 26544 KB
#include <bits/stdc++.h>
#define ll long long
#define sec second
#define ft first
#define pb push_back
using namespace std;
ll k,dp[50][50],sum1[50][50],sum2[50][50],mx;
vector<pair<int,int>> p;
int ans[50][50];
int main()
{
	cin >> k;
	dp[0][1]=1;
	for(int i=1; i<33; i++)
		for(int j=1; j<33; j++)
		{
			dp[i][j]=dp[i-1][j]+dp[i][j-1];
			sum1[i][j]=sum1[i-1][j]+dp[i][j];
			sum2[i][j]=sum2[i][j-1]+dp[i][j];
			 
		}/*
	for(int i=32; i&&k; i--)
		for(int j=i; j&&k; j--)
		{
			if(sum1[i][j]+sum2[i][j]<=k)
			{//cout << sum1[i][j]+sum2[i][j] << ' ';
				k-=sum1[i][j]+sum2[i][j];
				p.pb({i,j});
			}
		}*/
	cout << 2 << ' '<< k << '\n';
	for(int i=0; i<k-1; i++) cout << 'X'; cout << "d\n";
	for(int i=0; i<k-1; i++) cout << 'r'; cout << ".";
	return 0;
}

Compilation message

costinland.cpp: In function 'int main()':
costinland.cpp:32:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   32 |  for(int i=0; i<k-1; i++) cout << 'X'; cout << "d\n";
      |  ^~~
costinland.cpp:32:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   32 |  for(int i=0; i<k-1; i++) cout << 'X'; cout << "d\n";
      |                                        ^~~~
costinland.cpp:33:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   33 |  for(int i=0; i<k-1; i++) cout << 'r'; cout << ".";
      |  ^~~
costinland.cpp:33:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   33 |  for(int i=0; i<k-1; i++) cout << 'r'; cout << ".";
      |                                        ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Correct! Your size: 3
2 Correct 1 ms 332 KB Correct! Your size: 4
3 Correct 1 ms 332 KB Correct! Your size: 5
4 Partially correct 1 ms 332 KB Partially Correct! Your size: 6
5 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
6 Partially correct 1 ms 332 KB Partially Correct! Your size: 8
7 Partially correct 1 ms 332 KB Partially Correct! Your size: 10
8 Partially correct 1 ms 332 KB Partially Correct! Your size: 14
9 Partially correct 1 ms 332 KB Partially Correct! Your size: 19
# Verdict Execution time Memory Grader output
1 Execution timed out 1090 ms 26544 KB Time limit exceeded
2 Halted 0 ms 0 KB -