problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02264
C++
Memory Limit Exceeded
// // ALDS1_3_B.cpp // // // Created by mk on 2015/12/02. // // #include <iostream> #include <stdio.h> #include <string.h> #define LEN 100005 using namespace ::std; typedef struct pp { char name[1000]; int t; } P; P Q[LEN]; int head, tail, n; void enqueue(P x) { Q[tail] = x; tail = (tail + 1) % LEN; } P...
// // ALDS1_3_B.cpp // // // Created by mk on 2015/12/02. // // #include <iostream> #include <stdio.h> #include <string.h> #define LEN 100005 using namespace ::std; typedef struct pp { char name[100]; int t; } P; P Q[LEN]; int head, tail, n; void enqueue(P x) { Q[tail] = x; tail = (tail + 1) % LEN; } P ...
replace
16
17
16
17
MLE
p02264
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, q; cin >> n; cin >> q; // vector<int> tm[n]; // vector<string> name[n]; int tm[100000]; string name[100000]; int total = 0; //??????????????¨ for (int i = 0; i < n; i++) { cin >> name[i]; cin >> tm[i]; total += tm[i]; } ...
#include <bits/stdc++.h> using namespace std; int main() { int n, q; cin >> n; cin >> q; // vector<int> tm[n]; // vector<string> name[n]; int tm[100000]; string name[100000]; int total = 0; //??????????????¨ for (int i = 0; i < n; i++) { cin >> name[i]; cin >> tm[i]; total += tm[i]; } ...
replace
20
23
20
23
TLE
p02264
C++
Runtime Error
#include <array> #include <iostream> using namespace std; struct Process { string name; int time; }; class ProcessQueue { public: ProcessQueue(){}; virtual ~ProcessQueue(){}; bool push(Process &process) { if (isFull()) { return false; } queue[head] = process; head++; if (head == ...
#include <array> #include <iostream> using namespace std; struct Process { string name; int time; }; class ProcessQueue { public: ProcessQueue() : head(), tail(), queue(){}; virtual ~ProcessQueue(){}; bool push(Process &process) { if (isFull()) { return false; } queue[head] = process; ...
replace
12
13
12
13
-11
p02264
C++
Runtime Error
#include <iostream> #include <string> using namespace std; struct Process { char name[10]; int time; }; static const int MAX = 10000; Process P[MAX]; int tail, head; void enqueue(struct Process &p) { P[tail] = p; tail = (tail + 1) % MAX; } void dequeue(struct Process &p) { p = P[head]; head = (head + 1...
#include <iostream> #include <string> using namespace std; struct Process { char name[10]; int time; }; static const int MAX = 100000; Process P[MAX]; int tail, head; void enqueue(struct Process &p) { P[tail] = p; tail = (tail + 1) % MAX; } void dequeue(struct Process &p) { p = P[head]; head = (head + ...
replace
10
11
10
11
0
p02264
C++
Runtime Error
#include <iostream> #include <queue> #include <string> using namespace std; #define max_datasets 1000000 int main() { queue<string> data1; queue<int> data2; string kari_data1; int kari_data2; int all_time = 0; int n, q; string name[max_datasets]; int time[max_datasets]; cin >> n >> q; for (int...
#include <iostream> #include <queue> #include <string> using namespace std; #define max_datasets 500000 int main() { queue<string> data1; queue<int> data2; string kari_data1; int kari_data2; int all_time = 0; int n, q; string name[max_datasets]; int time[max_datasets]; cin >> n >> q; for (int ...
replace
6
7
6
7
-11
p02264
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int que[100000]; int head = 0; int tail = 0; void enq(int a) { que[tail] = a; tail = (tail + 1) % 100000; } int deq() { return que[head++]; } bool empty() { return head == tail; } int main() { int n, q; char name[100000][11]; int time[100000]; int clock = 0;...
#include <bits/stdc++.h> using namespace std; int que[100000]; int head = 0; int tail = 0; void enq(int a) { que[tail] = a; tail = (tail + 1) % 100000; } int deq() { int h = head; head = (head + 1) % 100000; return que[h]; } bool empty() { return head == tail; } int main() { int n, q; char name[100000...
replace
11
12
11
16
0
p02264
C++
Runtime Error
#include <cstdlib> #include <iostream> #include <string> #define N 10000 using namespace std; class Queue { private: int num[N]; int head; int tail; public: Queue() { head = 0; tail = 0; } // add to head position void push(int x) { num[tail] = x; tail++; } // delete head position ...
#include <cstdlib> #include <iostream> #include <string> #define N 100000 using namespace std; class Queue { private: int num[N]; int head; int tail; public: Queue() { head = 0; tail = 0; } // add to head position void push(int x) { num[tail] = x; tail++; } // delete head position ...
replace
4
5
4
5
0
p02264
C++
Runtime Error
#include <cstring> #include <iostream> using namespace std; int main() { int n, q, head = -1, tail, time_queue[100001] = {}, now = 0; char name_queue[100001][15]; cin >> n >> q; for (int i = 0; i < n; i++) cin >> name_queue[i] >> time_queue[i]; tail = (n - 1) % 100001; while (tail != head) { head++...
#include <cstring> #include <iostream> using namespace std; int main() { int n, q, head = -1, tail, time_queue[100001] = {}, now = 0; char name_queue[100001][15]; cin >> n >> q; for (int i = 0; i < n; i++) cin >> name_queue[i] >> time_queue[i]; tail = (n - 1) % 100001; while (tail != head) { head =...
replace
12
13
12
13
0
p02264
C++
Runtime Error
#include <iostream> using namespace std; int Q[100000]; int f = 0, e = 0, f2 = 0, e2 = 0; int Q2[100000]; void input_time(int a) { Q[e] = a; e = (e + 1) % 100000; } int output_time() { int a = Q[f]; f = (f + 1) % 100000; return a; } void input_name(int a) { Q2[e2] = a; e2 = (e2 + 1) % 100000; } int o...
#include <iostream> using namespace std; int Q[100000]; int f = 0, e = 0, f2 = 0, e2 = 0; int Q2[100000]; void input_time(int a) { Q[e] = a; e = (e + 1) % 100000; } int output_time() { int a = Q[f]; f = (f + 1) % 100000; return a; } void input_name(int a) { Q2[e2] = a; e2 = (e2 + 1) % 100000; } int o...
replace
29
30
29
30
0
p02264
C++
Runtime Error
#include <algorithm> #include <iostream> #define MAX 100005 using namespace std; struct process { int time; string name; }; class my_queue { private: int head, tail; process queue[100000]; public: my_queue() { head = 0; tail = 0; } bool isEmpty() { return head == tail; } bool isFull() { r...
#include <algorithm> #include <iostream> #define MAX 100005 using namespace std; struct process { int time; string name; }; class my_queue { private: int head, tail; process queue[MAX]; public: my_queue() { head = 0; tail = 0; } bool isEmpty() { return head == tail; } bool isFull() { retu...
replace
15
16
15
16
0
p02264
C++
Runtime Error
#include <cstdlib> #include <iostream> #include <vector> #define SIZE 200 using namespace std; struct Queue { int list[SIZE]; int head, tail; void init() { head = tail = 0; } bool isEmpty() { return head == tail; } bool isFull() { return head == (tail + 1) % SIZE; } // int head(){ return list[head]; } //...
#include <cstdlib> #include <iostream> #include <vector> #define SIZE 100005 using namespace std; struct Queue { int list[SIZE]; int head, tail; void init() { head = tail = 0; } bool isEmpty() { return head == tail; } bool isFull() { return head == (tail + 1) % SIZE; } // int head(){ return list[head]; } ...
replace
3
4
3
4
0
p02264
C++
Runtime Error
#include <iostream> #include <string> using namespace std; struct Process { string name; int time; }; int main() { int n, q; Process P[100000]; cin >> n >> q; for (int i = 0; i < n; i++) { cin >> P[i].name >> P[i].time; } int count = 0; int origin = n; for (int i = 0; i < n; i++) { P[...
#include <iostream> #include <string> using namespace std; struct Process { string name; int time; }; int main() { int n, q; Process P[1000000]; cin >> n >> q; for (int i = 0; i < n; i++) { cin >> P[i].name >> P[i].time; } int count = 0; int origin = n; for (int i = 0; i < n; i++) { P...
replace
12
13
12
13
0
p02264
C++
Time Limit Exceeded
#include <iostream> #include <queue> #include <string> using namespace std; int main() { int n, q; int elapsed_time = 0; //???????????? queue<int> TIME; queue<string> NAME; cin >> n >> q; //??\??? for (int i = 0; i < n; i++) { string name; int time; cin >> name >> time; NAME.push(name);...
#include <iostream> #include <queue> #include <string> using namespace std; int main() { int n, q; int elapsed_time = 0; //???????????? queue<int> TIME; queue<string> NAME; cin >> n >> q; //??\??? for (int i = 0; i < n; i++) { string name; int time; cin >> name >> time; NAME.push(name);...
replace
32
33
32
33
TLE
p02264
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; pair<string, int> p[10000000]; pair<string, int> key; int tail; int head; void push(string str, int n) { p[tail].first = str; p[tail].second = n; tail++; } void pop() { key = p[head]; head++; } int main() { int n, q; cin >> n >> q; for (int i = 0; i < n...
#include <bits/stdc++.h> using namespace std; pair<string, int> p[1000000]; pair<string, int> key; int tail; int head; void push(string str, int n) { p[tail].first = str; p[tail].second = n; tail++; } void pop() { key = p[head]; head++; } int main() { int n, q; cin >> n >> q; for (int i = 0; i < n;...
replace
3
4
3
4
MLE
p02264
C++
Runtime Error
#include <iostream> #define INT_MAX 2147483647 struct Process { std::string name; int time; }; class Queue { private: Process Table[INT_MAX]; int head; int top; public: Queue() { head = 0; top = 0; }; void Enqueue(Process P) { Table[top++] = P; }; Process Dequeue() { return Table[head++]; }...
#include <iostream> #define INT_MAX 2147483647 struct Process { std::string name; int time; }; class Queue { private: Process Table[1000000]; int head; int top; public: Queue() { head = 0; top = 0; }; void Enqueue(Process P) { Table[top++] = P; }; Process Dequeue() { return Table[head++]; }...
replace
10
11
10
11
-11
p02264
C++
Runtime Error
#include <iostream> #include <string> #include <utility> using namespace std; int main(void) { int Q[100001]; int tail = 0, head = 0; pair<string, int> p[100001]; int n, q, su = 0; cin >> n >> q; for (int i = 0; i < n; i++) { cin >> p[i].first >> p[i].second; Q[tail] = i; tail++; su += p[i...
#include <iostream> #include <string> #include <utility> using namespace std; int main(void) { int Q[1000000]; int tail = 0, head = 0; pair<string, int> p[100001]; int n, q, su = 0; cin >> n >> q; for (int i = 0; i < n; i++) { cin >> p[i].first >> p[i].second; Q[tail] = i; tail++; su += p[...
replace
6
7
6
7
0
p02264
C++
Runtime Error
#include <iostream> #include <string> #include <vector> #define MAX 100000 using namespace std; struct pp { int t; string s; }; class queue { public: int head; int tail; vector<pp> v; queue(); void enqueue(pp x); pp dequeue(); bool isEmpty(); }; queue::queue() { head = 0; tail = 0; v.resize(M...
#include <iostream> #include <string> #include <vector> #define MAX 1000000 using namespace std; struct pp { int t; string s; }; class queue { public: int head; int tail; vector<pp> v; queue(); void enqueue(pp x); pp dequeue(); bool isEmpty(); }; queue::queue() { head = 0; tail = 0; v.resize(...
replace
3
4
3
4
0
p02264
C++
Runtime Error
#include <iostream> using namespace std; int head, tail, n; struct task { char name[100]; int time; } t, Q[100005]; void enqueue(task x) { Q[tail] = x; tail++; } task dequeue() { task x = Q[head]; head++; return x; } int main() { int q; cin >> n >> q; for (int i = 1; i <= n; i++) cin >> Q[i].nam...
#include <iostream> using namespace std; int head, tail, n; struct task { char name[100]; int time; } t, Q[1000000]; void enqueue(task x) { Q[tail] = x; tail++; } task dequeue() { task x = Q[head]; head++; return x; } int main() { int q; cin >> n >> q; for (int i = 1; i <= n; i++) cin >> Q[i].na...
replace
6
7
6
7
0
p02265
C++
Time Limit Exceeded
#include <cassert> #include <algorithm> #include <deque> #include <iostream> #include <string> using namespace std; #define DEBUG(x) cerr << #x << " = " << x << endl int main() { int n; cin >> n; deque<int> l; while (n--) { string s; cin >> s; if (s == "insert") { int x; cin >> x; ...
#include <cassert> #include <algorithm> #include <deque> #include <iostream> #include <string> using namespace std; #define DEBUG(x) cerr << #x << " = " << x << endl int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; deque<int> l; while (n--) { string s; cin >> s; ...
insert
12
12
12
15
TLE
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++) using namespace std; typedef long long ll; int main(void) { ll N; cin >> N; deque<ll> q; REP(i, 0, N) { string C; ll X; cin >> C; if (C == "insert" || C == "delete") cin >> X; if (C == "insert") { ...
#include <bits/stdc++.h> #define REP(i, a, n) for (ll i = ((ll)a); i < ((ll)n); i++) using namespace std; typedef long long ll; int main(void) { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; deque<ll> q; REP(i, 0, N) { string C; ll X; cin >> C; if (C == "insert" || C == "delete"...
insert
6
6
6
9
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <list> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { int n, a; string str; list<int> l; cin >> n; for (int i = 0; i < n; i++) { cin >> str; if (str == "insert") { cin >> a; l.push_...
#include <algorithm> #include <iostream> #include <list> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; int main() { int n, a; string str; list<int> l; cin >> n; for (int i = 0; i < n; i++) { cin >> str; if (str == "insert") { cin >> a; l.push_...
replace
23
26
23
28
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <iterator> #include <list> #include <string> using namespace std; int main() { // const string // str_insert = "insert", // str_delete = "delete", // str_delete_first = "deleteFirst", // str_delete_last = "deleteLast"; int N; cin >> N; list<i...
#include <algorithm> #include <iostream> #include <iterator> #include <list> #include <string> using namespace std; int main() { ios::sync_with_stdio(false); // const string // str_insert = "insert", // str_delete = "delete", // str_delete_first = "deleteFirst", // str_delete_last = "deleteLast"; ...
insert
9
9
9
10
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> using namespace std; struct Node { int data; Node *next, *prev; }; class List { Node *nil; Node *searchNode(int x) { Node *p = nil->next; while (p != nil && p->data != x) { p = p->next; } return p; } void deleteNode(Node *node) { if (node == nil) return...
#include <iostream> using namespace std; struct Node { int data; Node *next, *prev; }; class List { Node *nil; Node *searchNode(int x) { Node *p = nil->next; while (p != nil && p->data != x) { p = p->next; } return p; } void deleteNode(Node *node) { if (node == nil) return...
insert
57
57
57
60
TLE
p02265
C++
Runtime Error
#include <iostream> #include <list> #include <sstream> #include <string> using namespace std; list<int>::iterator find_key(list<int> &li, int key) { list<int>::iterator li_itr = li.begin(); while (li_itr != li.end()) { if (*li_itr == key) { return li_itr; } ++li_itr; } return li.end(); } int...
#include <iostream> #include <list> #include <sstream> #include <string> using namespace std; list<int>::iterator find_key(list<int> &li, int key) { list<int>::iterator li_itr = li.begin(); while (li_itr != li.end()) { if (*li_itr == key) { return li_itr; } ++li_itr; } return li.end(); } int...
replace
38
39
38
42
0
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #define REP(i, a, b) for (i = a; i < b; i++) #define rep(i, n) REP(i, 0, n) using namespace std; int main() { list<int> data; list<int>::iterator it; int key, n, i; string command; cin >> n; rep(i, n) { cin >> command; if (command == "insert") { cin >> k...
#include <iostream> #include <list> #define REP(i, a, b) for (i = a; i < b; i++) #define rep(i, n) REP(i, 0, n) using namespace std; int main() { std::cin.tie(0); // tie std::ios::sync_with_stdio(false); // sync list<int> data; list<int>::iterator it; int key, n, i; string command; c...
insert
9
9
9
12
TLE
p02265
C++
Runtime Error
#include <iostream> #include <string> using namespace std; class Node { private: int data; Node *next; Node *prev; public: Node() { next = NULL; prev = NULL; } void setData(int data) { this->data = data; } void setNext(Node *next) { this->next = next; } void setPrev(Node *prev) { this->prev = ...
#include <iostream> #include <string> using namespace std; class Node { private: int data; Node *next; Node *prev; public: Node() { next = NULL; prev = NULL; } void setData(int data) { this->data = data; } void setNext(Node *next) { this->next = next; } void setPrev(Node *prev) { this->prev = ...
replace
65
66
65
66
0
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; Node *search(int k) { Node *x = nil->next; while (x != nil && x->key != k) x = x->next; return x; } void insert(int k) { No...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; Node *search(int k) { Node *x = nil->next; while (x != nil && x->key != k) x = x->next; return x; } void insert(int k) { No...
insert
35
35
35
37
TLE
p02265
C++
Time Limit Exceeded
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <string> #include ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <string> #include ...
delete
171
174
171
171
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <stdlib.h> #include <string> using namespace std; class node { public: int data; node *prev; node *next; node() { prev = 0; next = 0; data = 0; } node(int data) { prev = 0; next = 0; this->data = data; } node(int data, node *next) { prev = 0; ...
#include <iostream> #include <stdlib.h> #include <string> using namespace std; class node { public: int data; node *prev; node *next; node() { prev = 0; next = 0; data = 0; } node(int data) { prev = 0; next = 0; this->data = data; } node(int data, node *next) { prev = 0; ...
replace
112
113
112
113
TLE
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb push_back #defi...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define each(itr, v) for (auto itr : v) #define pb push_back #defi...
insert
35
35
35
38
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <list> using namespace std; int main() { int n, k; char s[15]; list<int> l; scanf("%d", &n); while (n--) { scanf("%s", s); if (*s == 'i') { scanf("%d", &k); l.push_front(k); continue; } switch (*(s + 6)) { case 'F': ...
#include <algorithm> #include <cstdio> #include <list> using namespace std; int main() { int n, k; char s[15]; list<int> l; scanf("%d", &n); while (n--) { scanf("%s", s); if (*s == 'i') { scanf("%d", &k); l.push_front(k); continue; } switch (*(s + 6)) { case 'F': ...
replace
28
29
28
31
0
p02265
C++
Time Limit Exceeded
#include <iostream> #include <queue> #include <string> using namespace std; deque<int> dll; void printList() { deque<int>::iterator itr = dll.begin(); deque<int>::iterator itrE = dll.end(); for (; itr != itrE; itr++) { cout << *itr; if (itr != itrE - 1) cout << ' '; } cout << endl; } int mai...
#include <iostream> #include <queue> #include <string> using namespace std; deque<int> dll; void printList() { deque<int>::iterator itr = dll.begin(); deque<int>::iterator itrE = dll.end(); for (; itr != itrE; itr++) { cout << *itr; if (itr != itrE - 1) cout << ' '; } cout << endl; } int mai...
insert
21
21
21
22
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> // require sort next_permutation count __gcd reverse etc. #include <cctype> // require tolower, toupper #include <cfloat> #include <climits> #include <cmath> // require fabs #include <cstdio> // require scanf printf #include <cstdlib> // require abs exit atof atoi #include <cstring> // requir...
#include <algorithm> // require sort next_permutation count __gcd reverse etc. #include <cctype> // require tolower, toupper #include <cfloat> #include <climits> #include <cmath> // require fabs #include <cstdio> // require scanf printf #include <cstdlib> // require abs exit atof atoi #include <cstring> // requir...
insert
34
34
34
35
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; int main() { int n; cin >> n; list<int> L; for (int i = 0; i < n; ++i) { string s; cin >> s; if (s == "insert") { int v; scanf("%d", &v); L.push_front(v); } else if (s == "delete") { int v; ...
#include <iostream> #include <list> #include <string> using namespace std; int main() { int n; scanf("%d", &n); list<int> L; for (int i = 0; i < n; ++i) { string s; cin >> s; if (s == "insert") { int v; scanf("%d", &v); L.push_front(v); } else if (s == "delete") { i...
replace
9
10
9
10
TLE
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <cstdlib> #include <cstring> struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *cur = (Node *)malloc(sizeof(Node)); cur->key = key; cur->next = nil->next...
#include <cstdio> #include <cstdlib> #include <cstring> struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *cur = (Node *)malloc(sizeof(Node)); cur->key = key; cur->next = nil->next...
insert
46
46
46
48
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <memory> using namespace std; template <typename T> class Node { private: T _key; shared_ptr<Node<T>> _next; weak_ptr<Node<T>> _prev; public: Node(T k) : _key(k), _next(nullptr), _prev() {} T key() const { return _key; } shared_ptr<Node<T>> next() const { return _next; } s...
#include <iostream> #include <memory> using namespace std; template <typename T> class Node { private: T _key; shared_ptr<Node<T>> _next; weak_ptr<Node<T>> _prev; public: Node(T k) : _key(k), _next(nullptr), _prev() {} T key() const { return _key; } shared_ptr<Node<T>> next() const { return _next; } s...
insert
112
112
112
115
TLE
p02265
C++
Runtime Error
#include <iostream> #include <list> using namespace std; int main() { list<int> list; int n; cin >> n; string cmd; int i, arg; for (i = 0; i < n; i++) { cin >> cmd; if (cmd == "insert") { cin >> arg; list.push_front(arg); } else if (cmd == "delete") { cin >> arg; int p...
#include <iostream> #include <list> using namespace std; int main() { list<int> list; int n; cin >> n; string cmd; int i, arg; for (i = 0; i < n; i++) { cin >> cmd; if (cmd == "insert") { cin >> arg; list.push_front(arg); } else if (cmd == "delete") { cin >> arg; int p...
replace
25
26
25
27
0
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <climits> #include <cmath> #include <cstdint> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; struct Node { Node *prev; Node *next; int value; Node(Node *prev, Node *next, int value) : prev(...
#include <algorithm> #include <climits> #include <cmath> #include <cstdint> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <string> #include <vector> using namespace std; struct Node { Node *prev; Node *next; int value; Node(Node *prev, Node *next, int value) : prev(...
insert
74
74
74
77
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> using namespace std; int main() { list<int> s; list<int>::iterat...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <utility> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); c...
insert
18
18
18
20
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; struct Node { int key; Node *prev; Node *next; }; class List { Node *nil; void delete_node(Node *n) { n->prev->next = n->next; n->next->prev = n->prev; delete n; } public: List() { nil = new Node; nil->prev = nil; nil->n...
#include <iostream> #include <string> using namespace std; struct Node { int key; Node *prev; Node *next; }; class List { Node *nil; void delete_node(Node *n) { n->prev->next = n->next; n->next->prev = n->prev; delete n; } public: List() { nil = new Node; nil->prev = nil; nil->n...
insert
53
53
53
55
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; int main() { list<int> L; int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; if (s == "deleteFirst") { L.pop_front(); continue; } if (s == "deleteLast") { L.pop_back(); continu...
#include <iostream> #include <list> #include <string> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); list<int> L; int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; if (s == "deleteFirst") { L.pop_front(); continue; } if (s == "del...
insert
6
6
6
8
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> using namespace std; class list { public: int val; list *prev; list *next; }; list *head = NULL; list *tail = NULL; void insert_(int val) { list *element; element = new list; element->val = val; element->prev = NULL; if (head == NULL) { element->next = NULL; tail = element;...
#include <iostream> using namespace std; class list { public: int val; list *prev; list *next; }; list *head = NULL; list *tail = NULL; void insert_(int val) { list *element; element = new list; element->val = val; element->prev = NULL; if (head == NULL) { element->next = NULL; tail = element;...
insert
82
82
82
84
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) int main() { int n; string st; int x; cin >> n; list<int> L; list<int>::iterator it, endit; while (n--) { cin >> st; if (st == "insert") { cin >> x; L.push_...
#include <iostream> #include <list> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; ++i) int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n; string st; int x; cin >> n; list<int> L; list<int>::iterator it, endit; while (n--) { cin >> st; ...
insert
8
8
8
11
TLE
p02265
C++
Time Limit Exceeded
#include <assert.h> #include <iostream> using namespace std; struct Node; typedef Node *Node_ptr; struct Node { int key; Node_ptr prev, next; Node(int key_ = -1, Node_ptr prev_ = NULL, Node_ptr next_ = NULL) : key(key_), prev(prev_), next(next_) {} }; class LinkedList { private: Node_ptr head, tail; p...
#include <assert.h> #include <iostream> using namespace std; struct Node; typedef Node *Node_ptr; struct Node { int key; Node_ptr prev, next; Node(int key_ = -1, Node_ptr prev_ = NULL, Node_ptr next_ = NULL) : key(key_), prev(prev_), next(next_) {} }; class LinkedList { private: Node_ptr head, tail; p...
insert
92
92
92
95
TLE
p02265
C++
Runtime Error
#include <cstdio> #include <iostream> using namespace std; typedef int data_t; typedef struct tag_node { tag_node *before_; data_t data_; tag_node *next_; } node_t; class List { node_t *head_; node_t *FindNodeFromBefore(data_t) const; node_t *FindLastNode(void) const; public: List(void); void Insert...
#include <cstdio> #include <iostream> using namespace std; typedef int data_t; typedef struct tag_node { tag_node *before_; data_t data_; tag_node *next_; } node_t; class List { node_t *head_; node_t *FindNodeFromBefore(data_t) const; node_t *FindLastNode(void) const; public: List(void); void Insert...
replace
40
41
40
41
0
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <stdio.h> #include <string> using namespace std; list<int> lst; int main() { int dataset; scanf("%d", &dataset); for (int i = 0; i < dataset; i++) { string order; cin >> order; if (order[0] == 'i') { int a; scanf("%d", &a); lst.push_fron...
#include <iostream> #include <list> #include <stdio.h> #include <string> using namespace std; list<int> lst; int main() { int dataset; scanf("%d", &dataset); for (int i = 0; i < dataset; i++) { char order[20]; scanf("%s", order); if (order[0] == 'i') { int a; scanf("%d", &a); lst.p...
replace
12
14
12
14
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); string s; int n, i, a; list<int> li; list<int>::iterator p = li.begin(); cin >> n; for (i = 0; i < n; i++) { cin >> s; if (s == "inser...
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); string s; int n, i, a; list<int> li; list<int>::iterator p = li.begin(); cin >> n; for (i = 0; i < n; i++) { cin >> s; if (s == "inser...
replace
23
24
23
25
0
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { string s; int n, i, a; list<int> li; list<int>::iterator p = li.begin(); cin >> n; for (i = 0; i < n; i++) { cin >> s; if (s == "insert") { cin >> a; li.push_front(a); } els...
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); string s; int n, i, a; list<int> li; list<int>::iterator p = li.begin(); cin >> n; for (i = 0; i < n; i++) { cin >> s; if (s == "inser...
insert
7
7
7
9
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; void print_list(list<int> &V) { for (list<int>::iterator it = V.begin(); it != V.end(); it++) { if (it == V.begin()) { cout << *it; } else { cout << " " << *it; } } cout << endl; } int main(void) { list<int> V; ...
#include <iostream> #include <list> #include <string> using namespace std; void print_list(list<int> &V) { for (list<int>::iterator it = V.begin(); it != V.end(); it++) { if (it == V.begin()) { cout << *it; } else { cout << " " << *it; } } cout << endl; } int main(void) { ios_base::syn...
insert
17
17
17
19
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *...
#include <algorithm> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *...
insert
56
56
56
57
-11
p02265
C++
Time Limit Exceeded
#include <iostream> #include <stdlib.h> using namespace std; struct Node { int key; Node *next; Node *prev; }; struct List { Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; nil->key = 0; } Node *find(int key) { for (Node *i = nil->nex...
#include <iostream> #include <stdlib.h> using namespace std; struct Node { int key; Node *next; Node *prev; }; struct List { Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; nil->key = 0; } Node *find(int key) { for (Node *i = nil->nex...
insert
78
78
78
81
TLE
p02265
C++
Runtime Error
// -*- mode:c++; coding:utf-8; indent-tabs-mode:nil; -*- // ALDS1_3-C: Doubly Linked List #include <cassert> #include <cstdio> template <typename T> class doubly_linked_list { struct node { node *prev_; node *next_; T x_; }; node sentinel_; public: doubly_linked_list() { sentinel_.prev_ = sentine...
// -*- mode:c++; coding:utf-8; indent-tabs-mode:nil; -*- // ALDS1_3-C: Doubly Linked List #include <cassert> #include <cstdio> template <typename T> class doubly_linked_list { struct node { node *prev_; node *next_; T x_; }; node sentinel_; public: doubly_linked_list() { sentinel_.prev_ = sentine...
insert
30
30
30
33
0
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <iostream> #include <list> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #define LEN 100005 using namespace std; // list実装 int main() { list<int> l; int n; cin >> n; for (int i = 0; i < n; i++) { string c; cin ...
#include <algorithm> #include <cctype> #include <cmath> #include <iostream> #include <list> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #define LEN 100005 using namespace std; // list実装 int main() { list<int> l; int n; scanf("%d", &n); for (int i = 0; i < n; i++) { string c; ...
replace
16
17
16
17
TLE
p02265
C++
Runtime Error
#include <iostream> #include <string> #include <vector> using namespace std; typedef struct _list_ { struct _list_ *prev; int value; struct _list_ *next; } list; int main(void) { int max, count; vector<list> x(100000); string a; x[0].value = -1; x[1].value = -1; x[0].next = &x[1]; x[1].prev = &x...
#include <iostream> #include <string> #include <vector> using namespace std; typedef struct _list_ { struct _list_ *prev; int value; struct _list_ *next; } list; int main(void) { int max, count; vector<list> x(2000000); string a; x[0].value = -1; x[1].value = -1; x[0].next = &x[1]; x[1].prev = &...
replace
14
15
14
15
0
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main(void) { list<int> l; int n; cin >> n; for (int i = 0; i < n; i++) { string s; int k; cin >> s; if (s == "insert") { cin >> k; l.emplace_front(k); } else if (s == "delete") { cin >> k; auto it = find(l.begin(), l....
#include <bits/stdc++.h> using namespace std; int main(void) { cin.tie(0); ios::sync_with_stdio(false); list<int> l; int n; cin >> n; for (int i = 0; i < n; i++) { string s; int k; cin >> s; if (s == "insert") { cin >> k; l.emplace_front(k); } else if (s == "delete") { ...
insert
4
4
4
6
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <cassert> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <sstream> using namespace std; #define REP(i, x, n) for (int i = x; i < n; i++) #define rep(i, n) REP(i, 0, n) int main() { list<int> data; list<int>::iterator it; int...
#include <algorithm> #include <cassert> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <sstream> using namespace std; #define REP(i, x, n) for (int i = x; i < n; i++) #define rep(i, n) REP(i, 0, n) int main() { std::ios::sync_with_stdio(false); std::cin.ti...
insert
16
16
16
18
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; void Command(list<int> &X, string &c) { if (c == "insert") { int d; cin >> d; X.push_front(d); } else if (c == "delete") { int d; cin >> d; list<int>::iterator itr = X.begin(); while (*itr != d && itr != X.end())...
#include <iostream> #include <list> #include <string> using namespace std; void Command(list<int> &X, string &c) { if (c == "insert") { int d; cin >> d; X.push_front(d); } else if (c == "delete") { int d; cin >> d; list<int>::iterator itr = X.begin(); while (*itr != d && itr != X.end())...
insert
28
28
28
30
TLE
p02265
C++
Runtime Error
#include <cassert> #include <iostream> #include <string> class list { private: struct TElement { int Value; TElement *PrevAd; TElement *NextAd; }; TElement *FStartElement; TElement *FLastElement; public: class iterator { friend class list; public: iterator(TElement *AElement); boo...
#include <cassert> #include <iostream> #include <string> class list { private: struct TElement { int Value; TElement *PrevAd; TElement *NextAd; }; TElement *FStartElement; TElement *FLastElement; public: class iterator { friend class list; public: iterator(TElement *AElement); boo...
replace
78
79
78
83
0
p02265
C++
Time Limit Exceeded
#include <cstdlib> #include <iostream> #include <string> using namespace std; int N; struct List { struct ListI { ListI *next; ListI *prev; int value; ListI(ListI *n, ListI *p, int v) : next(n), prev(p), value(v) {} void *operator new(size_t, void *p) { return p; } static ListI *create(L...
#include <cstdlib> #include <iostream> #include <string> using namespace std; int N; struct List { struct ListI { ListI *next; ListI *prev; int value; ListI(ListI *n, ListI *p, int v) : next(n), prev(p), value(v) {} void *operator new(size_t, void *p) { return p; } static ListI *create(L...
insert
117
117
117
120
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const int len = 1000050; inline int prev(int pos) { return (pos == 0) ? len - 1 : pos - 1; } inline int next(int pos) { return (pos == len - 1) ? 0 : pos + 1; } int main() { int n; cin >> n; vector<int> list(len)...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; const int len = 1000050; inline int prev(int pos) { return (pos == 0) ? len - 1 : pos - 1; } inline int next(int pos) { return (pos == len - 1) ? 0 : pos + 1; } int main() { ios::sync_with_stdio(false); cin.tie(0);...
insert
13
13
13
15
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); string str; list<int> data; list<int>::iterator it, l; int n, x; cin >> n; while (n--) { cin >> str; if (str == "insert") { cin >...
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); string str; list<int> data; list<int>::iterator it, l; int n, x; cin >> n; while (n--) { cin >> str; if (str == "insert") { cin >...
replace
21
22
21
24
0
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <cstdlib> #include <cstring> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *)malloc(sizeof(Node)); x->key = key; x->...
#include <cstdio> #include <cstdlib> #include <cstring> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *)malloc(sizeof(Node)); x->key = key; x->...
replace
30
31
30
31
TLE
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <cstdlib> #include <cstring> struct Node { int key; Node *next, *prev; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void printList() { Node *cur = nil->next; int isf = 0; while (1) { if (cur == nil) break; ...
#include <cstdio> #include <cstdlib> #include <cstring> struct Node { int key; Node *next, *prev; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void printList() { Node *cur = nil->next; int isf = 0; while (1) { if (cur == nil) break; ...
replace
32
33
32
33
TLE
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; signed main() { cin.tie(0); int n; cin >> n; list<int> l; for (int i = 0; i < n; i++) { string s; int x; cin >> s; if (s == "insert" || s == "delete") cin >> x; if (s == "deleteFirst") { l.pop_front(); continue; } if (...
#include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; list<int> l; for (int i = 0; i < n; i++) { string s; int x; cin >> s; if (s == "insert" || s == "delete") cin >> x; if (s == "deleteFirst") { l.pop_front();...
insert
3
3
3
4
TLE
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <cstring> #include <iostream> struct list { int val; list *next; list *prev; }; list *head; void init() { head = new list; head->next = head; head->prev = head; } int main() { using namespace std; int len, key; cin >> len; char str[12]; init(); for (int i = 0; i < len;...
#include <cstdio> #include <cstring> #include <iostream> struct list { int val; list *next; list *prev; }; list *head; void init() { head = new list; head->next = head; head->prev = head; } int main() { using namespace std; int len, key; cin >> len; char str[12]; init(); for (int i = 0; i < len;...
insert
50
50
50
52
TLE
p02265
C++
Time Limit Exceeded
#include <cstdlib> #include <cstring> #include <iostream> #include <stdio.h> using namespace std; struct Node { int key; Node *pre; Node *next; }; Node *nil; void init() { nil = new Node; nil->pre = nil; nil->next = nil; } void insert(int x) { Node *add = new Node; add->key = x; add->next = nil->next;...
#include <cstdlib> #include <cstring> #include <iostream> #include <stdio.h> using namespace std; struct Node { int key; Node *pre; Node *next; }; Node *nil; void init() { nil = new Node; nil->pre = nil; nil->next = nil; } void insert(int x) { Node *add = new Node; add->key = x; add->next = nil->next;...
replace
36
37
36
37
TLE
p02265
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { list<int> l; int n; string cmd; int x; cin >> n; for (int i = 0; i < n; i++) { cin >> cmd; if (cmd == "insert") { cin >> x; l.push_front(x); } else if (cmd == "delete") { cin >> x; l.erase(find(begin(l), end(l),...
#include <bits/stdc++.h> using namespace std; int main() { list<int> l; int n; string cmd; int x; cin >> n; for (int i = 0; i < n; i++) { cin >> cmd; if (cmd == "insert") { cin >> x; l.push_front(x); } else if (cmd == "delete") { cin >> x; auto it = find(begin(l), end(l...
replace
17
18
17
21
0
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; int main() { int n; cin >> n; list<int> l; for (int i = 0; i < n; i++) { string command; cin >> command; if (command == "insert") { int x; cin >> x; l.push_front(x); } else if (command == "delete") { ...
#include <iostream> #include <list> #include <string> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; list<int> l; for (int i = 0; i < n; i++) { string command; cin >> command; if (command == "insert") { int x; cin >> x; l.push_fr...
insert
7
7
7
10
TLE
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <deque> #include <iostream> #include <string> using namespace std; int main() { int n, i, x; string s; deque<int> intlist; cin >> n; for (i = 0; i <= n - 1; i++) { cin >> s; if (s == "insert") { cin >> x; intlist.push_front(x); } else if (s == "delete") { ...
#include <cstdio> #include <deque> #include <iostream> #include <string> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, i, x; string s; deque<int> intlist; cin >> n; for (i = 0; i <= n - 1; i++) { cin >> s; if (s == "insert") { cin >> x; intlist.pus...
insert
7
7
7
9
TLE
p02265
C++
Runtime Error
/** * ???????????£???????????? ??\?????????????????????????????????????????£???????????????????£?????????????????????? insert x: ??£?????????????????????????????? x ?????????????´?????¶?????¶??????? delete x: ?????? x ??????????????????????´??????£????????????????????????????????????????????????????´?????????¨???????...
/** * ???????????£???????????? ??\?????????????????????????????????????????£???????????????????£?????????????????????? insert x: ??£?????????????????????????????? x ?????????????´?????¶?????¶??????? delete x: ?????? x ??????????????????????´??????£????????????????????????????????????????????????????´?????????¨???????...
replace
91
92
91
94
0
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { int n; cin >> n; list<int> l; string s; int x; for (int i = 0; i < n; ++i) { cin >> s; if (s == "insert") { cin >> x; l.push_front(x); } else if (s == "delete") { cin >...
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { ios_base::sync_with_stdio(false); int n; cin >> n; list<int> l; string s; int x; for (int i = 0; i < n; ++i) { cin >> s; if (s == "insert") { cin >> x; l.push_front(x); } e...
insert
7
7
7
8
TLE
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; struct lis { int d; lis *pr; lis *ne; }; lis he; int n; void ins(); void del(); void delf(); void dell(); int main() { cin >> n; string ord; lis bu = {-1, &he, &he}; he = bu; for (int i = 0; i < n; i++) { cin >> ord; if (ord == "insert") ins(...
#include <bits/stdc++.h> using namespace std; struct lis { int d; lis *pr; lis *ne; }; lis he; int n; void ins(); void del(); void delf(); void dell(); int main() { cin >> n; string ord; lis bu = {-1, &he, &he}; he = bu; for (int i = 0; i < n; i++) { cin >> ord; if (ord == "insert") ins(...
replace
64
71
64
68
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; int main() { int n, x; string str; list<int> lst; list<int>::iterator it; cin >> n; while (n--) { cin >> str; if (str == "insert") { cin >> x; lst.push_front(x); } else if (str == "deleteFirst") lst.pop_...
#include <iostream> #include <list> #include <string> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, x; string str; list<int> lst; list<int>::iterator it; cin >> n; while (n--) { cin >> str; if (str == "insert") { cin >> x; lst.push_front(x); } ...
insert
5
5
5
7
TLE
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct DLL { ll x; DLL *next; DLL *prev; }; int main(void) { int n; cin >> n; DLL *head; head = (DLL *)malloc(sizeof(DLL)); head->x = -1; head->next = head; head->prev = head; for (int i = 0; i < n; i++) { string comm; l...
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct DLL { ll x; DLL *next; DLL *prev; }; int main(void) { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; DLL *head; head = (DLL *)malloc(sizeof(DLL)); head->x = -1; head->next = head; head->prev = head; for (in...
insert
11
11
11
13
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; typedef struct n { int Key; n *prev, *next; } Node; Node *nil; const string COMMAND[4] = {"insert", "deleteFirst", "deleteLast", "delete"}; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; n...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; typedef struct n { int Key; n *prev, *next; } Node; Node *nil; const string COMMAND[4] = {"insert", "deleteFirst", "deleteLast", "delete"}; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; n...
insert
32
32
32
34
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <iostream> #include <list> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int n; list<int> x; int main() { ios_base::sync_with_stdio(false); cin >> n; rep(i, n) { string a; cin >> a; if (a == "deleteFirst") { x.pop_front(); } else if (a...
#include <algorithm> #include <iostream> #include <list> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int n; list<int> x; int main() { ios_base::sync_with_stdio(false); cin >> n; rep(i, n) { string a; cin >> a; if (a == "deleteFirst") { x.pop_front(); } else if (a...
replace
27
28
27
31
0
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> #include <string> using namespace std; void display(list<int> &lst) { if (!lst.empty()) { cout << lst.front(); lst.pop_front(); } for (auto element : lst) { cout << ' ' << element; } cout << endl; } int main() { list<int> lst; int n = 0; cin >> n; for ...
#include <iostream> #include <list> #include <string> using namespace std; void display(list<int> &lst) { if (!lst.empty()) { cout << lst.front(); lst.pop_front(); } for (auto element : lst) { cout << ' ' << element; } cout << endl; } int main() { ios::sync_with_stdio(false); list<int> lst; ...
insert
17
17
17
18
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <list> using namespace std; int main(void) { list<int> l; int n; string s; int d; cin >> n; for (int i = 0; i < n; i++) { cin >> s; if (s == "insert") { cin >> d; l.push_front(d); } else if (s == "delete") { cin >> d; list<int>::iterator it ...
#include <iostream> #include <list> using namespace std; int main(void) { std::ios_base::sync_with_stdio(false); list<int> l; int n; string s; int d; cin >> n; for (int i = 0; i < n; i++) { cin >> s; if (s == "insert") { cin >> d; l.push_front(d); } else if (s == "delete") { ...
insert
5
5
5
6
TLE
p02265
C++
Time Limit Exceeded
#include <iomanip> #include <iostream> #include <list> #include <string> #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; int main() { int n; list<int> l; cin >> n; REP(i, n) { string s; cin >> s; if (s[0] == 'i') { int x; cin >> x; l.push_front(x); } else ...
#include <iomanip> #include <iostream> #include <list> #include <string> #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; list<int> l; cin >> n; REP(i, n) { string s; cin >> s; if (s[0] == 'i') { int x; ...
insert
10
10
10
12
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define int long long using namespace std; struct node { int key; node *prev; node *next; }; class doubly_linked { private: public: node *head;...
#include <algorithm> #include <cctype> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define int long long using namespace std; struct node { int key; node *prev; node *next; }; class doubly_linked { private: public: node *head;...
replace
38
40
38
40
TLE
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> using namespace std; typedef struct Node { int key; Node *prev, *next; } Node; Node *nil; void insert_cell(int key) { Node *x; x = new Node; x->key = key; x->prev = nil; x->next = nil->next; x->next->prev = x; nil->next = x; } void deleteNode(Node *t) { if (...
#include <cstdio> #include <iostream> using namespace std; typedef struct Node { int key; Node *prev, *next; } Node; Node *nil; void insert_cell(int key) { Node *x; x = new Node; x->key = key; x->prev = nil; x->next = nil->next; x->next->prev = x; nil->next = x; } void deleteNode(Node *t) { if (...
replace
35
36
35
36
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { int n; cin >> n; list<int> l; string s; int x; while (n--) { cin >> s; if (s == "deleteFirst") { l.pop_front(); continue; } else if (s == "deleteLast") { l.pop_back()...
#include <algorithm> #include <iostream> #include <list> #include <string> using namespace std; int main() { int n; cin >> n; list<int> l; string s; int x; while (n--) { cin >> s; if (s == "deleteFirst") { l.pop_front(); continue; } else if (s == "deleteLast") { l.pop_back()...
replace
27
29
27
32
0
p02265
C++
Time Limit Exceeded
#include <cassert> #include <iostream> #include <list> #include <string> typedef std::list<int> IList; void input(IList &ilist); int output(const IList &vec); // IList calc(const PList& vec); int main() { IList result; input(result); // IList ovec = calc(ivec); output(result); return 0; } ///-------------...
#include <cassert> #include <iostream> #include <list> #include <string> typedef std::list<int> IList; void input(IList &ilist); int output(const IList &vec); // IList calc(const PList& vec); int main() { std::cin.tie(0); //??\?????????????????? std::ios::sync_with_stdio(false); IList result; input(result); ...
insert
12
12
12
14
TLE
p02265
C++
Time Limit Exceeded
#include "string.h" #include <iostream> using namespace std; class Node { public: Node *prev; Node *next; int data; Node() { prev = 0; next = 0; data = 0; } }; class List { private: Node head; public: List() { head.prev = &head; head.next = &head; } int insertx(int x); int del...
#include "string.h" #include <iostream> using namespace std; class Node { public: Node *prev; Node *next; int data; Node() { prev = 0; next = 0; data = 0; } }; class List { private: Node head; public: List() { head.prev = &head; head.next = &head; } int insertx(int x); int del...
replace
76
77
76
77
TLE
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct Node { int key; Node *next; Node *pre; }; struct List { Node *first; void init() { first = (Node *)malloc(sizeof(Node)); first->key = 0; first->next = first; first->pre = first; } void insert(int x) { Node ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct Node { int key; Node *next; Node *pre; }; struct List { Node *first; void init() { first = (Node *)malloc(sizeof(Node)); first->key = 0; first->next = first; first->pre = first; } void insert(int x) { Node ...
replace
49
53
49
53
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> struct Node { int key; Node *prev, *next; }; Node *NIL; void init() { NIL = new Node(); NIL->prev = NIL; NIL->next = NIL; } void insert(int key) { Node *x = new Node(); x->key = key; x->next = NIL->next; NIL->next->prev...
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> struct Node { int key; Node *prev, *next; }; Node *NIL; void init() { NIL = new Node(); NIL->prev = NIL; NIL->next = NIL; } void insert(int key) { Node *x = new Node(); x->key = key; x->next = NIL->next; NIL->next->prev...
insert
36
36
36
38
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <functional> #include <iostream> #include <list> #include <string> #include <unordered_map> int main() { std::list<unsigned> l; std::unordered_map<std::string, std::function<void(void)>> funcs{ {"insert", [&l]() { unsigned i; std::cin >> i; l.p...
#include <algorithm> #include <functional> #include <iostream> #include <list> #include <string> #include <unordered_map> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::list<unsigned> l; std::unordered_map<std::string, std::function<void(void)>> funcs{ {"insert", ...
insert
8
8
8
10
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <functional> #include <iostream> #include <list> #include <string> #include <unordered_map> int main() { std::list<unsigned> l; unsigned i; std::unordered_map<std::string, std::function<void(void)>> funcs{ {"insert", [&l, &i]() { std::cin >> i; l.push...
#include <algorithm> #include <functional> #include <iostream> #include <list> #include <string> #include <unordered_map> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::list<unsigned> l; unsigned i; std::unordered_map<std::string, std::function<void(void)>> funcs{ {"in...
insert
8
8
8
10
TLE
p02265
C++
Time Limit Exceeded
//============================================================================ // Name : LinkedList.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include...
//============================================================================ // Name : LinkedList.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include...
insert
101
101
101
103
TLE
p02265
C++
Time Limit Exceeded
#include <cassert> #include <iostream> #include <list> #include <string> class TDllist { std::list<int> FList; public: void Insert(int X) { FList.push_front(X); } void Delete(int X) { for (std::list<int>::iterator It = FList.begin(); It != FList.end(); ++It) { if (*It == X) { FList.erase(It); ...
#include <cassert> #include <iostream> #include <list> #include <string> class TDllist { std::list<int> FList; public: void Insert(int X) { FList.push_front(X); } void Delete(int X) { for (std::list<int>::iterator It = FList.begin(); It != FList.end(); ++It) { if (*It == X) { FList.erase(It); ...
insert
32
32
32
33
TLE
p02265
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <queue> using namespace std; int main() { deque<int> deq; int N; cin >> N; while (N--) { string cmd; cin >> cmd; if (cmd == "insert") { int x; cin >> x; deq.push_front(x); } else if (cmd == "delete") { int x; cin ...
#include <algorithm> #include <iostream> #include <queue> using namespace std; int main() { cin.tie(0); ios_base::sync_with_stdio(false); deque<int> deq; int N; cin >> N; while (N--) { string cmd; cin >> cmd; if (cmd == "insert") { int x; cin >> x; deq.push_front(x); } ...
insert
7
7
7
10
TLE
p02265
C++
Time Limit Exceeded
#include <iostream> #include <string> using namespace std; class DLinkList { private: struct ListNode { ListNode *prior, *next; int val; ListNode(int v) : prior(NULL), next(NULL), val(v){}; }; private: ListNode *head; int len; public: DLinkList() { head = new ListNode(-1); head->prior ...
#include <iostream> #include <string> using namespace std; class DLinkList { private: struct ListNode { ListNode *prior, *next; int val; ListNode(int v) : prior(NULL), next(NULL), val(v){}; }; private: ListNode *head; int len; public: DLinkList() { head = new ListNode(-1); head->prior ...
replace
63
64
63
64
TLE
p02265
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); list<int> lis; int cnt; cin >> cnt; string tmp; int tmpI; for (int i = 0; i < cnt; i++) { cin >> tmp; if (tmp[0] == 'i') { // insert x cin >> tmpI; lis.push_front(tmpI); } else if (tmp == "dele...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); list<int> lis; int cnt; cin >> cnt; string tmp; int tmpI; for (int i = 0; i < cnt; i++) { cin >> tmp; if (tmp[0] == 'i') { // insert x cin >> tmpI; lis.push_front(tmpI); } else if (tmp == "dele...
replace
17
18
17
18
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <iostream> #include <list> using namespace std; int main(void) { std::ios_base::sync_with_stdio(false); list<int> l; string s; int d; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> s; if (s == "insert") { cin >> d; l.push_front(d); } else if (...
#include <algorithm> #include <iostream> #include <list> using namespace std; int main(void) { std::ios_base::sync_with_stdio(false); list<int> l; string s; int d; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> s; if (s == "insert") { cin >> d; l.push_front(d); } else if (...
replace
22
23
22
24
0
p02265
C++
Time Limit Exceeded
#include <iostream> #include <iterator> #include <list> using namespace std; int main() { int n, x; string cmd; list<int> alist; cin >> n; for (int i = 0; i < n; i++) { cin >> cmd; if (cmd == "insert") { cin >> x; alist.push_front(x); } else if (cmd == "delete") { cin >> x; ...
#include <iostream> #include <iterator> #include <list> using namespace std; int main() { int n, x; string cmd; list<int> alist; cin >> n; for (int i = 0; i < n; i++) { cin >> cmd; if (cmd == "insert") { cin >> x; alist.push_front(x); } else if (cmd == "delete") { cin >> x; ...
replace
18
19
18
19
TLE
p02265
C++
Runtime Error
#include <cstdio> #include <iostream> using namespace std; typedef struct _List { _List *front; _List *rear; int data; } List; int main(void) { std::ios_base::sync_with_stdio(false); int n; string s; int d; cin >> n; List *top; List *end; List a; a.front = NULL; a.rear = NULL; a.data = 0; ...
#include <cstdio> #include <iostream> using namespace std; typedef struct _List { _List *front; _List *rear; int data; } List; int main(void) { std::ios_base::sync_with_stdio(false); int n; string s; int d; cin >> n; List *top; List *end; List a; a.front = NULL; a.rear = NULL; a.data = 0; ...
replace
61
62
61
65
0
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void initiation() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int x) { Node *a = (Node *)malloc(sizeof(Node))...
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; struct Node { int key; Node *prev, *next; }; Node *nil; void initiation() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int x) { Node *a = (Node *)malloc(sizeof(Node))...
insert
29
29
29
32
TLE
p02265
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define rep(i, n) FOR(i, 0, n) #define DEBUG(x) cout << #x << ": " << x << endl #define vint vector<int> #define vdouble ve...
#include <algorithm> #include <cassert> #include <cmath> #include <iostream> #include <string> #include <vector> #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define rep(i, n) FOR(i, 0, n) #define DEBUG(x) cout << #x << ": " << x << endl #define vint vector<int> #define vdouble ve...
replace
42
43
42
43
0
XXXXXXX
p02265
C++
Time Limit Exceeded
#include <cstdio> #include <cstdlib> #include <cstring> struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *)malloc(sizeof(Node)); x->key = key; x->next = nil->next; n...
#include <cstdio> #include <cstdlib> #include <cstring> struct Node { int key; Node *prev, *next; }; Node *nil; void init() { nil = (Node *)malloc(sizeof(Node)); nil->next = nil; nil->prev = nil; } void insert(int key) { Node *x = (Node *)malloc(sizeof(Node)); x->key = key; x->next = nil->next; n...
replace
22
23
22
23
TLE
p02265
C++
Runtime Error
#include <iostream> #include <string> using namespace std; class Node { public: int key; Node *prev; Node *next; Node(int _key, Node *_prev, Node *_next) { key = _key; prev = _prev; next = _next; } }; class List { public: Node *head; Node *last; List() { head = NULL; last = NULL; ...
#include <iostream> #include <string> using namespace std; class Node { public: int key; Node *prev; Node *next; Node(int _key, Node *_prev, Node *_next) { key = _key; prev = _prev; next = _next; } }; class List { public: Node *head; Node *last; List() { head = NULL; last = NULL; ...
insert
34
34
34
37
0