- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int a, b, c;
- cin >> a >> b >> c;
- cout << ((a-b > c)? 0 : c-(a-b)) << endl;
- return 0;
- }
Showing posts with label AtCoder. Show all posts
Showing posts with label AtCoder. Show all posts
Sunday, September 15, 2019
AtCoder Beginner Contest 136(A - Transfer)
AtCoder Beginner Contest 136(B - Uneven Numbers)
- #include< bits/stdc++.h >
- using namespace std;
- int main(){
- int n, ans = 0;
- cin >> n;
- for(int i = 1; i <= n; i++) {
- string s;
- stringstream ss;
- ss << i;
- ss >> s;
- if(s.size()%2) ans++;
- }
- cout << ans << endl;
- return 0;
- }
AtCoder Beginner Contest 136(C - Build Stairs)
- #include< bits/stdc++.h >
- using namespace std;
- int main()
- {
- int n, m;
- int vc[100001];
- cin >> n;
- for(int i = 0; i < n; i++){
- cin >> vc[i];
- }
- for(int i = n - 1; i > 0; i--) {
- if(vc[i] < vc[i-1]) vc[i - 1] -= 1;
- }
- for(int i = 1; i < n; i++) {
- if(vc[i-1] > vc[i]) return cout << "No" << endl, 0;
- }
- cout << "Yes" << endl;
- return 0;
- }
Subscribe to:
Posts (Atom)