Submission #738278

# Submission time Handle Problem Language Result Execution time Memory
738278 2023-05-08T11:35:50 Z sandry24 Costinland (info1cup19_costinland) C++17
11.6842 / 100
30 ms 65536 KB
#include <bits/stdc++.h>
//#include "grader.h"
using namespace std;
 
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second

/*int n = 5, m = 5, K, r[5][5], d[5][5];

void all(int k, int h, vector<vector<char>> &grid){
    if(k == n){
        k = 0;
        h++;
    }
    if(h == m){
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                r[i][j] = d[i][j] = 0;
            }
        }
        r[0][0] = 1;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                if(i == n-1 && j == m-1)
                    continue;
                if(grid[i][j] == '.'){
                    r[i][j+1] += r[i][j];
                    d[i+1][j] += d[i][j];
                } else if(grid[i][j] == 'X'){
                    r[i][j+1] += r[i][j] + d[i][j];
                    d[i+1][j] += r[i][j] + d[i][j];
                } else if(grid[i][j] == 'r'){
                    r[i][j+1] += r[i][j] + d[i][j];
                } else {
                    d[i+1][j] += r[i][j] + d[i][j];
                }
            }
        }
        int ans = r[n-1][m-1] + d[n-1][m-1];
        if(ans > 0){
            for(int i = 0; i < n; i++){
                for(int j = 0; j < m; j++)
                    cout << grid[i][j] << ' ';
                cout << '\n';
            }
            cout << ans << '\n';
        }
    } else {
        if(k == 0 && h == 0){
            grid[k][h] = 'd';
            all(k+1, h, grid);
            grid[k][h] = 'r';
            all(k+1, h, grid);
            grid[k][h] = 'X';
            all(k+1, h, grid);
        }
        else if(k == n-1 && h == m-1){
            grid[k][h] = '.';
            all(k+1, h, grid);
        } else if(k == n-1){
            grid[k][h] = 'd';
            all(k+1, h, grid);
        } else if(h == m-1){
            grid[k][h] = 'r';
            all(k+1, h, grid);
        } else {
            grid[k][h] = '.';
            all(k+1, h, grid);
            grid[k][h] = 'd';
            all(k+1, h, grid);
            grid[k][h] = 'r';
            all(k+1, h, grid);
            grid[k][h] = 'X';
            all(k+1, h, grid);
        }
    }
}*/
 
void solve(){
    int k;
    cin >> k;
    char grid[2][k];
    for(int i = 0; i < k; i++){
        if(i != k-1){
            grid[0][i] = 'X';
            grid[1][i] = 'r';
        } else {
            grid[0][i] = 'd';
            grid[1][i] = '.';
        }
    }
    cout << 2 << ' ' << k << '\n';
    for(int i = 0; i < 2; i++){
        for(int j = 0; j < k; j++)
            cout << grid[i][j];
        cout << '\n';
    }
}

int main(){
    //freopen("input.txt", "r", stdin);
    //freopen("test.out", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Correct! Your size: 3
2 Correct 1 ms 328 KB Correct! Your size: 4
3 Correct 1 ms 212 KB Correct! Your size: 5
4 Partially correct 1 ms 212 KB Partially Correct! Your size: 6
5 Partially correct 1 ms 212 KB Partially Correct! Your size: 7
6 Partially correct 1 ms 212 KB Partially Correct! Your size: 8
7 Partially correct 1 ms 212 KB Partially Correct! Your size: 10
8 Partially correct 1 ms 212 KB Partially Correct! Your size: 14
9 Partially correct 1 ms 212 KB Partially Correct! Your size: 19
# Verdict Execution time Memory Grader output
1 Runtime error 30 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -