| Task: | Sukujuhla |
| Sender: | siirikuoppala |
| Submission time: | 2017-01-19 13:08:12 +0200 |
| Language: | C++ |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | RUNTIME ERROR | 0 |
| #2 | RUNTIME ERROR | 0 |
| #3 | RUNTIME ERROR | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | RUNTIME ERROR | 0.01 s | 1 | details |
| #2 | RUNTIME ERROR | 0.01 s | 2 | details |
| #3 | RUNTIME ERROR | 0.03 s | 3 | details |
Code
#include <iostream>
#include <vector>
using namespace std;
#define N (1<<18)
int t[N], V, c[N];
vector<int> v;
int main(){
int n; cin >> n;
v.push_back(0);
while(n>1){
if(n==4 || n%2==1){
v.push_back(1); //add
n-=3;
}else{
n/=2;
v.push_back(2); //mul
}
}
if(n!=1){
cout << "0\n";
return 0;
}
cout << v.size() << "\n";
for(unsigned int i=v.size()-1; i>=0; --i){
if(v[i]==0) cout << "END\n";
else if(v[i]==1) cout << "ADD\n";
else cout << "MUL\n";
}
}
Test details
Test 1
Group: 1
Verdict: RUNTIME ERROR
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (empty) |
Error:
/box/input/input.txt: line 19: 7 Segmentation fault $BIN <<< "${d[@]}"Test 2
Group: 2
Verdict: RUNTIME ERROR
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (empty) |
Error:
/box/input/input.txt: line 19: 7 Segmentation fault $BIN <<< "${d[@]}"Test 3
Group: 3
Verdict: RUNTIME ERROR
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (empty) |
Error:
/box/input/input.txt: line 19: 7 Segmentation fault $BIN <<< "${d[@]}"