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