Language: C++

ST
zzuli暑假集训第二周积分赛
End: 2018-08-12 11:40 CST
03:00:00
Ended
Overview
Problem
Status
Rank (03:00:00)
0 Comments
SettingFavoriteClone
Previous12345…NextFilterReset
Username

541707090128
Prob
	Result 
	Time
(ms)	Mem
(MB)	Lang 
	Submit Time
541707090128
G
Wrong Answer
C++
43 min ago
541707090128
G
Wrong Answer
C++
54 min ago
541707090128
E
Accepted
0	1.7	
C++
59 min ago
541707090128
A
Accepted
31	0	
C++
1 hr ago
541707090128
I
Accepted
15	1.8	
C++
2 hr ago
541707090128
K
Accepted
15	1.7	
C++
2 hr ago
541707090128
D
Accepted
31	1.7	
C++
3 hr ago
           
All Copyright Reserved ©2018 Xu Han
Server Time: 2018-08-12 12:20:19 CST

#15389000 | 541707090128's solution for [AtCoder-1995] [Problem G]
Status
Wrong Answer
Length
1711
Lang
C++14 (GCC 5.3.0)
Submitted
2018-08-12 11:36:23
Shared

RemoteRunId
2996617
8.0 / 11.0
Select Code
#include <iostream>
#include <string.h>
#include<string>
#include <math.h>
#include <algorithm>
#include<stdio.h>
#include<queue>
#define maxn 1010
using namespace std;
int pre[maxn];
int height[maxn];
char str[105][105];
struct stu
{
    int sum;
    int id;
}ans;
bool operator < (stu a,stu b)
{
    if(a.sum==b.sum)
        return a.id > b.id;
    return a.sum < b.sum;
}
void dfs(int x,int y)
{
    int dx,dy,nx,ny;
    str[x][y]='*';
    for(dy=-1;dy<=1;dy++)
    {
        for(dx=-1;dx<=1;dx++)
        {
            nx=x+dx;ny=y+dy;
            if(str[nx][ny]=='@')
            {
                dfs(nx,ny);
            }
        }
    }
}
int findit(int x)
{
    if(pre[x]==x)
        return x;
    else
        return pre[x]=findit(pre[x]);
}

void mix(int a,int b)
{
    a=findit(a);
    b=findit(b);
    if(a==b)
        return;
    if(height[a]<height[b])
        pre[a]=b;
    else
    {
        pre[b]=a;
        if(height[a]==height[b])
            height[a]++;
    }
}

void init(int n)
{
    for(int i=1;i<=n;i++)
    {
        pre[i]=i;
        height[i]=0;
    }
}
int main()
{
    long long a,b;
    scanf("%lld%lld",&a,&b);
    if(a<=0&&b>=0)
        printf("Zero\n");
    else
    {
        if(a>0)
        {
            printf("Positive\n");
        }
        else
        {
            if(b>0)
            {
                if(a%2==0)
                    printf("Positive\n");
                else
                    printf("negative\n");
            }
            else
            {
                if(a%2==0&&b%2==0||a%2!=0&&b%2!=0)
                    printf("Negative\n");
                else
                    printf("Positive\n");
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:3:11: error: invalid digit "8" in octal constant
    3 | End: 2018-08-12 11:40 CST
      |           ^~
a.cc:12:1: error: extended character … is not valid in an identifier
   12 | Previous12345…NextFilterReset
      | ^
a.cc:63:24: error: extended character © is not valid in an identifier
   63 | All Copyright Reserved ©2018 Xu Han
      |                        ^
a.cc:64:19: error: invalid digit "8" in octal constant
   64 | Server Time: 2018-08-12 12:20:19 CST
      |                   ^~
a.cc:66:11: error: "|" is not a valid filename
   66 | #15389000 | 541707090128's solution for [AtCoder-1995] [Problem G]
      |           ^
a.cc:72:12: error: too many decimal points in number
   72 | C++14 (GCC 5.3.0)
      |            ^~~~~
a.cc:74:6: error: invalid digit "8" in octal constant
   74 | 2018-08-12 11:36:23
      |      ^~
a.cc:1:1: error: 'ST' does not name a type
    1 | ST
      | ^~
In file included from /usr/include/c++/14/iosfwd:42,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:81:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
   68 |   typedef ptrdiff_t     streamsize; // Signed integral type
      |           ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   40 | #include <cwchar> // For mbstate_t
  +++ |+#include <cstddef>
   41 | 
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                            ^~~~~~
In file included from /usr/include/wchar.h:35,
                 from /usr/include/c++/14/cwchar:44,
                 from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  132 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  134 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
  140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
      |                             ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
  142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
      |                               ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                          ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                            ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                                    ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
  147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                          ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
  147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                                      ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
  154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
      |                          ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
      |                                            ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
  154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
      |                                                                    ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
  155 |   __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
      |                                                                         ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
  156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
      |                          ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
      |                                            ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
  156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
      |                                                                    ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
  156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
      |                                                                      ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
  162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
      |                          ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
  162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
      |                                                                      ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
  163 |   __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
      |                                                                         ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
  164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
      |                          ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
  164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
      |                                                                      ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
  164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_va