이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Euzubillahimines-seytanir-rajim Bismillahir-rahmanir-rahym
/*
ID:
TASK:
LANG: C++
*/
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define mp make_pair
#define PII pair<int,int>
#define inf 1000000001
using namespace std;
int t;
int main(){
cin>>t;
while(t--){
int n, m;
cin>>n>>m;
if( n == 1 && m == 1 ) cout<<"1\n+\n";
else if( n == 1 && m == 2 ) cout<<"2\n--\n";
else if( n == 1 && m == 3 ) cout<<"3\n---\n";
else if( n == 1 && m == 4 ) cout<<"4\n----\n";
else if( n == 2 && m == 1 ) cout<<"2\n+\n+\n";
else if( n == 2 && m == 2 ) cout<<"2\n++\n++\n";
else if( n == 2 && m == 3 ) cout<<"3\n---\n---\n";
else if( n == 2 && m == 4 ) cout<<"4\n----\n----";
else if( n == 3 && m == 1 ) cout<<"3\n+\n+\n+\n";
else if( n == 3 && m == 2 ) cout<<"3\n++\n++\n++\n";
else if( n == 3 && m == 3 ) cout<<"4\n++-\n++-\n+++\n";
else if( n == 3 && m == 4 ) cout<<"5\n---+\n----\n+++-\n";
else if( n == 4 && m == 1 ) cout<<"4\n+\n+\n+\n+\n";
else if( n == 4 && m == 2 ) cout<<"4\n++\n++\n++\n++\n";
else if( n == 4 && m == 3 ) cout<<"5\n++-\n++-\n++-\n++-\n";
else if( n == 4 && m == 4 ) cout<<"5\n----\n----\n----\n++++\n";
}
}
| # | 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... |