Submission #616031
Source Code Expand
//include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype> // 文字判定
#include <math.h>
#include <time.h>
#include <deque> // 双方向キュー、両端キューなど
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility> // template<class T>
#include <vector>
#include <queue>
using namespace std;
//型変換
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
//typedef
//------------------------------------------
// int
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
// double
typedef vector<double> VD;
typedef vector<VD> VVD;
typedef vector<VVD> VVVD;
// string
typedef vector<string> VS;
typedef vector<VS> VVS;
typedef vector<VVS> VVVS;
typedef pair<int, int> PII;
typedef long long LL;
typedef long double LD;
typedef long double LD;
typedef map<int, string> MIS;
typedef set<int> SI;
//vector
//------------------------------------------
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define REVE(c) reverse(ALL(c))
#define COUNT(c,n) count(ALL(c), (n))
#define MAXV(c) max_element(ALL(c))
#define MINV(c) min_element(ALL(c))
#define SUM(c) accumulate((c).begin(), (c).end(), 0.0)
#define AVE(c) SUM((c)) / (c).size()
// 宣言vector(int)
//------------------------------------------
// nのvを宣言
#define VID(v,n) VI v((n))
// n*mのvを宣言
#define VVID(v,n,m) VVI v((n),VI((m)))
// n*m*oのvを宣言
#define VVVID(v,n,m,o) VVVI v((n),VVI((m),VI((o))))
// fill
// nのvを宣言(fill it with a)
#define VIFD(v,n,a) VI v((n),(a))
// n*mのvを宣言(fill it with a)
#define VVIFD(v,n,m,a) VVI v((n),VI((m),(a)))
// n*m*oのvを宣言(fill it with a)
#define VVVIFD(v,n,m,o,a) VVVI v((n),VVI((m),VI((o),(a))))
// 宣言vector(double)
//------------------------------------------
// nのvを宣言
#define VDD(v,n) VD v((n))
// n*mのvを宣言
#define VVDD(v,n,m) VVD v((n),VD((m)))
// n*m*oのvを宣言
#define VVVDD(v,n,m,o) VVVD v((n),VVD((m),VD((o))))
// fill
// nのvを宣言(fill it with a)
#define VDFD(v,n,a) VD v((n),(a))
// n*mのvを宣言(fill it with a)
#define VVDFD(v,n,m,a) VVD v((n),VD((m),(a)))
// n*m*oのvを宣言(fill it with a)
#define VVVDFD(v,n,m,o,a) VVVD v((n),VVD((m),VD((o),(a))))
// 宣言vector(string)
//------------------------------------------
// nのvを宣言
#define VSD(v,n) VS v((n))
// n*mのvを宣言
#define VVSD(v,n,m) VVS v((n),VS((m)))
// n*m*oのvを宣言
#define VVVSD(v,n,m,o) VVVS v((n),VVS((m),VS((o))))
// fill
// nのvを宣言(fill it with a)
#define VSFD(v,n,a) VS v((n),(a))
// n*mのvを宣言(fill it with a)
#define VVSFD(v,n,m,a) VVS v((n),VS((m),(a)))
// n*m*oのvを宣言(fill it with a)
#define VVVSFD(v,n,m,o,a) VVVS v((n),VVS((m),VS((o),(a))))
#define MISI(a,i,s) (a).insert(map<int,string>::value_type((i),(s)));
//for文
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a);i>(b);i--)
#define RREP(i,n) RFOR(i,n,0)
// vectorを全て出力する
template<class T> inline void pvall(vector<T> x){
REP(i, x.size() - 1)
cout << x[i] << " ";
cout << x[x.size() - 1];
}
// vectorをaからbまで出力する
template<class T> inline void pvatob(vector<T> x, int a, int b){
if (a < 0 || b >= x.size() || a > b) return;
FOR(i, a, b)
cout << x[i] << " ";
cout << x[b];
}
//定数
//--------------------------------------------
const LD EPS = 1e-10;
const LD PI = acos(-1.0);
const LL mod = 1000000007;
//メモリクリア
#define CLR(a) memset((a), 0 ,sizeof(a))
//デバッグ用
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//数学
//-------------------------------------------
inline LL factorial(int n) {
if (n > 0) {
return n * factorial(n - 1);
}
else {
return 1;
}
}
inline LL npr(int n, int r)
{
LL value;
value = factorial(n) / factorial(n - r);
return value;
}
inline LL ncr(int n, int r)
{
LL value;
value = factorial(n) / (factorial(r)*factorial(n - r));
return value;
}
int han(int n){
if (n % 25 == 0 ||
n % 2525 == 0 ||
n % 252525 == 0 ||
n % 25252525 == 0 ||
n % 2525252525 == 0)return 1;
else
return 0;
}
int main()
{
int n;
cin >> n;
int c = 0;
for (int i = 0; i < n; i+=25){
if (han(i) == 1)c++;
}
cout << --c;
cout << "\n";
//system("pause");
}
Submission Info
Submission Time |
|
Task |
A - ニコニコ数 |
User |
mkc1370 |
Language |
C++ (GCC 4.9.2) |
Score |
0 |
Code Size |
5184 Byte |
Status |
WA |
Exec Time |
249 ms |
Memory |
924 KB |
Judge Result
Set Name |
Sample |
Subtask1 |
Score / Max Score |
0 / 0 |
0 / 60 |
Status |
|
|
Set Name |
Test Cases |
Sample |
sample_01.txt, sample_02.txt |
Subtask1 |
sample_01.txt, sample_02.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt |
Case Name |
Status |
Exec Time |
Memory |
sample_01.txt |
AC |
29 ms |
780 KB |
sample_02.txt |
AC |
30 ms |
916 KB |
test_01.txt |
AC |
25 ms |
804 KB |
test_02.txt |
WA |
26 ms |
800 KB |
test_03.txt |
AC |
26 ms |
676 KB |
test_04.txt |
WA |
26 ms |
924 KB |
test_05.txt |
AC |
27 ms |
804 KB |
test_06.txt |
AC |
32 ms |
804 KB |
test_07.txt |
WA |
25 ms |
796 KB |
test_08.txt |
WA |
249 ms |
804 KB |
test_09.txt |
AC |
249 ms |
800 KB |
test_10.txt |
WA |
149 ms |
920 KB |
test_11.txt |
WA |
249 ms |
796 KB |
test_12.txt |
AC |
82 ms |
796 KB |
test_13.txt |
AC |
33 ms |
764 KB |
test_14.txt |
AC |
28 ms |
792 KB |
test_15.txt |
AC |
27 ms |
800 KB |