Skip to content

Commit

Permalink
solving some problems from atcoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanashii76 authored Mar 25, 2024
1 parent 88143de commit 9d02256
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Atcoder/atcoder_problemset/abc345_a.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <bits/stdc++.h>

int main(void) {

std::string s; std::cin >> s;
std::unordered_map<char, int> unmap;

for(int i = 0; i < (int)s.length(); ++i)
unmap[s[i]]++;

if(s[0] == '<' and s[s.length()-1] == '>') {
if(unmap['<'] > 1 || unmap['>'] > 1) {
std::cout << "No" << std::endl;
} else
std::cout << "Yes" << std::endl;
} else
std::cout << "No" << std::endl;

}

16 changes: 16 additions & 0 deletions Atcoder/atcoder_problemset/abc345_b.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <bits/stdc++.h>

typedef long long ll;

int main(void) {

// Can't use function ceil, because has decimal errors

ll n; std::cin >> n;
if((n+9) < 0 && ((n+9) % 10 != 0))
std::cout << (n+9) / 10-1 << std::endl;
else {
std::cout << (n+9) / 10 << std::endl;
}

}

0 comments on commit 9d02256

Please sign in to comment.