[Offer收割]编程练习赛39 register

Ended

Participants:163

Verdict:Time Limit Exceeded
Score:40 / 100
Submitted:2017-12-10 13:36:22

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
using namespace std;
int main(){
    long int m,n,i;
    int num=0,temp,a,b;
    cin>>m>>n;
    i=1;
    while(num!=n){
        a=m;
        b=i;
        while(b!=0){
            temp=b;
            b=a%b;
            a=temp;
        }
        if(a==1)
            num++;
        i++;
    }
    cout<<i-1<<endl;
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX