Skip to content

Instantly share code, notes, and snippets.

@yakk512
Created March 26, 2014 13:57
Show Gist options
  • Save yakk512/9783652 to your computer and use it in GitHub Desktop.
Save yakk512/9783652 to your computer and use it in GitHub Desktop.
Atcoder Beginner Contest001
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<numeric>
#include<map>
#include<math.h>
using namespace::std;
int main(void)
{
int H1,H2;
cin >> H1;
cin >> H2;
cout << H1 - H2 << endl;
return 0;
}
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<numeric>
#include<map>
#include<math.h>
using namespace::std;
int main(void)
{
int m;
int vv;
cin >> m;
if( m < 100 )
{
vv = 0;
}
else if( 100 <= m && m <= 5000 )
{
vv = m / 100;
}
else if( 6000 <= m && m <= 30000 )
{
vv = (m / 1000) + 50;
}
else if( 35000 <= m && m <= 70000 )
{
vv = ( ( m / 1000 ) - 30 ) / 5 + 80;
}
else
{
vv = 89;
}
if( m < 1000 )
{
cout << 0;
}
cout << vv << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment