Skip to content

Commit b29b4e2

Browse files
committedDec 16, 2023
2 parents d8e6419 + 982626b commit b29b4e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4129
-76
lines changed
 

‎README.md

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ This repository is used to store files of code that I have for competitive progr
33

44
It is not dedicated to a particular project, but rather as a store for files of code that I use on multiple machines, so as to allow synchronization.
55

6+
## Programming Contests/Websites Included:
7+
* Cornell High School Programming Contest
8+
* PClassic
9+
* Traverse CS
10+
* USACO
11+
* CodeForces
12+
* AtCoder
13+
* CSES
14+
615
## Setting up `git` for easy access
716
```sh
817
git config --global user.name "Naowal Rahman"

‎aoc/2023/day1/1.cpp

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* @author : Naowal Rahman
3+
* @created : 12/01/2023 01:47:13 PM
4+
* @filename : 1
5+
*/
6+
7+
#include <bits/stdc++.h>
8+
#include <cctype>
9+
using namespace std;
10+
using ll = long long;
11+
using pii = pair<int, int>;
12+
template<class T> using V = vector<T>;
13+
using vi = V<int>;
14+
using vpi = V<pii>;
15+
#define FOR(i, s, e) for(int i = s; i < e; i++)
16+
#define FORE(i, s, e) for(int i = s; i <= e; i++)
17+
#define ROF(i, s, e) for(int i = (e)-1; i >= s; i--)
18+
#define ROFE(i, s, e) for(int i = (e); i >= s; i--)
19+
#define all(x) (x).begin(), (x).end()
20+
#define sz(x) (int)x.size()
21+
22+
int main() {
23+
cin.tie(0) -> sync_with_stdio(0);
24+
25+
ifstream cin("1.in");
26+
27+
string s;
28+
int ans = 0;
29+
while(cin >> s) {
30+
vector<char> v;
31+
for(char c : s) {
32+
if(isdigit(c)) v.push_back(c);
33+
}
34+
string s2 = "";
35+
s2 += v.front();
36+
s2 += v.back();
37+
ans += stoi(s2);
38+
}
39+
40+
cout << ans;
41+
42+
return 0;
43+
}
44+

0 commit comments

Comments
 (0)
Please sign in to comment.