Task: | Taulukot |
Sender: | |
Submission time: | 2015-10-11 15:13:21 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
#2 | RUNTIME ERROR | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | ACCEPTED | 0.05 s | 1 | details |
#3 | RUNTIME ERROR | 0.14 s | 1 | details |
#4 | RUNTIME ERROR | 0.15 s | 1 | details |
#5 | RUNTIME ERROR | 0.15 s | 1 | details |
#6 | RUNTIME ERROR | 0.15 s | 2 | details |
#7 | RUNTIME ERROR | 0.14 s | 2 | details |
#8 | ACCEPTED | 0.05 s | 2 | details |
#9 | RUNTIME ERROR | 0.14 s | 2 | details |
#10 | RUNTIME ERROR | 0.13 s | 2 | details |
#11 | WRONG ANSWER | 0.06 s | 3 | details |
#12 | WRONG ANSWER | 0.07 s | 3 | details |
#13 | ACCEPTED | 0.07 s | 3 | details |
#14 | WRONG ANSWER | 0.06 s | 3 | details |
#15 | WRONG ANSWER | 0.05 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:23:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] #define FOR(i, a, b) for (int i = (a); i < (b); ++i) ^ input/code.cpp:65:2: note: in expansion of macro 'FOR' FOR(i,0,l1.size()) { ^ input/code.cpp:23:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] #define FOR(i, a, b) for (int i = (a); i < (b); ++i) ^ input/code.cpp:70:2: note: in expansion of macro 'FOR' FOR(i,0,l2.size()) { ^
Code
#include <iostream> #include <vector> #include <string> #include <map> #include <unordered_map> #include <algorithm> #include <utility> #include <set> #include <unordered_set> #include <cmath> #include <math.h> #include <queue> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sstream> #include <tuple> using namespace std; typedef long long LL; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) bool isPrime(int num) { if (!(num/2)) return false; for (int i = 1; ++i <= num / 2;) { if(0 == num % i) return false; } return true; } int main() { int n; cin >> n; vector<int> l1(n); vector<int> l2(n); int pos = 0; while (true) { //cout << n << " q" << endl; if (n == 1) { l1[pos] = 1; l2[pos] = 1; break; } int cand = n + 1; while (!isPrime(cand)) { cand++; } //cout << cand << " " << cand-n << " q " << n+1 << endl; FOR(i,cand-n,n+1) { l1[pos] = i; l2[pos] = cand-i; //cout << "QQQQQ " << pos << " "<< l1[pos] << " " << l2[pos] << endl; pos++; } n = cand-n; } FOR(i,0,l1.size()) { cout << l1[i] << " "; } cout << endl; FOR(i,0,l2.size()) { cout << l2[i] << " "; } cout << endl; }
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
1 |
correct output |
---|
1 1 |
user output |
---|
1 1 |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
4 |
correct output |
---|
1 2 3 4 2 1 4 3 |
user output |
---|
1 2 3 4 4 3 2 1 |
Test 3
Group: 1
Verdict: RUNTIME ERROR
input |
---|
5 |
correct output |
---|
1 2 3 4 5 1 5 4 3 2 |
user output |
---|
2 3 4 5 1 5 4 3 2 2 |
Error:
*** Error in `input/code': free(): invalid pointer: 0x00000000013ef030 ***
Test 4
Group: 1
Verdict: RUNTIME ERROR
input |
---|
8 |
correct output |
---|
1 2 3 4 5 6 7 8 2 1 4 3 8 7 6 5 |
user output |
---|
3 4 5 6 7 8 2 3 8 7 6 5 4 3 3 2 |
Error:
*** Error in `input/code': free(): invalid pointer: 0x00000000021b7040 ***
Test 5
Group: 1
Verdict: RUNTIME ERROR
input |
---|
9 |
correct output |
---|
1 2 3 4 5 6 7 8 9 1 5 4 3 2 7 6 9 8 |
user output |
---|
2 3 4 5 6 7 8 9 1 9 8 7 6 5 4 3 2 2 |
Error:
*** Error in `input/code': free(): invalid pointer: 0x0000000001da6040 ***
Test 6
Group: 2
Verdict: RUNTIME ERROR
input |
---|
77 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
2 3 4 5 6 7 8 9 10 11 12 13 14... |
Error:
*** Error in `input/code': free(): invalid pointer: 0x00000000015ef150 ***
Test 7
Group: 2
Verdict: RUNTIME ERROR
input |
---|
70 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
Error:
*** Error in `input/code': free(): invalid pointer: 0x0000000001e44130 ***
Test 8
Group: 2
Verdict: ACCEPTED
input |
---|
72 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
Test 9
Group: 2
Verdict: RUNTIME ERROR
input |
---|
86 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
3 4 5 6 7 8 9 10 11 12 13 14 1... |
Error:
*** Error in `input/code': double free or corruption (out): 0x00000000009b6170 ***
Test 10
Group: 2
Verdict: RUNTIME ERROR
input |
---|
68 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
3 4 5 6 7 8 9 10 11 12 13 14 1... |
Error:
*** Error in `input/code': free(): invalid pointer: 0x0000000000b3e130 ***
Test 11
Group: 3
Verdict: WRONG ANSWER
input |
---|
90764 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
23 24 25 26 27 28 29 30 31 32 ... |
Test 12
Group: 3
Verdict: WRONG ANSWER
input |
---|
97976 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
11 12 13 14 15 16 17 18 19 20 ... |
Test 13
Group: 3
Verdict: ACCEPTED
input |
---|
96762 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
Test 14
Group: 3
Verdict: WRONG ANSWER
input |
---|
94823 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
14 15 16 17 18 19 20 21 22 23 ... |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
91479 |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
14 15 16 17 18 19 20 21 22 23 ... |