Submission #341824

# Submission time Handle Problem Language Result Execution time Memory
341824 2020-12-31T06:31:33 Z Redhood Red-blue table (IZhO19_stones) C++14
0 / 100
37 ms 1516 KB
#include<bits/stdc++.h>
#define fi first
#define se second
#define len(x) (int)(x).size()
#define pb push_back
#define p2(x) (x)*(x)
#define all(x) (x).begin() , (x).end()
#define mkp make_pair


//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("-O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long double ld;
typedef long long ll;


void solve(){
    int n , m;
    cin >> n >> m;
    /// red okay???
    /// lulz
    if(n > m){
        int need;
        need = (m + 1) / 2;
        int ans = n + m - need;
        cout << ans << '\n';
        for(int i = 0 ; i < n; ++i){
            for(int j = 0 ; j < need; ++j)
                cout << "+";
            for(int j = need; j < m ; ++j)
                cout << "-";
            cout << '\n';
        }
    }else{
        int need;
        need = (n + 1) / 2;
        int ans = n + m - need;

        vector < vector < char > > a(n , vector < char > (m , '+'));
        for(int j = 0 ; j < m; ++j){
            for(int i = 0 ; i < need ; ++i)
                a[i][j]  = '-';
        }
        cout << ans << '\n';
        for(auto i : a){
            for(auto j : i){
                cout << j;
            }
            cout << '\n';
        }
    }
}

int main(){
    ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
    int t;
    cin >> t;
    while(t--){
        solve();
    }
}
/*


*/

# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB in the table A+B is not equal to 5
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB in the table A+B is not equal to 21
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB in the table A+B is not equal to 5
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 1516 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 1388 KB in the table A+B is not equal to 36
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB in the table A+B is not equal to 5