結果
問題 | No.2649 [Cherry 6th Tune C] Anthem Flower |
ユーザー |
|
提出日時 | 2024-03-04 00:14:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 387 bytes |
コンパイル時間 | 1,908 ms |
コンパイル使用メモリ | 192,688 KB |
最終ジャッジ日時 | 2025-02-20 00:39:37 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 26 |
ソースコード
#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 = (n * 10 + (s[i] - '0')) % m; } cout << ((n * (n + 1)) / 2) % m << '\n'; } }