Submission #2700784


Source Code Expand

asanomaakinoMBP:agc025 asanomaki$ vim rgb.cpp

#include <iostream>

using namespace std;

int main() {

int N, A, B, K;

cin >> N >> A >> B >> K;

int gp = A + B;

int sum = 0;

for (int i = 0; i <= N; i++) {

    for (int j = 0; j <= N - i; j++) {

        for (int k = 0; k <= N - i - j; k++) {

         int point = A * i + B * j + gp * k;
            if (point == K) {

                 sum++;
}

}
}
}

cout << sum / 998244353 << endl;
}

Submission Info

Submission Time
Task B - RGB Coloring
User asamasa612
Language C++14 (GCC 5.4.1)
Score 0
Code Size 477 Byte
Status CE

Compile Error

./Main.cpp:1:16: error: found ‘:’ in nested-name-specifier, expected ‘::’
 asanomaakinoMBP:agc025 asanomaki$ vim rgb.cpp
                ^
./Main.cpp:1:1: error: ‘asanomaakinoMBP’ does not name a type
 asanomaakinoMBP:agc025 asanomaki$ vim rgb.cpp
 ^
In file included from /usr/include/c++/5/iosfwd:40:0,
                 from /usr/include/c++/5/ios:38,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from ./Main.cpp:3:
/usr/include/c++/5/bits/postypes.h:98:11: error: ‘ptrdiff_t’ does not name a type
   typedef ptrdiff_t streamsize; // Signed integral type
           ^
In file included from /usr/include/c++/5/exception:162:0,
                 from /usr/include/c++/5/ios:39,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from ./Main.cpp:3:
/usr/include/c++/5/bits/exception_ptr.h:95:30: error: field ‘nullptr_t’ has incomplete type ‘std::__exception_ptr::exceptio...