제출 #935558

#제출 시각아이디문제언어결과실행 시간메모리
935558Boycl07Ancient Machine (JOI21_ancient_machine)C++17
70 / 100
61 ms8152 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(int i = 1; i <= n; ++i) #define forn(i, l, r) for(int i = l; i <= r; ++i) #define ford(i, r, l) for(int i = r; i >= l; --i) #define FOR(i, n) for(int i = 0; i < n; ++i) #define FORD(i, n) for(int i = n - 1; i >= 0; --i) #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define endl "\n" #define task "skycrapers" #define sz(a) int(a.size()) #define C(x, y) make_pair(x, y) #define all(a) (a).begin(), (a).end() #define bit(i, mask) (mask >> i & 1) void Anna(int N, std::vector<char> S); void Send(int a); void Anna(int n, vector<char> S) { bool flag = 0; int idx = 0; while(idx < n && S[idx] != 'X') Send(0), ++idx; if(idx != n) Send(1); ++idx; while(idx < n) { if(S[idx] == 'Z') Send(1); else Send(0); ++idx; } }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(int i = 1; i <= n; ++i) #define forn(i, l, r) for(int i = l; i <= r; ++i) #define ford(i, r, l) for(int i = r; i >= l; --i) #define FOR(i, n) for(int i = 0; i < n; ++i) #define FORD(i, n) for(int i = n - 1; i >= 0; --i) #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define endl "\n" #define task "skycrapers" #define sz(a) int(a.size()) #define C(x, y) make_pair(x, y) #define all(a) (a).begin(), (a).end() #define bit(i, mask) (mask >> i & 1) void Bruno(int N, int L, std::vector<int> A); void Remove(int d); void Bruno(int n, int Len, vector<int> A) { int first = 0; while(first < n && A[first] != 1) Remove(first++); if(first == n) return; for(int i = first + 1; i < n; ++i) { int j = i; while(j < n && A[j] != 1) ++j; ford(k, j - 1, i) Remove(k); if(j != n) Remove(j); i = j; } Remove(first); }

컴파일 시 표준 에러 (stderr) 메시지

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:33:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   33 |     if(idx != n) Send(1); ++idx;
      |     ^~
Anna.cpp:33:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   33 |     if(idx != n) Send(1); ++idx;
      |                           ^~
Anna.cpp:30:10: warning: unused variable 'flag' [-Wunused-variable]
   30 |     bool flag = 0;
      |          ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...