Skip to content

Commit

Permalink
[Gold III] Title: 나머지 합, Time: 136 ms, Memory: 9836 KB -BaekjoonHub
Browse files Browse the repository at this point in the history
  • Loading branch information
KKanghh committed Dec 3, 2023
1 parent 039767b commit 117ec4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 백준/Gold/10986. 나머지 합/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### 제출 일자

2023년 12월 3일 18:16:25
2023년 12월 3일 18:18:50

### 문제 설명

Expand Down
4 changes: 2 additions & 2 deletions 백준/Gold/10986. 나머지 합/나머지 합.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ int cnt[1000];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m, z = 0;
int n, m = 0;
cnt[0] = 1;
long long ans = 0;
cin >> n >> m;

for (int i = 0; i < n; i++) {
cin >> num[i + 1];
D[i + 1] = (D[i] + (num[i + 1] % m)) % m;
if (D[i + 1] == 0) ans++;
ans += cnt[D[i + 1]];
cnt[D[i + 1]]++;
}
Expand Down

0 comments on commit 117ec4c

Please sign in to comment.