이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define ln "\n"
const ll INF = 2e18;
const ll MOD = 1e9+7;
using namespace std;
void solve(){
ll x, y; cin >> x >> y;
if (x>y){
ll fr = y/2+1;
cout << x+y-fr << ln;
// ll fc = x-x/2;
for (ll rc=0; rc<x; rc++){
for (ll i=0; i<fr; i++){
cout << '+';
}
for (ll i=fr; i<y; i++){
cout << '-';
}
cout << ln;
}
}else{
ll fc = x/2+1;
cout << y+x-fc << ln;
for (ll rc=0; rc<fc; rc++){
for (ll i=0; i<y; i++){
cout << '-';
}
cout << ln;
}
for (ll rc=fc; rc<x; rc++){
for (ll i=0; i<y; i++){
cout << '+';
}
cout << ln;
}
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll t=1;
cin >> t;
while (t--) solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |