Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
78365 sh25_shenpy 四叶玫瑰数 C++ Accepted 0 MS 256 KB 452 2025-12-26 15:41:43

Tests(1/1):


#include <iostream> #include <cmath> using namespace std; bool isQuadraticRose(int n) { int a = n / 1000; int b = (n % 1000) / 100; int c = (n % 100) / 10; int d = n % 10; return n == pow(a, 4) + pow(b, 4) + pow(c, 4) + pow(d, 4); } int main() { int N, M; cin >> N >> M; for (int i = N; i <= M; i++) { if (isQuadraticRose(i)) { cout << i << " "; } } return 0; }


Judgement Protocol: