Submission #918602

# Submission time Handle Problem Language Result Execution time Memory
918602 2024-01-30T07:26:40 Z AnarTz Red-blue table (IZhO19_stones) C++14
0 / 100
177 ms 201564 KB
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
int main(){
    int t;
    string s="",o = "+",s1="";
    cin >> t;
    while(t--){
        int n,m,i,j,c,b;
    cin >> n >> m;
    bool row=true;
    char table[n][m];
    if (m>n)
    {
        c=n-(n/2+1);
        b=m+c;
        row=true;
    }else{
        c=m-(m/2+1);
        b=n+c;
        row=false;
    }
       if (row==true)
       {
        
       }else{
        for (i = 0; i < c; i++)
        {
            
        }
        
       }
       
cout << b<<endl;
if (row==true)
{
    for (i = 0; i < m; i++)
{
    s=s+o;
    s1=s1+"-";
    
}
}else{
for (i = 0; i < m; i++)
{
    s=s+o;
    if (s.size()==m/2+1)
    {
        o = "-";
    }
    
}
}
if (row==true)
{
    for (i = 0; i < n; i++)
    {
        cout << s1<<endl;
        if (i==n/2)
        {
            s1=s;
        }
        
    }
    
}else{
    for (i = 0; i < n; i++)
    {
       cout << s<<endl;
        
    }
}



    }
    return 0;
}

Compilation message

stones.cpp: In function 'int main()':
stones.cpp:49:17: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   49 |     if (s.size()==m/2+1)
      |         ~~~~~~~~^~~~~~~
stones.cpp:11:19: warning: unused variable 'j' [-Wunused-variable]
   11 |         int n,m,i,j,c,b;
      |                   ^
stones.cpp:14:10: warning: unused variable 'table' [-Wunused-variable]
   14 |     char table[n][m];
      |          ^~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 10076 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 177 ms 201564 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 52 ms 54172 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Wrong answer
2 Halted 0 ms 0 KB -