CSES - Datatähti 2017 loppu - Results
Submission details
Task:Sukujuhla
Sender:siirikuoppala
Submission time:2017-01-19 13:08:12 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#1UNKNOWN0
#2UNKNOWN0
#3UNKNOWN0
Test results
testverdicttimegroup
#1UNKNOWN--1details
#2UNKNOWN--2details
#3UNKNOWN--3details

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: UNKNOWN

input
#!/bin/bash
set -e
OFFSET=$(grep -onam1 '^__DATA_...

correct output
50

user output
(not available)

Test 2

Group: 2

Verdict: UNKNOWN

input
#!/bin/bash
set -e
OFFSET=$(grep -onam1 '^__DATA_...

correct output
50

user output
(not available)

Test 3

Group: 3

Verdict: UNKNOWN

input
#!/bin/bash
set -e
OFFSET=$(grep -onam1 '^__DATA_...

correct output
50

user output
(not available)