prog.txt
A = 0
REPEAT 2:
A = A + 4
REPEAT 5:
REPEAT 6:
A = A + 5
A = A + 7
REPEAT 6:
A = A + 7
REPEAT 4:
A = A + 2
A = A + 7
A = A + 2
REPEAT 7:
REPEAT 4:
A = A + 8
A = A + 7
A = A + 4
A = A + 5
A = A + 8
REPEAT 8:
A = A + 5
REPEAT 1:
A = A + 2
REPEAT 7:
A = A + 5
A = A + 5
REPEAT 2:
REPEAT 3:
A = A + 1
A = A + 1
REPEAT 5:
A = A + 1
REPEAT 9:
REPEAT 6:
A = A + 5
A = A + 1
REPEAT 6:
A = A + 2
A = A + 8
A = A + 3
REPEAT 2:
A = A + 5
REPEAT 3:
A = A + 9
REPEAT 1:
A = A + 4
REPEAT 2:
A = A + 9
REPEAT 1:
A = A + 6
A = A + 6
A = A + 4
REPEAT 3:
A = A + 7
A = A + 1
REPEAT 2:
A = A + 3
REPEAT 5:
A = A + 2
A = A + 5
A = A + 2
A = A + 4
A = A + 3
REPEAT 4:
A = A + 4
A = A + 3
A = A + 7
REPEAT 5:
REPEAT 4:
A = A + 5
A = A + 7
REPEAT 5:
A = A + 3
REPEAT 3:
A = A + 3
A = A + 1
A = A + 8
A = A + 2
REPEAT 9:
A = A + 5
REPEAT 1:
A = A + 5
A = A + 2
A = A + 8
A = A + 6
REPEAT 3:
REPEAT 4:
A = A + 9
REPEAT 5:
A = A + 2
A = A + 1
REPEAT 9:
A = A + 9
A = A + 2
REPEAT 1:
A = A + 6
A = A + 8
REPEAT 2:
A = A + 9
A = A + 4
A = A + 7
REPEAT 2:
REPEAT 7:
A = A + 3
A = A + 5
REPEAT 3:
A = A + 5
A = A + 3
A = A + 6
A = A + 4
REPEAT 9:
A = A + 2
A = A + 8
A = A + 2
A = A + 3
REPEAT 2:
REPEAT 8:
A = A + 5
A = A + 1
A = A + 6
A = A + 1
A = A + 2
REPEAT 6:
REPEAT 1:
A = A + 3
REPEAT 1:
A = A + 2
REPEAT 4:
A = A + 7
A = A + 1
A = A + 8
REPEAT 6:
A = A + 5
REPEAT 6:
A = A + 3
REPEAT 2:
A = A + 2
A = A + 9
A = A + 7
REPEAT 9:
A = A + 8
REPEAT 9:
A = A + 8
A = A + 9
A = A + 3
A = A + 2
REPEAT 6:
A = A + 3
REPEAT 9:
A = A + 1
A = A + 9
A = A + 5
REPEAT 2:
A = A + 4
A = A + 9
A = A + 8
REPEAT 5:
A = A + 6
A = A + 9
A = A + 1
REPEAT 1:
A = A + 4
A = A + 2
REPEAT 9:
REPEAT 3:
A = A + 4
REPEAT 7:
A = A + 8
A = A + 3
REPEAT 5:
A = A + 9
REPEAT 8:
A = A + 9
A = A + 8
REPEAT 4:
A = A + 7
A = A + 7
A = A + 3
A = A + 5
REPEAT 6:
A = A + 7
REPEAT 7:
A = A + 2
A = A + 2
A = A + 1
REPEAT 8:
REPEAT 1:
REPEAT 4:
A = A + 6
A = A + 6
A = A + 2
REPEAT 5:
A = A + 4
A = A + 8
A = A + 4
REPEAT 1:
A = A + 5
REPEAT 7:
A = A + 8
REPEAT 6:
A = A + 4
A = A + 4
A = A + 8
REPEAT 4:
A = A + 2
REPEAT 2:
A = A + 4
REPEAT 2:
A = A + 3
REPEAT 1:
A = A + 2
A = A + 8
REPEAT 2:
A = A + 7
REPEAT 8:
A = A + 6
A = A + 1
A = A + 7
REPEAT 8:
A = A + 2
REPEAT 8:
REPEAT 6:
A = A + 1
A = A + 6
REPEAT 2:
A = A + 4
A = A + 1
A = A + 7
A = A + 4
REPEAT 4:
REPEAT 9:
A = A + 2
REPEAT 1:
A = A + 2
A = A + 5
REPEAT 8:
REPEAT 6:
A = A + 3
REPEAT 4:
A = A + 1
A = A + 6
A = A + 1
REPEAT 7:
A = A + 7
REPEAT 7:
A = A + 3
A = A + 9
A = A + 1
A = A + 9
REPEAT 3:
A = A + 5
A = A + 5
A = A + 6
A = A + 2
REPEAT 1:
A = A + 4
REPEAT 2:
A = A + 7
REPEAT 1:
A = A + 7
REPEAT 4:
A = A + 7
A = A + 2
REPEAT 5:
A = A + 9
A = A + 1
A = A + 9
A = A + 5
A = A + 9
REPEAT 5:
A = A + 5
REPEAT 1:
A = A + 6
REPEAT 2:
A = A + 3
A = A + 2
A = A + 6
A = A + 8
A = A + 8
A = A + 7
A = A + 5
A = A + 5
REPEAT 2:
A = A + 1
A = A + 7
A = A + 3
REPEAT 2:
A = A + 7
A = A + 1
A = A + 4
REPEAT 1:
REPEAT 7:
REPEAT 2:
A = A + 3
A = A + 5
A = A + 2
A = A + 6
A = A + 1
A = A + 2
A = A + 4
A = A + 9
REPEAT 1:
A = A + 8
REPEAT 8:
REPEAT 4:
REPEAT 8:
A = A + 4
REPEAT 3:
A = A + 1
A = A + 8
REPEAT 7:
A = A + 8
REPEAT 7:
A = A + 7
A = A + 7
REPEAT 7:
A = A + 6
REPEAT 5:
A = A + 9
A = A + 3
REPEAT 4:
A = A + 5
A = A + 5
A = A + 4
REPEAT 9:
REPEAT 3:
A = A + 4
A = A + 3
A = A + 6
REPEAT 1:
A = A + 3
A = A + 3
A = A + 6
REPEAT 6:
A = A + 7
A = A + 7
A = A + 5
A = A + 5
A = A + 1
A = A + 2
A = A + 6
A = A + 6
REPEAT 9:
A = A + 6
REPEAT 1:
REPEAT 2:
A = A + 4
A = A + 7
REPEAT 3:
A = A + 6
REPEAT 5:
A = A + 3
A = A + 6
REPEAT 9:
A = A + 3
A = A + 6
REPEAT 5:
A = A + 8
A = A + 8
REPEAT 3:
A = A + 7
A = A + 9
A = A + 8
A = A + 3
A = A + 3
A = A + 9
REPEAT 6:
A = A + 9
A = A + 1
REPEAT 4:
REPEAT 1:
A = A + 7
REPEAT 9:
A = A + 2
A = A + 9
A = A + 1
A = A + 2
A = A + 8
A = A + 7
A = A + 9
A = A + 6
REPEAT 4:
REPEAT 2:
A = A + 3
REPEAT 3:
A = A + 4
A = A + 4
REPEAT 6:
A = A + 6
A = A + 1
A = A + 5
A = A + 8
REPEAT 2:
A = A + 6
REPEAT 1:
REPEAT 2:
A = A + 2
REPEAT 3:
A = A + 1
REPEAT 1:
A = A + 8
A = A + 7
A = A + 4
A = A + 2
A = A + 8
A = A + 4
REPEAT 5:
REPEAT 6:
A = A + 8
REPEAT 9:
A = A + 5
A = A + 5
REPEAT 5:
A = A + 5
REPEAT 3:
REPEAT 5:
A = A + 4
REPEAT 4:
A = A + 6
A = A + 3
REPEAT 7:
A = A + 3
A = A + 3
A = A + 1
A = A + 7
A = A + 7
A = A + 6
A = A + 5
A = A + 5
A = A + 6
REPEAT 1:
A = A + 9
A = A + 3
REPEAT 1:
REPEAT 1:
A = A + 1
REPEAT 8:
A = A + 5
REPEAT 8:
A = A + 6
REPEAT 4:
A = A + 9
A = A + 4
REPEAT 2:
A = A + 3
A = A + 7
REPEAT 5:
A = A + 7
A = A + 5
A = A + 8
A = A + 7
A = A + 8
A = A + 5
REPEAT 2:
A = A + 5
A = A + 7
A = A + 8
A = A + 5
A = A + 9
REPEAT 2:
REPEAT 6:
A = A + 9
A = A + 1
A = A + 8
A = A + 7
A = A + 1
A = A + 5
REPEAT 3:
A = A + 3
A = A + 9
A = A + 7
REPEAT 3:
A = A + 9
A = A + 1
REPEAT 6:
A = A + 1
REPEAT 9:
REPEAT 7:
A = A + 3
REPEAT 5:
A = A + 5
A = A + 8
A = A + 8
A = A + 1
A = A + 2
REPEAT 4:
A = A + 6
REPEAT 3:
A = A + 3
A = A + 7
REPEAT 8:
REPEAT 1:
A = A + 7
A = A + 8
A = A + 3
A = A + 1
A = A + 2
A = A + 4
A = A + 7
REPEAT 1:
REPEAT 1:
REPEAT 1:
A = A + 4
A = A + 6
REPEAT 1:
A = A + 3
A = A + 9
A = A + 6
REPEAT 9:
A = A + 1
A = A + 6
REPEAT 5:
A = A + 3
A = A + 9
A = A + 5
A = A + 5
A = A + 7
A = A + 2
REPEAT 2:
A = A + 7
A = A + 7
REPEAT 7:
REPEAT 4:
A = A + 6
A = A + 8
REPEAT 6:
A = A + 6
REPEAT 2:
A = A + 1
A = A + 7
A = A + 6
A = A + 7
REPEAT 4:
REPEAT 7:
A = A + 1
REPEAT 2:
A = A + 2
A = A + 5
A = A + 8
A = A + 2
A = A + 1
A = A + 4
REPEAT 8:
A = A + 5
A = A + 6
REPEAT 7:
REPEAT 6:
REPEAT 9:
A = A + 7
A = A + 8
REPEAT 4:
A = A + 6
A = A + 4
A = A + 3
A = A + 6
REPEAT 9:
A = A + 3
REPEAT 9:
A = A + 2
A = A + 7
A = A + 5
A = A + 2
REPEAT 7:
REPEAT 8:
REPEAT 6:
A = A + 4
A = A + 9
A = A + 5
A = A + 3
A = A + 9
REPEAT 4:
REPEAT 1:
A = A + 6
A = A + 8
REPEAT 1:
A = A + 6
A = A + 4
A = A + 6
REPEAT 3:
A = A + 7
REPEAT 3:
A = A + 4
A = A + 4
A = A + 2
A = A + 3
A = A + 7
REPEAT 5:
A = A + 6
A = A + 5
REPEAT 1:
REPEAT 8:
A = A + 5
REPEAT 3:
A = A + 6
REPEAT 9:
A = A + 4
A = A + 3
REPEAT 6:
REPEAT 2:
A = A + 1
A = A + 5
A = A + 2
A = A + 2
A = A + 7
REPEAT 4:
A = A + 7
A = A + 9
A = A + 2
REPEAT 8:
A = A + 9
REPEAT 9:
REPEAT 2:
A = A + 3
A = A + 2
A = A + 1
A = A + 5
REPEAT 9:
A = A + 1
A = A + 3
A = A + 9
REPEAT 7:
A = A + 2
REPEAT 5:
A = A + 9
A = A + 3
REPEAT 2:
A = A + 4
REPEAT 8:
A = A + 9
REPEAT 5:
A = A + 5
A = A + 4
A = A + 2
A = A + 4
REPEAT 6:
A = A + 2
REPEAT 5:
A = A + 7
A = A + 7
A = A + 8
A = A + 3
REPEAT 8:
A = A + 2
A = A + 5
REPEAT 1:
A = A + 8
A = A + 5
A = A + 1
A = A + 1
A = A + 5
REPEAT 2:
A = A + 6
REPEAT 6:
A = A + 9
A = A + 2
A = A + 5
REPEAT 4:
A = A + 7
A = A + 1
REPEAT 6:
A = A + 8
A = A + 4
REPEAT 3:
REPEAT 2:
A = A + 1
A = A + 5
REPEAT 2:
A = A + 7
REPEAT 9:
A = A + 6
A = A + 8
A = A + 9
A = A + 5
REPEAT 9:
REPEAT 3:
A = A + 7
A = A + 7
A = A + 9
A = A + 7
REPEAT 5:
A = A + 7
A = A + 2
A = A + 1
A = A + 8
A = A + 3
A = A + 5
A = A + 1
REPEAT 8:
A = A + 4
A = A + 2
A = A + 2
A = A + 8
REPEAT 4:
REPEAT 4:
A = A + 8
REPEAT 7:
A = A + 5
A = A + 2
REPEAT 2:
A = A + 6
REPEAT 4:
A = A + 8
A = A + 6
A = A + 1
A = A + 3
A = A + 2
A = A + 7
A = A + 4
REPEAT 8:
A = A + 2
A = A + 4
REPEAT 5:
REPEAT 3:
REPEAT 6:
A = A + 8
A = A + 1
A = A + 6
A = A + 5
A = A + 9
REPEAT 8:
A = A + 7
REPEAT 6:
A = A + 4
A = A + 5
REPEAT 3:
A = A + 1
REPEAT 1:
REPEAT 5:
A = A + 6
A = A + 2
REPEAT 9:
REPEAT 5:
A = A + 9
A = A + 3
REPEAT 9:
A = A + 9
A = A + 8
REPEAT 8:
REPEAT 5:
A = A + 9
A = A + 4
REPEAT 9:
A = A + 3
A = A + 4
A = A + 5
REPEAT 9:
REPEAT 7:
A = A + 5
REPEAT 3:
A = A + 7
REPEAT 9:
REPEAT 6:
A = A + 4
A = A + 6
REPEAT 5:
REPEAT 6:
A = A + 5
A = A + 3
A = A + 3
A = A + 3
A = A + 5
REPEAT 7:
A = A + 5
REPEAT 2:
A = A + 5
A = A + 6
REPEAT 2:
A = A + 2
A = A + 5
A = A + 3
A = A + 5
A = A + 5
REPEAT 4:
A = A + 2
A = A + 1
REPEAT 9:
A = A + 9
A = A + 5
A = A + 6
A = A + 2
A = A + 2
A = A + 5
REPEAT 9:
A = A + 5
A = A + 4
REPEAT 4:
REPEAT 4:
A = A + 1
A = A + 2
REPEAT 6:
A = A + 9
A = A + 3
REPEAT 2:
A = A + 5
A = A + 1
A = A + 1
A = A + 3
A = A + 8
REPEAT 7:
A = A + 4
REPEAT 6:
A = A + 9
REPEAT 5:
A = A + 9
A = A + 8
A = A + 3
A = A + 9
A = A + 4
A = A + 6
REPEAT 7:
A = A + 9
REPEAT 9:
A = A + 4
A = A + 9
A = A + 1
A = A + 3
REPEAT 5:
REPEAT 1:
A = A + 4
A = A + 4
REPEAT 8:
A = A + 9
A = A + 6
A = A + 2
REPEAT 3:
A = A + 4
A = A + 4
REPEAT 3:
A = A + 5
A = A + 2
A = A + 8
A = A + 3
A = A + 6
A = A + 4
A = A + 9
A = A + 1
A = A + 9
A = A + 5
A = A + 3
REPEAT 3:
A = A + 2
A = A + 5
A = A + 8
A = A + 2
A = A + 5
REPEAT 8:
REPEAT 2:
A = A + 6
A = A + 7
A = A + 6
A = A + 9
A = A + 2
REPEAT 2:
A = A + 3
REPEAT 8:
A = A + 7
A = A + 2
A = A + 1
A = A + 4
A = A + 1
A = A + 5
A = A + 2
A = A + 1
REPEAT 1:
A = A + 1
REPEAT 6:
A = A + 4
A = A + 3
A = A + 3
REPEAT 5:
A = A + 3
REPEAT 6:
REPEAT 1:
A = A + 5
A = A + 7
A = A + 7
A = A + 7
REPEAT 5:
A = A + 9
A = A + 7
REPEAT 5:
A = A + 9
A = A + 1
A = A + 9
A = A + 8
REPEAT 1:
A = A + 2
REPEAT 5:
A = A + 8
REPEAT 3:
A = A + 2
A = A + 9
A = A + 6
A = A + 3
REPEAT 5:
REPEAT 6:
A = A + 5
A = A + 5
REPEAT 4:
A = A + 5
A = A + 4
REPEAT 8:
A = A + 9
A = A + 1
REPEAT 8:
A = A + 8
A = A + 1
A = A + 4
REPEAT 6:
A = A + 6
REPEAT 2:
A = A + 3
A = A + 9
A = A + 6
A = A + 9
REPEAT 1:
A = A + 4
REPEAT 3:
A = A + 3
A = A + 4
A = A + 2
A = A + 8
REPEAT 2:
A = A + 4
A = A + 1
REPEAT 9:
A = A + 2
A = A + 9
A = A + 7
REPEAT 7:
REPEAT 7:
REPEAT 5:
A = A + 7
REPEAT 5:
A = A + 1
A = A + 1
REPEAT 5:
A = A + 6
REPEAT 1:
A = A + 4
REPEAT 9:
A = A + 4
A = A + 1
REPEAT 6:
A = A + 8
A = A + 5
REPEAT 1:
A = A + 4
REPEAT 5:
A = A + 8
A = A + 7
A = A + 2
REPEAT 3:
A = A + 3
REPEAT 8:
REPEAT 8:
A = A + 4
A = A + 7
REPEAT 5:
A = A + 1
REPEAT 8:
A = A + 7
A = A + 8
A = A + 4
A = A + 7
A = A + 6
A = A + 9
A = A + 5
REPEAT 3:
A = A + 5
REPEAT 9:
A = A + 1
A = A + 7
REPEAT 1:
A = A + 8
A = A + 4
REPEAT 8:
REPEAT 7:
A = A + 2
REPEAT 4:
A = A + 6
A = A + 6
REPEAT 1:
A = A + 7
A = A + 1
REPEAT 9:
REPEAT 5:
A = A + 6
A = A + 5
REPEAT 7:
A = A + 3
A = A + 6
A = A + 8
REPEAT 2:
A = A + 7
A = A + 1
A = A + 9
REPEAT 3:
REPEAT 3:
A = A + 5
Code
#include<iostream>
#include<stack>
using namespace std;
int main()
{
freopen("prog.txt","r",stdin);
string s;
stack<int> sk;
int ci = 1;
int res = 0;
while(getline(cin,s)){
int pos = 0, len = s.size(), sj, mid;
while(pos < len && s[pos] == ' ') ++pos;
sj = pos / 4;
while(sk.size() > sj) {
ci /= sk.top();
sk.pop();
}
if(s[pos] == 'R') {
pos += 7;
for(mid = 0; pos < len-1; ++pos) mid = mid * 10 + s[pos]-'0';
sk.push(mid); ci *= mid;
} else {
pos += 8;
for(mid = 0; pos < len; ++pos) mid = mid * 10 + s[pos]-'0';
res += mid * ci;
}
}
cout<<res<<endl;
return 0;
}
Answer
241830
|