Submission #1337026


Source Code Expand

#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
#define int ll
signed main(){
    int n; cin>>n;
    pii ans=pii(1,1);
    rep(i,n){
        int a,b; cin>>a>>b;
        int power=max((int)1,max(ans.first/a+(ans.first%a?1:0),ans.second/b+(ans.second%b?1:0)));
        ans=pii(a*power,b*power);
    }
    cout<<ans.first+ans.second<<endl;
}

Submission Info

Submission Time
Task C - AtCoDeer and Election Report
User yebityon
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1420 Byte
Status WA
Exec Time 2 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 6
WA × 9
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt
Case Name Status Exec Time Memory
0_000.txt AC 1 ms 256 KB
0_001.txt AC 1 ms 256 KB
0_002.txt AC 1 ms 256 KB
1_003.txt AC 1 ms 256 KB
1_004.txt AC 1 ms 256 KB
1_005.txt WA 1 ms 256 KB
1_006.txt WA 1 ms 256 KB
1_007.txt WA 1 ms 256 KB
1_008.txt WA 1 ms 256 KB
1_009.txt WA 1 ms 256 KB
1_010.txt WA 1 ms 256 KB
1_011.txt WA 1 ms 256 KB
1_012.txt WA 1 ms 256 KB
1_013.txt WA 2 ms 256 KB
1_014.txt AC 2 ms 256 KB