Submission #3620986
Source Code Expand
#include <bits/stdc++.h> using namespace std; using ll = long long; #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define FORE(i, a, b) for(int i=(a);i<=(b);++i) #define rep(i, n) for(int i=0;i<(n);++i) #define ALL(v) (v).begin(),(v).end() #define SP cout<<fixed<<setprecision(10) typedef pair<int, int> P; const int INF = (int) 1e9; const int MOD = (int) 1e9 + 7; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int main(void) { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int sum = 0; FORE(i, 1, 9) FORE(j, 1, 9) sum += i * j; int dif = sum - n; FORE(i, 1, 9) { FORE(j, 1, 9) { if (i * j == dif) { cout << i << " x " << j << endl; continue; } } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 九九足し算 |
User | sdub |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 759 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 384 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | sample_01.txt, sample_02.txt, test_1953.txt, test_1971.txt, test_1977.txt, test_1983.txt, test_1989.txt, test_1990.txt, test_1993.txt, test_1995.txt, test_1997.txt, test_1998.txt, test_2001.txt, test_2009.txt, test_2013.txt, test_2017.txt, test_2019.txt, test_2020.txt, test_2022.txt, test_2024.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
test_1953.txt | AC | 1 ms | 256 KB |
test_1971.txt | AC | 1 ms | 256 KB |
test_1977.txt | AC | 1 ms | 256 KB |
test_1983.txt | AC | 1 ms | 256 KB |
test_1989.txt | AC | 1 ms | 256 KB |
test_1990.txt | AC | 1 ms | 256 KB |
test_1993.txt | AC | 1 ms | 256 KB |
test_1995.txt | AC | 1 ms | 256 KB |
test_1997.txt | AC | 1 ms | 256 KB |
test_1998.txt | AC | 1 ms | 256 KB |
test_2001.txt | AC | 2 ms | 384 KB |
test_2009.txt | AC | 1 ms | 256 KB |
test_2013.txt | AC | 1 ms | 256 KB |
test_2017.txt | AC | 1 ms | 256 KB |
test_2019.txt | AC | 1 ms | 256 KB |
test_2020.txt | AC | 1 ms | 256 KB |
test_2022.txt | AC | 1 ms | 256 KB |
test_2024.txt | AC | 1 ms | 256 KB |