結果
問題 | No.2649 [Cherry 6th Tune C] Anthem Flower |
ユーザー |
|
提出日時 | 2024-03-04 00:20:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 500 bytes |
コンパイル時間 | 1,976 ms |
コンパイル使用メモリ | 193,536 KB |
最終ジャッジ日時 | 2025-02-20 00:39:58 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 WA * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--){ string s; ll n = 0, m; cin >> s >> m; for(int i = 0; i < s.size(); i++){ n *= 10; n += s[i] - '0'; n %= 8 * m; } ll ans = n * (n + 1); while(ans % 2 != 0) ans += m; ans /= 2; ans %= m; cout << ans << '\n'; } }