結果
| 問題 | No.2649 [Cherry 6th Tune C] Anthem Flower |
| コンテスト | |
| ユーザー |
eve__fuyuki
|
| 提出日時 | 2024-02-25 15:45:35 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 1,211 ms |
| コンパイル使用メモリ | 209,912 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-03 20:49:39 |
| 合計ジャッジ時間 | 3,308 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 26 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void fast_io() {
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
}
int main() {
fast_io();
int t;
cin >> t;
for (; t--;) {
string n;
long long m;
cin >> n >> m;
long long ans = 0;
for (char c : n) {
ans = (ans * 10 + (c - '0')) % m;
}
ans = ans * (ans + 1) / 2 % m;
cout << ans << "\n";
}
}
eve__fuyuki