Submission #12065076
Source Code Expand
#include <bits/stdc++.h>
#define rep(i,l,r) for(int (i)=(l);(i)<(r);(i)++)
#define ll long long
using namespace std;
int main(){
ll n,k;
cin>>n>>k;
ll ans= min(n%k,abs(n%k-k));
cout<<ans<<endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Replacing Integer |
| User | komugi |
| Language | C++14 (GCC 5.4.1) |
| Score | 300 |
| Code Size | 222 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 256 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 01.txt, 02.txt, 03.txt |
| All | 01.txt, 02.txt, 03.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 1 ms | 256 KiB |
| 02.txt | AC | 1 ms | 256 KiB |
| 03.txt | AC | 1 ms | 256 KiB |
| 11.txt | AC | 1 ms | 256 KiB |
| 12.txt | AC | 1 ms | 256 KiB |
| 13.txt | AC | 1 ms | 256 KiB |
| 14.txt | AC | 1 ms | 256 KiB |
| 15.txt | AC | 1 ms | 256 KiB |
| 16.txt | AC | 1 ms | 256 KiB |
| 17.txt | AC | 1 ms | 256 KiB |
| 18.txt | AC | 1 ms | 256 KiB |
| 19.txt | AC | 1 ms | 256 KiB |