結果
| 問題 |
No.2649 [Cherry 6th Tune C] Anthem Flower
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-23 21:25:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 119 ms / 2,000 ms |
| コード長 | 286 bytes |
| コンパイル時間 | 631 ms |
| コンパイル使用メモリ | 65,032 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-29 05:25:54 |
| 合計ジャッジ時間 | 3,052 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;cin>>T;
for(;T--;)
{
string N;
int M;
cin>>N>>M;
long long n=0;
for(char c:N)
{
n=(n*10+c-'0')%(2*M);
}
cout<<n*(n+1)%(2*M)/2<<"\n";
}
}