結果
問題 |
No.2781 A%B問題
|
ユーザー |
|
提出日時 | 2024-06-14 22:34:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 870 bytes |
コンパイル時間 | 1,247 ms |
コンパイル使用メモリ | 111,760 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-14 22:34:19 |
合計ジャッジ時間 | 1,760 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 2 |
ソースコード
#include <cmath> #include <cstdio> #include <vector> #include <list> #include <iostream> #include <algorithm> #include <sstream> #include <stack> #include <fstream> #include <queue> #include <iomanip> #include <iterator> #include <map> #include <unordered_map> #include <climits> #include <cstdint> #include <set> #include <assert.h> #include <numeric> #include <random> #include <chrono> #define fast ios_base::sync_with_stdio(false) using namespace std; #define mxn (long long)(1e5+5) #define mod (long long)(1e9+7) #define mod1 (uint64_t)(998244353) #define inf (long long)(3e5) //mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count()); void solve(){ int a, b; cin>>a>>b; if(b<0) cout<<abs(a%b)<<endl; else cout<<(a%b+b)%b<<endl; } int main(){ fast; int t; t=1; //cin>>t; while(t--){ solve(); //cout<<(solve()?"yes\n":"no\n"); } }