Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <iostream>
- #include "lock.h"
- #define OUTP freopen("output.txt","w",stdout)
- using namespace std;
- string a,b;
- int arr[100001];
- void AddDigit(int f,int s){
- a+=(char)(f+'0');
- b+=(char)(s+'0');
- }
- int Question(int p){
- for(int i(0); i < 1500;i++)arr[i] = 0;
- int pnt = 0;
- for(int i(a.size()-1); i>=0;i--){
- int fst = (int)(a[i]-'0');
- int snd = (int)(b[i]-'0');
- arr[pnt]+= (fst+snd);
- if(arr[pnt]>=10){
- arr[pnt+1]++;
- arr[pnt]-=10;
- }
- pnt++;
- }
- int q = arr[p-1];
- return q;
- }
- void DelDigits(int p){
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement