数独数组 https://ac.nowcoder.com/acm/problem/287754刚学语法不到一个月的新手,第一次在题解上发代码。 #include <algorithm> using namespace std; int cnt[10]; // 优化版, arr都不用开。 int main(){ int n, a; cin >> n; for(int i = 0; i <
数独数组 https://www.nowcoder.com/practice/12e6adfa05f5417dbf5a0d85ff5fb93c#include <bits/stdc++.h> using namespace std; int f[998]; int main() { int n;cin >> n; for(int i = 1;i<=n;i++) { int x;cin >> x; f[x] ++;//对每个出现的数字进行计数 } for(int i = 1;...
对于给定的由 个整数组成的数组 ,我们称其为数独数组,当且仅当其每一个长度为 的连续子。题目来自【牛客题霸】
数独数组 https://www.nowcoder.com/practice/12e6adfa05f5417dbf5a0d85ff5fb93c#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> nums(9); for (int i = 0; i < n; ++i) { int num; cin >> num; ++nums[num - 1]; } int ...
牛客856751393号 03-11 17:33 发布于湖北 关注 题解| 数独数组 数独数组 https://www.nowcoder.com/practice/12e6adfa05f5417dbf5a0d85ff5fb93c from collections import defaultdict while True: try: n = int(input()) num = list(map(int, input().split())) d = defaultdict(int) for i in...
//活动地址: 牛客春招刷题训练营 - 编程打卡活动 #include #include using namespace std; int cnt[10];// 开一个数组来存储 每个数字出现的次数 // 优化版, arr都不用开_牛客网_牛客在手,offer不愁
数独数组 https://www.nowcoder.com/practice/12e6adfa05f5417dbf5a0d85ff5fb93c#include <bits/stdc++.h> using namespace std; int f[998]; int main() { int n;cin >> n; for(int i = 1;i<=n;i++) { int x;cin >> x; f[x] ++;//对每个出现的数字进行计数 } for(int i = 1;...
#include #include using namespace std; int main() { int n; cin n; vector nums(9);_牛客网_牛客在手,offer不愁