Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f5018ad

Browse files
committed
added new format to second sprint
1 parent 09cf96e commit f5018ad

File tree

4 files changed

+26
-38
lines changed

4 files changed

+26
-38
lines changed

cpp/sprint2/B/code.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
// ! Remove define before submitting !
2-
#define local
3-
4-
#ifndef local
1+
#ifdef REMOTE_JUDGE
52
#include "solution.h"
63
#endif
74

5+
#include <iostream>
86

9-
#ifdef local
7+
#ifndef REMOTE_JUDGE
108

119
#include <string>
1210

1311
struct Node {
1412
std::string value;
1513
Node* next;
16-
Node(const std::string &value, Node* next);
14+
Node(const std::string &value, Node* next) : value(value), next(next) {}
1715
};
1816

1917
#endif
2018

19+
2120
void solution(Node* head) {
2221
// Your code
2322
// ヽ(´▽`)/
23+
while (head) {
24+
std::cout << head->value << std:: endl;
25+
head = head->next;
26+
}
2427
}
2528

29+
#ifndef REMOTE_JUDGE
2630
void test() {
2731
Node node3("node3", nullptr);
2832
Node node2("node2", &node3);
@@ -36,4 +40,9 @@ void test() {
3640
node2
3741
node3
3842
*/
39-
}
43+
}
44+
45+
int main() {
46+
test();
47+
}
48+
#endif

cpp/sprint2/C/code.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
// ! Remove define before submitting !
2-
#define local
3-
4-
#ifndef local
1+
#ifdef REMOTE_JUDGE
52
#include "solution.h"
63
#endif
7-
#ifdef local
4+
5+
#ifndef REMOTE_JUDGE
86
#include <cassert>
97
#include <string>
10-
#endif
11-
12-
13-
14-
#ifdef local
158

169
struct Node {
1710
std::string value;
@@ -28,7 +21,7 @@ Node* solution(Node* head, int idx) {
2821
// ヽ(´▽`)/
2922
}
3023

31-
#ifdef local
24+
#ifndef REMOTE_JUDGE
3225
void test() {
3326
Node node3("node3", nullptr);
3427
Node node2("node2", &node3);

cpp/sprint2/D/code.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
// ! Remove define before submitting !
2-
#define local
3-
4-
#ifndef local
1+
#ifdef REMOTE_JUDGE
52
#include "solution.h"
63
#endif
74

8-
#ifdef local
5+
#ifndef REMOTE_JUDGE
96
#include <cassert>
107
#include <string>
11-
#endif
12-
13-
14-
15-
#ifdef local
168

179
struct Node {
1810
std::string value;
@@ -29,7 +21,7 @@ int solution(Node* head, const std::string& elem) {
2921
// ヽ(´▽`)/
3022
}
3123

32-
#ifdef local
24+
#ifndef REMOTE_JUDGE
3325
void test() {
3426
Node node3("node3", nullptr);
3527
Node node2("node2", &node3);

cpp/sprint2/E/code.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
// ! Remove define before submitting !
2-
#define local
3-
4-
#ifndef local
1+
#ifdef REMOTE_JUDGE
52
#include "solution.h"
63
#endif
74

8-
#ifdef local
5+
#ifndef REMOTE_JUDGE
96
#include <cassert>
107
#include <string>
11-
#endif
12-
138

14-
#ifdef local
159
struct Node {
1610
Node(const std::string &value, Node* next, Node* prev)
1711
: value(value)
@@ -29,7 +23,7 @@ Node* solution(Node* head) {
2923
// ヽ(´▽`)/
3024
}
3125

32-
#ifdef local
26+
#ifndef REMOTE_JUDGE
3327
void test() {
3428
Node node3("node3", nullptr, nullptr);
3529
Node node2("node2", nullptr, nullptr);

0 commit comments

Comments
 (0)