Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
8111 詹梓涵 完美立方 C++ Time Limit Exceeded 1000 MS 272 KB 656 2025-06-14 15:48:59

Tests(5/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n; cin>>n; for(int a=2;a<=n;a++){ for(int b=2;b<=n;b++){ for(int c=b;c<=n;c++){ for(int d=c;d<=n;d++){ if(pow(a,3)==pow(b,3)+pow(c,3)+pow(d,3)){ cout<<"Cube = "<<a<<", Triple = ("<<b<<","<<c<<","<<d<<")"<<endl; } } } } } return 0; }