Submission #45357834
Source Code Expand
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
using namespace std;
const int N = 200200;
#define inf 0x3f3f3f3f
int n;
char s[N];
vector <int> v;
int main(){
cin >> n;
for (int i = 1; i <= 9; i ++)
if (n % i == 0) v.push_back(i);
for (int i = 0; i <= n; i ++) {
int flag = 0;
for (int j = 0; j < v.size(); j ++)
if (i % (n / v[j]) == 0) {
s[i] = v[j] + '0';
flag = 1;
break;
}
if (!flag) s[i] = '-';
}
for (int i = 0; i <= n; i++) cout << s[i];
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Measure |
| User | TKXZ133 |
| Language | C++ 20 (gcc 12.2) |
| Score | 200 |
| Code Size | 687 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3644 KiB |
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:23:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
23 | for (int j = 0; j < v.size(); j ++)
| ~~^~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, example0.txt, example1.txt, example2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 1 ms | 3492 KiB |
| 001.txt | AC | 1 ms | 3496 KiB |
| 002.txt | AC | 1 ms | 3504 KiB |
| 003.txt | AC | 1 ms | 3492 KiB |
| 004.txt | AC | 1 ms | 3372 KiB |
| 005.txt | AC | 1 ms | 3464 KiB |
| 006.txt | AC | 1 ms | 3452 KiB |
| 007.txt | AC | 1 ms | 3440 KiB |
| 008.txt | AC | 1 ms | 3456 KiB |
| 009.txt | AC | 1 ms | 3448 KiB |
| 010.txt | AC | 1 ms | 3440 KiB |
| 011.txt | AC | 1 ms | 3496 KiB |
| 012.txt | AC | 1 ms | 3644 KiB |
| 013.txt | AC | 1 ms | 3492 KiB |
| 014.txt | AC | 1 ms | 3464 KiB |
| 015.txt | AC | 1 ms | 3436 KiB |
| 016.txt | AC | 1 ms | 3492 KiB |
| 017.txt | AC | 1 ms | 3456 KiB |
| example0.txt | AC | 1 ms | 3440 KiB |
| example1.txt | AC | 1 ms | 3452 KiB |
| example2.txt | AC | 1 ms | 3460 KiB |