Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147755 林嘉乐 百钱买百鸡II C++ Accepted 27 MS 272 KB 370 2026-02-07 15:09:12

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,cnt=0; cin>>n; for(int a=0;a<=n/5;a++){ for(int b=0;b<=n/3;b++){ for(int c=0;c<=n/3;c++){ if(a+b+c*3==n&&5*a+3*b+c==n){ cnt++; cout<<cnt<<":"<<" "<<a<<","<<b<<","<<3*c<<endl; } } } } if(cnt==0)cout<<"None"<<endl; return 0; }