CF 999 DIV3

A

Sweep the answer from left to right. If it is equal to n, output n, otherwise sweep from right to left again, and then the original Add the answer to the answer

#include #include using namespace std;int a[105], n, k;int main() {cin >> n >> k; for (int i = 1; i <= n; ++i) cin >> a[i]; int ans = 0; for (int i = 1; i <= n; ++ i) {if (a[i] <= k) ++ans; else break;} if (ans == n) {cout << n << endl; return 0;} for (int i = n; i> = 1; --i) {if (a[i] <= k) ++ans; else break;} cout << ans << endl; return 0;}

B

Scan it again, if it is divisible by n, then flip the entire interval from 1 to here

#include using namespace std;int main(){ int n; string s; cin>>n>>s; for(int i=1;i<=n;i++) if(n%i==0) for(register int j=0;j

C

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5652 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.