Submission #5433006


Source Code Expand

#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
	int N;
	cin >> N;
	vector<int> A(N), B(N);
	for(int i=0; i<N; i++){
		cin >> A.at(i) >> B.at(i);
	}

	int ans=0;
	int tmp=0;
	for(int p=N-1; p>=0; p--){
		int tmp = A.at(p)+ans;
//		if(tmp%B.at(p)!=0){
			ans+=(B.at(p)-tmp%B.at(p))%B.at(p);
//		}
//		cout<< tmp << ans << endl;
	}

	cout << ans << endl;
	
	return 0

Submission Info

Submission Time
Task A - Multiple Array
User proton
Language C++14 (GCC 5.4.1)
Score 0
Code Size 469 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:28:9: error: expected ‘;’ at end of input
  return 0
         ^
./Main.cpp:28:9: error: expected ‘}’ at end of input