AtCoder Beginner Contest 195

简介: A - Health M Death

A - Health M Death


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m;
  cin>>n>>m;
  if(m%n==0){
    cout<<"Yes"<<endl;
  }
  else {
    cout<<"No"<<endl;
  }
}


B - Many Oranges

确实不好意思说自己做这题做到绝望了=。=希望能把眼睛捐给会用的人嗷


#include <bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,w,i,j;
  cin>>a>>b>>w;
  w*=1000;
  int max1=0,min1=1e9;
  for(i=1;i<=1000000;i++){
    if(a*i<=w&&b*i>=w){
      max1=max(max1,i);
      min1=min(min1,i);
    }
  }
  if(min1!=1e9&&max1!=0)
    cout<<min1<<" "<<max1<<endl;
  else 
    cout<<"UNSATISFIABLE"<<endl;
} 


C - Comma


明明很简单的数学题硬要开个啥dp数组磨了十多分钟

=。=


#include <bits/stdc++.h>
using namespace std;
#define int long long 
signed main()
{
  int n,ans=0;
  cin>>n;
  if(n>=1000)ans+=n-999;
  if(n>=1000000) ans+=n-999999;
  if(n>=1000000000) ans+=n-999999999;
  if(n>=1000000000000) ans+=n-999999999999;
  if(n>=1000000000000000) ans+=n-999999999999999;
  cout<<ans<<endl;
}
相关文章
|
机器学习/深度学习
AtCoder Beginner Contest 215 E - Chain Contestant (状压dp)
AtCoder Beginner Contest 215 E - Chain Contestant (状压dp)
130 0
|
人工智能
atcoder AtCoder Beginner Contest 210 D - National Railway(dp)
atcoder AtCoder Beginner Contest 210 D - National Railway(dp)
122 0
|
机器学习/深度学习 人工智能 Java
AtCoder Beginner Contest 215 D - Coprime 2 (质因子分解 gcd)
AtCoder Beginner Contest 215 D - Coprime 2 (质因子分解 gcd)
115 0
|
算法
AtCoder Beginner Contest 213 E - Stronger Takahashi(01BFS)
AtCoder Beginner Contest 213 E - Stronger Takahashi(01BFS)
141 0
AtCoder Beginner Contest 133 E - Virus Tree 2(组合数学)
AtCoder Beginner Contest 133 E - Virus Tree 2(组合数学)
114 0
AtCoder Beginner Contest 176 D - Wizard in Maze(01BFS)
AtCoder Beginner Contest 176 D - Wizard in Maze(01BFS)
122 0
|
定位技术
German collegiate programming contest 2012 - Ski Jumping
首先用动能定理算出平抛的初速度v0,然后分三种情况,0~L/2,L/2~L,L~无穷远。
144 0
German collegiate programming contest 2012 - Ski Jumping