File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ // a code snippet to read integers and long long integers faster
2+ #include < bits/stdc++.h>
3+ #define ll long long
4+ using namespace std ;
5+
6+ #ifndef ONLINE_JUDGE
7+ #define gc getchar
8+ #define pc putchar
9+ #else
10+ #define gc getchar_unlocked
11+ #define pc putchar_unlocked
12+ #endif
13+
14+ int read_int () {
15+ char c = gc ();
16+ while ((c < ' 0' || c > ' 9' ) && c != ' -' ) c = gc ();
17+ int ret = 0 , neg = 0 ;
18+ if (c == ' -' ) neg = 1 , c = gc ();
19+ while (c >= ' 0' && c <= ' 9' ) {
20+ ret = 10 * ret + c - 48 ;
21+ c = gc ();
22+ }
23+ return neg ? -ret : ret;
24+ }
25+
26+ ll read_ll () {
27+ char c = gc ();
28+ while ((c < ' 0' || c > ' 9' ) && c != ' -' ) c = gc ();
29+ ll ret = 0 ;
30+ int neg = 0 ;
31+ if (c == ' -' ) neg = 1 , c = gc ();
32+ while (c >= ' 0' && c <= ' 9' ) {
33+ ret = 10 * ret + c - 48 ;
34+ c = gc ();
35+ }
36+ return neg ? -ret : ret;
37+ }
38+
39+ int main () {
40+ int n;
41+ ll k;
42+ n = read_int ();
43+ k = read_ll ();
44+ cout<<" n = " <<n<<" k = " <<k<<" \n " ;
45+ return 0 ;
46+ }
You can’t perform that action at this time.
0 commit comments