제출 #1076024

#제출 시각아이디문제언어결과실행 시간메모리
1076024FlandreBouquet (EGOI24_bouquet)C++17
8 / 100
29 ms4188 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; // loal is the cutest girl #define ll long long #define ld long double #define pow2(x) (x)*(x) #define le left #define ri right #define fi first #define se second #define pb push_back #define all(v) v.begin(), v.end() #define pii pair<int, int> #define pll pair<long long, long long> #define isvowel(x) (x) == 'a' || (x) == 'i' || (x) == 'u' || (x) == 'e' || (x) == 'o' #define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> const ld EPS = 1e-9; const ld PI = 3.141592653589793238462643383279502884197169399375105820974944; const int maxn = 2e5+5; int n; pii a[maxn]; namespace s1ns { void solve() { cout << (n-1)/(a[0].fi+1)+1; } } namespace s2ns { void solve() { int dp[maxn]; for (int i = 0; i < n; i++) { dp[i] = 1; if (i-a[i].fi-1 >= 0) dp[i] += dp[i-a[i].fi-1]; } cout << dp[n-1]; } } signed main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; bool s1 = true, s2 = true, s4 = true; for (int i = 0; i < n; i++) { cin >> a[i].fi >> a[i].se; if (!(a[i].fi == a[i].se && a[i].fi == a[0].fi)) { s1 = false; } if (a[i].se != 0) s2 = false; if (a[i].se > 2 || a[i].fi > 2) s4 = false; } if (s1) s1ns::solve(); else if (s2) s2ns::solve(); return 0; }

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

Main.cpp: In function 'int main()':
Main.cpp:57:30: warning: variable 's4' set but not used [-Wunused-but-set-variable]
   57 |   bool s1 = true, s2 = true, s4 = true;
      |                              ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...