Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
80506 sh25_zhuwy 分成整数 C++ 通过 126 MS 252 KB 1044 2026-01-04 15:19:22

Tests(2/2):


#include<bits/stdc++.h> using namespace std; int main() { int N, ans = 0; cin >> N; for (int i = 1; i <= N; i++) { int t = i; bool ok = true; while(t) { if(t % 10 == 3 || t % 10 == 7) ok = false; t /= 10; } if(!ok) continue; for (int j = i + 1; j <= N; j++) { int t = j; bool ok = true; while(t) { if(t % 10 == 3 || t % 10 == 7) ok = false; t /= 10; } if(!ok) continue; for (int k = j + 1; k <= N; k++) { int t = k; bool ok = true; while(t) { if(t % 10 == 3 || t % 10 == 7) ok = false; t /= 10; } if(!ok) continue; if(k == 3 || k == 7) continue; if(i + j + k != N) continue; //cout << i <<" "<<j <<" " <<" "<<k <<endl; ans++; } } } cout << ans; return 0; }


测评信息: