Submission #45132836
Source Code Expand
Copy
#pragma GCC optimize(2)#include<bits/stdc++.h>#define endl '\n'using namespace std;using ll=long long;signed main() {ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);int n,m,p;cin>>n>>m>>p;int ans=0;for(int i=1;i<=n;++i)ans+=(i%p==m)||((m==p&&i%p==0));cout<<ans;return 0;}// init?// var->0?// infinite dfs?// out of bound?// max_element / min_element?
#pragma GCC optimize(2) #include<bits/stdc++.h> #define endl '\n' using namespace std; using ll=long long; signed main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n,m,p;cin>>n>>m>>p; int ans=0; for(int i=1;i<=n;++i)ans+=(i%p==m)||((m==p&&i%p==0)); cout<<ans; return 0; } // init? // var->0? // infinite dfs? // out of bound? // max_element / min_element?
Submission Info
Submission Time | |
---|---|
Task | A - Full Moon |
User | wa_wa_vegetable |
Language | C++ 20 (gcc 12.2) |
Score | 100 |
Code Size | 403 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 3616 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 1 ms | 3616 KB |
00_sample_02.txt | AC | 1 ms | 3616 KB |
00_sample_03.txt | AC | 1 ms | 3496 KB |
01_test_01.txt | AC | 1 ms | 3488 KB |
01_test_02.txt | AC | 1 ms | 3492 KB |
01_test_03.txt | AC | 1 ms | 3392 KB |
01_test_04.txt | AC | 1 ms | 3492 KB |
01_test_05.txt | AC | 1 ms | 3456 KB |
01_test_06.txt | AC | 1 ms | 3492 KB |
01_test_07.txt | AC | 1 ms | 3496 KB |
01_test_08.txt | AC | 1 ms | 3496 KB |
01_test_09.txt | AC | 1 ms | 3476 KB |
01_test_10.txt | AC | 1 ms | 3500 KB |
01_test_11.txt | AC | 1 ms | 3360 KB |
01_test_12.txt | AC | 2 ms | 3616 KB |
01_test_13.txt | AC | 1 ms | 3536 KB |
01_test_14.txt | AC | 1 ms | 3560 KB |
01_test_15.txt | AC | 1 ms | 3568 KB |