Submission #1306244


Source Code Expand

#include "bits/stdc++.h"
using namespace std;
#define OUT(x)                cout << #x << " = " << x << endl; 
#define rep(i, n)             for (int (i) = 0; (i) < (int)(n); (i)++)
#define rer(i, l, r)          for (int (i) = (int)(l); (i) <= (int)(r); (i)++)
#define reu(i, l, r)          for (int (i) = (int)(l); (i) < (int)(r); (i)++)
#define each(i, v)            for (auto i : v)
#define all(x)                (x).begin(), (x).end()
#define rall(x)               (x).rbegin(), (x).rend()
#define pb(x)                 push_back(x)
#define bp(x)                 __builtin_popcount(x)
#define mp(x, y)              make_pair((x), (y))
#define fi                    first
#define se                    second
#define setp(x)               setprecision(x)
#define mset(m, v)            memset(m, v, sizeof(m))
#define sz(x)                 (int)(x.size())
static const int INF        = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
static const int MOD        = 1000000007;
static const double PI      = 3.141592653589793238462643383279;

//#define int                   long long

typedef vector<double>        vd;
typedef vector<string>        vs;
typedef vector<bool>          vb;
typedef vector<int>           vi;
typedef pair<int, int>        pii;
typedef vector<pii>           vpii;

template<typename T> void pv(T a, T b) { for (T i = a; i != b; i ++) cout << *i << " "; cout << endl; }
template<typename T, typename U> inline void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if (x < y) x = y; }
int in() { int _x; scanf("%d", &_x); return _x; }
long long lin() {long long _x; scanf("%lld", &_x); return _x; };

signed main() { 
        string s;
        bool f = false;
        bool ff = false;
        string ans = "";
        int cnt = 0;
        while (cin >> s) {
                if (s == "not") {
                        cnt ++;
                } else {
                        if (cnt == 1) {
                                if (ans == "") ans += "not";
                                else ans += " not";
                        }
                        if (ans != "") ans += ' ';
                        ans += s;
                        cnt = 0;
                }
        }
        rep(i, cnt) {
                if (ans == "") ans += "not";
                else ans += " not";
        }
        cout << ans << endl;
        return 0;
}               

Submission Info

Submission Time
Task A - 二重否定除去法則
User KokiYmgch
Language C++14 (GCC 5.4.1)
Score 0
Code Size 2511 Byte
Status WA
Exec Time 2 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int in()’:
./Main.cpp:35:36: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 int in() { int _x; scanf("%d", &_x); return _x; }
                                    ^
./Main.cpp: In function ‘long long int lin()’:
./Main.cpp:36:50: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
 long long lin() {long long _x; scanf("%lld", &_x); return _x; };
                                                  ^

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 14
WA × 5
Set Name Test Cases
All scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt
Case Name Status Exec Time Memory
scrambled_00.txt AC 1 ms 256 KB
scrambled_01.txt AC 1 ms 256 KB
scrambled_02.txt AC 1 ms 256 KB
scrambled_03.txt WA 1 ms 256 KB
scrambled_04.txt WA 1 ms 256 KB
scrambled_05.txt WA 2 ms 256 KB
scrambled_06.txt AC 2 ms 256 KB
scrambled_07.txt AC 2 ms 256 KB
scrambled_08.txt WA 2 ms 256 KB
scrambled_09.txt AC 1 ms 256 KB
scrambled_10.txt AC 1 ms 256 KB
scrambled_11.txt AC 1 ms 256 KB
scrambled_12.txt AC 1 ms 256 KB
scrambled_13.txt AC 1 ms 256 KB
scrambled_14.txt WA 1 ms 256 KB
scrambled_15.txt AC 1 ms 256 KB
scrambled_16.txt AC 1 ms 256 KB
scrambled_17.txt AC 1 ms 256 KB
scrambled_18.txt AC 1 ms 256 KB