Submission #615900
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]; } template<class T> inline void psall(set<T> x){ // 要素を出力する set<int>::iterator it = x.begin(); while (it != nums.end()) { cout << *it << endl; ++it; } } template<class T> inline void pmall(map<int, string> x){ // 要素を出力する set<int>::iterator it = x.begin(); while (it != nums.end()) { cout << *it << endl; ++it; } } //定数 //-------------------------------------------- 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(i, 1, n){ 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 | 5539 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘void psall(std::set<T>)’: ./Main.cpp:145:15: error: ‘nums’ was not declared in this scope while (it != nums.end()) ^ ./Main.cpp: In function ‘void pmall(std::map<int, std::basic_string<char> >)’: ./Main.cpp:154:15: error: ‘nums’ was not declared in this scope while (it != nums.end()) ^ ./Main.cpp: In function ‘int main()’: ./Main.cpp:218:17: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result] system("pause"); ^