Editorial for [sw] Floor of a Line

이 해설은 꼭 필요할 때만 사용하고, 코드를 복사-붙여넣기 하지 마세요. 문제 출제자와 해설 작성자를 존중해 주세요.
문제를 직접 풀기 전에 공식 해답을 제출하는 것은 제재 대상입니다.

문제 코드

#include <bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    int a,b,c; cin>>a>>b>>c;
    int l,r; cin>>l>>r;

    int cnt=0;
    for(int x=l;x<=r;x++){
        for(int y=1;y<=2000;y++){
            if(b*y<=a*x+c) cnt++;
        }
    }
    cout<<cnt;


    return 0;
}

댓글

현재 작성된 댓글이 없습니다.